Skip to content

Commit 2149b48

Browse files
author
Isaac Peterson
committed
asdf
1 parent 68aa0b2 commit 2149b48

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

matsimAI/notebooks/analysis_different_clusters.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 4,
19+
"execution_count": null,
2020
"id": "51246194",
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
24-
"df_10 = SummaryReader(\"/home/isaacp/repos/EvMatsim/contribs/ev/evsim/gradient_flow_matching/utah_flow_results/0423153613_nclusters_10_utahnetwork/logs\").scalars\n",
25-
"df_50 = SummaryReader(\"/home/isaacp/repos/EvMatsim/contribs/ev/evsim/gradient_flow_matching/utah_flow_results/0423154624_nclusters_50_utahnetwork/logs\").scalars\n",
26-
"df_100 = SummaryReader(\"/home/isaacp/repos/EvMatsim/contribs/ev/evsim/gradient_flow_matching/utah_flow_results/0423155704_nclusters_100_utahnetwork/logs\").scalars\n",
27-
"df_200 = SummaryReader(\"/home/isaacp/repos/EvMatsim/contribs/ev/evsim/gradient_flow_matching/utah_flow_results/0423161247_nclusters_200_utahnetwork/logs\").scalars\n",
28-
"df_500 = SummaryReader(\"/home/isaacp/repos/EvMatsim/contribs/ev/evsim/gradient_flow_matching/utah_flow_results/0425144015_nclusters_500_utahnetwork/logs\").scalars"
24+
"df_10 = SummaryReader(\"../../cluster_results/results/0428162326_nclusters_10_utahnetwork/logs\").scalars\n",
25+
"df_10 = SummaryReader(\"../../cluster_results/results/0428162326_nclusters_10_utahnetwork/logs\").scalars\n",
26+
"df_10 = SummaryReader(\"../../cluster_results/results/0428162326_nclusters_10_utahnetwork/logs\").scalars\n",
27+
"df_10 = SummaryReader(\"../../cluster_results/results/0428162326_nclusters_10_utahnetwork/logs\").scalars\n",
28+
"df_10 = SummaryReader(\"../../cluster_results/results/0428162326_nclusters_10_utahnetwork/logs\").scalars"
2929
]
3030
},
3131
{

matsimAI/run_gradient_flow_matching.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def main(args):
3030
for sensor_idx in dataset.sensor_idxs:
3131
f.write(f"{dataset.edge_mapping.inv[sensor_idx]},")
3232

33+
sensor_idxs = dataset.sensor_idxs
34+
3335
with open(Path(save_path, "args.txt"), "w") as f:
3436
for key, val in args.__dict__.items():
3537
f.write(f"{key}:{val}\n")
@@ -47,7 +49,6 @@ def main(args):
4749

4850
optimizer = torch.optim.Adam(parameters, lr=0.001)
4951
pbar = tqdm(range(args.training_steps))
50-
sensor_idxs = dataset.sensor_idxs
5152
target_size = TARGET[sensor_idxs].numel()
5253

5354
best_loss = torch.inf

matsimAI/scripts/analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def plot_tensor_flows(dataset, predicted_flows, target_flows, link_idx, title, s
3737

3838
plt.figure(figsize=(12, 6))
3939
plt.bar(hours, pred_link_flows, width=bar_width, color="blue", label="Predicted flows")
40-
plt.bar(hours + bar_width, target_link_flows, width=bar_width, color="red", label="Target flows")
40+
plt.bar(hours + bar_width, target_link_flows, width=bar_width, color="red", label="Count Volumes")
4141
plt.xlabel("Hour")
4242
plt.ylabel("Flows")
4343
plt.title(title + "\nLink Id: " + str(link_id))

scripts/run_optimizer_and_matsim.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,16 @@ cd ..
4949
# "--save_interval" "-1" \
5050
# "--best_plans_save_path" "./scenarios/cluster_scenarios/utah_200c"
5151

52-
mvn exec:java -Dexec.mainClass="org.matsim.run.RunMatsim" -Dexec.args="./scenarios/cluster_scenarios/utah_200c/utahconfig.xml"
52+
# mvn exec:java -Dexec.mainClass="org.matsim.run.RunMatsim" -Dexec.args="./scenarios/cluster_scenarios/utah_200c/utahconfig.xml"
53+
54+
python3 -m matsimAI.run_gradient_flow_matching \
55+
"./cluster_results/results" \
56+
"./scenarios/cluster_scenarios/utah_500c/utahnetwork.xml" \
57+
"./scenarios/cluster_scenarios/utah_500c/utahcounts.xml" \
58+
"--num_clusters" "500" \
59+
"--training_steps" "1_000_000" \
60+
"--log_interval" "1_000" \
61+
"--save_interval" "-1" \
62+
"--best_plans_save_path" "./scenarios/cluster_scenarios/utah_500c"
63+
64+
mvn exec:java -Dexec.mainClass="org.matsim.run.RunMatsim" -Dexec.args="./scenarios/cluster_scenarios/utah_500c/utahconfig.xml"

0 commit comments

Comments
 (0)