|
|
@@ -31,9 +31,9 @@ strategies = {
|
|
|
# The number of locks and their capacities
|
|
|
lock_capacities=[3,2] # two locks, of capacity 3 and 2
|
|
|
|
|
|
-# The different parameters to try for lock_max_wait
|
|
|
-lock_max_waits = [ 0.0+i*120.0 for i in range(5) ] # all these values will be attempted
|
|
|
-# lock_max_waits = [ 15.0 ] # <-- uncomment if you only want to run an experiment with this value (useful for debugging)
|
|
|
+# The different parameters to try for max_wait_duration
|
|
|
+max_wait_durations = [ 0.0+i*120.0 for i in range(5) ] # all these values will be attempted
|
|
|
+# max_wait_durations = [ 15.0 ] # <-- uncomment if you only want to run an experiment with this value (useful for debugging)
|
|
|
|
|
|
# How long does it take for a ship to pass through a lock
|
|
|
passthrough_duration = 60.0*15 # 15 minutes
|
|
|
@@ -49,9 +49,9 @@ os.makedirs(outdir, exist_ok=True)
|
|
|
for priority in priorities:
|
|
|
for strategy in strategies:
|
|
|
values = []
|
|
|
- # and in each experiment, try a bunch of different values for the 'lock_max_wait' parameter:
|
|
|
- for lock_max_wait in lock_max_waits:
|
|
|
- print("Run simulation:", priorities[priority], strategies[strategy], "max_wait =",lock_max_wait)
|
|
|
+ # and in each experiment, try a bunch of different values for the 'max_wait_duration' parameter:
|
|
|
+ for max_wait_duration in max_wait_durations:
|
|
|
+ print("Run simulation:", priorities[priority], strategies[strategy], "max_wait =",max_wait_duration)
|
|
|
sys = LockQueueingSystem(
|
|
|
# See system.py for explanation of these values:
|
|
|
seed=0,
|
|
|
@@ -61,7 +61,7 @@ for priority in priorities:
|
|
|
load_balancer_strategy=strategy,
|
|
|
lock_capacities=lock_capacities,
|
|
|
priority=priority,
|
|
|
- lock_max_wait=lock_max_wait,
|
|
|
+ max_wait_duration=max_wait_duration,
|
|
|
passthrough_duration=passthrough_duration,
|
|
|
)
|
|
|
sim = Simulator(sys)
|
|
|
@@ -73,7 +73,7 @@ for priority in priorities:
|
|
|
ships = sys.sink.state.ships
|
|
|
values.append([ship.queueing_duration for ship in ships])
|
|
|
|
|
|
- # Write out all the ship queueuing durations for every 'lock_max_wait' parameter
|
|
|
+ # Write out all the ship queueuing durations for every 'max_wait_duration' parameter
|
|
|
# for every ship, we write a line:
|
|
|
# <ship_num>, time_max_wait0, time_max_wait1, time_max_wait2, ... time_max_wait10
|
|
|
filename = f'{outdir}/output_{strategies[strategy]}_{priorities[priority]}.csv'
|
|
|
@@ -91,13 +91,13 @@ for priority in priorities:
|
|
|
plots_ships.append(make_plot_ships_script(
|
|
|
priority=priorities[priority],
|
|
|
strategy=strategies[strategy],
|
|
|
- max_waits=lock_max_waits,
|
|
|
+ max_waits=max_wait_durations,
|
|
|
gen_num=gen_num,
|
|
|
))
|
|
|
plots_box.append(make_plot_box_script(
|
|
|
priority=priorities[priority],
|
|
|
strategy=strategies[strategy],
|
|
|
- max_waits=lock_max_waits,
|
|
|
+ max_waits=max_wait_durations,
|
|
|
gen_num=gen_num,
|
|
|
))
|
|
|
|