Skip to content

Add external vehicle load from matrices in a performant way #139

Answered by EwoutH
EwoutH asked this question in Q&A
Discussion options

You must be logged in to vote

I decided to skip adddemand_nodes2nodes and adddemand both, and just directly use addVehicle.

diff --git a/model/model.py b/model/model.py
index c223782..26fc7ab 100644
--- a/model/model.py
+++ b/model/model.py
@@ -119,14 +119,16 @@ def __init__(self, n_agents=simulated_population, step_time=1/12, start_time=6,
         # External vehicle load
         # Get a list of origin and destination areas for the external trips
         def add_external_vehicle_load():
             self.mrdh65s_ext = data.od_ext_into_city.index.to_list()
 
             # Convert to NumPy, int16
-            self.od_ext_into_city = data.od_ext_into_city * self.ext_vehicle_load
-            self.od_ext_out_city = da…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by toruseo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants