A general framework and simulation for ultra-dynamic traffic assignment
To use MiniVnet, you need to import
from miniVnet import MINIVNET
compile()
-
Add an intersection
name
is the ID of the intersection.num_lane
is the number of lanes in each direction.addIntersection(name, num_lane)
-
Add an sink
name
is the ID of the sink (source and destination).num_lane
is the number of lanes in the sink.addSink(name, num_lane)
-
Connect two components
component_1
,component_2
are the two components.idx_1
is the index ofcomponent_1
, which is desired to connect toidx_2
ofcomponent_2
. Components can be either sinks or intersections. For sinks, the index should be 0. For intersections, the index can be {0..3}.connect(component_1, idx_1, component_2, idx_2)
-
Create grid network
Create grid network with givenN
and the number of lanenum_lane
. (compiled automatically)createGridNetwork(N, num_lane)