Skip to content

Commit

Permalink
data processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mbkorecki committed Jan 25, 2023
1 parent 251265e commit ee50ea5
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
Binary file modified figs/11_11.pdf
Binary file not shown.
Binary file modified figs/11_6.pdf
Binary file not shown.
Binary file modified figs/22_11.pdf
Binary file not shown.
Binary file modified figs/22_22.pdf
Binary file not shown.
Binary file modified figs/32_16.pdf
Binary file not shown.
Binary file modified figs/32_32.pdf
Binary file not shown.
16 changes: 8 additions & 8 deletions intersection_switching/data_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@
# print("wait: ", avg_wait, var_wait)
# print("stops: ", avg_stops, var_stops)

if vote == [0.0, 0.5, 0.5]:
print(vote, traffic[0], traffic[1])
print("wait: ", np.mean(avg_total_waits), np.std(avg_total_waits))
print("stops: ", np.mean(avg_total_stops), np.std(avg_total_stops))
print("speeds: ", np.mean(avg_total_speeds), np.std(avg_total_speeds))

plt.scatter(avg_total_waits, avg_total_stops)
plt.show()
# if vote == [0.0, 0.5, 0.5]:
# print(vote, traffic[0], traffic[1])
# print("wait: ", np.mean(avg_total_waits), np.std(avg_total_waits))
# print("stops: ", np.mean(avg_total_stops), np.std(avg_total_stops))
# print("speeds: ", np.mean(avg_total_speeds), np.std(avg_total_speeds))

# plt.scatter(avg_total_waits, avg_total_stops)
# plt.show()


result = [np.mean(avg_total_speeds), np.mean(avg_total_stops), np.mean(avg_total_waits)]
Expand Down
2 changes: 1 addition & 1 deletion intersection_switching/run_vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
for vote in vote_types:
for traffic in traffic_conditions:
for i in range(100):
os.system("python runner.py --sim_config '../scenarios/loop_intersection/rings.config' --num_sim_steps 3600 --eps_start 0 --eps_end 0 --lr 0.0005 --mode vote --agents_type learning --num_episodes 1 --replay False --mfd False --n_vehs " + str(traffic[0]) + " " + str(traffic[1]) + " --vote_weights " + str(vote[0]) + " " + str(vote[1]) + " " + str(vote[2]) + " --vote_type majority --path '../runs/proportional_100/'")
os.system("python runner.py --sim_config '../scenarios/loop_intersection/rings.config' --num_sim_steps 3600 --eps_start 0 --eps_end 0 --lr 0.0005 --mode vote --agents_type learning --num_episodes 1 --replay False --mfd False --n_vehs " + str(traffic[0]) + " " + str(traffic[1]) + " --vote_weights " + str(vote[0]) + " " + str(vote[1]) + " " + str(vote[2]) + " --vote_type proportional --path '../runs/proportional_100/'")


# os.system("sbatch -n 8 --wrap \"python runner.py --sim_config '../scenarios/loop_intersection/rings.config' --num_sim_steps 3600 --eps_start 0 --lr 0.0005 --mode vote --agents_type learning --num_episodes 1 --replay True --mfd False " + " --n_vehs " + str(traffic[0]) + " " + str(traffic[1]) + " --vote_weights " + vote_weights[0] + " " + vote_weights[1] + " " + vote_weights[2] + " " + "\"" )

0 comments on commit ee50ea5

Please sign in to comment.