Skip to content

Commit 2d5bd2e

Browse files
committed
Fixing issues with getting vcg call to vcg case in run_scenario
1 parent 2aa0e0c commit 2d5bd2e

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

ic/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ def C(vertiport, q):
504504
vertiport (str): The vertiport id.
505505
q (int): The number of aircraft in the hold.
506506
"""
507-
assert float(q).is_integer() and q >= 0 and q < len(congestion_params["C"]), "q must be a non-negative integer."
508-
return congestion_params["C"][q]
507+
assert float(q).is_integer() and q >= 0 and q < len(congestion_params["C"][vertiport]), "q must be a non-negative integer."
508+
return congestion_params["C"][vertiport][q]
509509

510510
#add delays for vcg
511511
max_delay = 10
@@ -545,7 +545,7 @@ def C(vertiport, q):
545545

546546
start_time = timing_info["start_time"]
547547
end_time = timing_info["end_time"]
548-
auction_intervals = list(range(start_time, end_time, auction_freq))
548+
# auction_intervals = list(range(start_time, end_time, auction_freq))
549549

550550
max_travel_time = 6
551551
last_auction = end_time - max_travel_time - auction_freq
@@ -568,7 +568,7 @@ def C(vertiport, q):
568568

569569
max_travel_time = 6
570570
last_auction = end_time - max(max_travel_time,auction_freq)
571-
auction_times = list(np.arange(0, last_auction+1, auction_freq))
571+
auction_times = list(np.arange(start_time, last_auction+1, auction_freq))
572572
print(f"Last auction: {last_auction}")
573573
logger.info(f"Last auction: {last_auction}")
574574

ic/vcg_experiments.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
" \"--file\", file,\n",
2525
" \"--method\", \"vcg\",\n",
2626
" \"--output_bsky\", str(False),\n",
27-
" \"--run_up_to_auction\", str(1000),\n",
27+
" \"--run_up_to_auction\", str(0),\n",
2828
" \"--force_overwrite\",\n",
2929
" \"--save_pkl_files\", \"True\",\n",
3030
" ] \n",

test_cases/case0.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"timing_info": {
3-
"start_time": 0,
4-
"end_time": 30,
3+
"start_time": -20,
4+
"end_time": 40,
55
"time_step": 10,
66
"auction_frequency": 30
77
},
@@ -32,7 +32,9 @@
3232
"request_departure_time": 10,
3333
"request_arrival_time": 20,
3434
"valuation": 100,
35-
"bid": 100
35+
"bid": 100,
36+
"sector_path": [],
37+
"sector_times": []
3638
}
3739
}
3840
},
@@ -52,7 +54,9 @@
5254
"request_departure_time": 10,
5355
"request_arrival_time": 20,
5456
"valuation": 100,
55-
"bid": 100
57+
"bid": 100,
58+
"sector_path": [],
59+
"sector_times": []
5660
}
5761
}
5862
}

0 commit comments

Comments
 (0)