苏泓源 commited on
Commit
b51f06d
·
1 Parent(s): a8c9d0c
Files changed (1) hide show
  1. app.py +18 -5
app.py CHANGED
@@ -57,7 +57,6 @@ def demo_plot(city, facility):
57
  ),
58
  name=f'Facility {i+1}'
59
  ))
60
-
61
  solution_fig.add_trace(go.Scattermapbox(
62
  lat=positions[solution_facility[:, i] == 1][:, 0],
63
  lon=positions[solution_facility[:, i] == 1][:, 1],
@@ -77,6 +76,7 @@ def demo_plot(city, facility):
77
  zoom=11.0
78
  ),
79
  margin=dict(l=0, r=0, b=0, t=0),)
 
80
  solution_fig.update_layout(
81
  mapbox=dict(
82
  style='carto-positron',
@@ -103,12 +103,25 @@ def demo_plot(city, facility):
103
  return actual_fig, solution_fig, actual_ac, solution_ac
104
 
105
 
 
 
 
 
 
 
 
106
  def get_example():
107
  return [
108
- ("example1.json", "example1.json"),
109
- ("example2.json", "example2.json"),
110
- ("example3.json", "example3.json"),
111
- ]
 
 
 
 
 
 
112
 
113
  with gr.Blocks() as demo:
114
  gr.Markdown("## Demo")
 
57
  ),
58
  name=f'Facility {i+1}'
59
  ))
 
60
  solution_fig.add_trace(go.Scattermapbox(
61
  lat=positions[solution_facility[:, i] == 1][:, 0],
62
  lon=positions[solution_facility[:, i] == 1][:, 1],
 
76
  zoom=11.0
77
  ),
78
  margin=dict(l=0, r=0, b=0, t=0),)
79
+
80
  solution_fig.update_layout(
81
  mapbox=dict(
82
  style='carto-positron',
 
103
  return actual_fig, solution_fig, actual_ac, solution_ac
104
 
105
 
106
+ def solver_plot(data_npy, boost=False):
107
+ # txt to numpy
108
+
109
+ data = np.loadtxt(data_npy)
110
+
111
+
112
+
113
  def get_example():
114
  return [
115
+ ("40.71 -73.93 213 0\n\
116
+ 40.72 -73.99 15 1\n\
117
+ 40.65 -73.88 365 1\n\
118
+ 40.57 -73.96 629 0\n\
119
+ 40.70 -73.97 106 0\n\
120
+ 40.61 -73.95 189 1\n\
121
+ 40.70 -73.98 266 0"),
122
+ ]
123
+
124
+
125
 
126
  with gr.Blocks() as demo:
127
  gr.Markdown("## Demo")