|
dbelan2(à)cs.mcgill.ca |
hchen19(à)cs.mcgill.ca |
File: intersection.net

(internal - revision 1.19)
We used a single car generator (located bottom left corner) that can generate an infinite number of cars. Car generated has then the choice of which direction to come from (N, S, E, W). Note that in our model the destination of a car is not chosen at generation time.
Each direction has a place for cars to wait before engaging themselves into the intersection. These waiting places before the intersection are labelled North, South, East and West respectively. The number of tokens in theses places represent the number of cars waiting.
Also, each road segment has an exit place. A single place could have been used but we prefered to use one for each road segment as it is closer to the reality and allows us to know the number of cars that exited each road segment.
Four places modelling each quadrant (NW, NE, SW, SE) are used. Each token in a quadrant represents a car. (Note: There will never be more than one).
Our model obeys these 2 rules:
Movement in intersection
The trajectory taken by the car is knowned by the places the token travel through. To animate it, we would make the small car move smoothly (make the movement look continuous up to some point) from one quadrant to the other by computing intermediate position between the discrete events. The geographical position of the places in the Petri Net model correspond to a real life intersection. In an animated model, cars will be displays more or less where the places are.
Queuing
As opposed to the Petri Net where all cars (tokens) pile up in the same place to wait, an animation of the model would require drawing the cars in a line up.
Car Generation
Cars will appear as coming from outside the screens.
We could have given priorities to some transitions to reduce the accumulation of cars in the queue places. Passing throught the intersection requires more steps (transitions firing) due to the "clean-up procedure" than generating cars. With equal priorities, cars will be produced faster than consumed by the interstion.