Object Relationships
The content on this page comes from the brainstorming session taken on Tuesday after the meeting with the other team.
Simulation
| Variables | Type | Description |
| Events | Priority Queue | List of events in chronological order. |
| Vehicles | Array List | List of vehicles in the simulation |
| MapRoot | Intersection | The top left node in the simulation map |
| PendingAccidents | Priority Queue | Queue for accidents that have yet to be assigned. |
| CityDrawer | GUI | Object that handles window/GUI events |
| DialogMaker | DialogCreator | Generic object used to create user-interactive dialog frames. |
Intersection - Represents an intersection of roads.
| Variables | Type | Description |
| North | Road | Road linked to this node from the north. |
| South | Road | Road linked to this node from the south. |
| East | Road | Road linked to this node from the east. |
| West | Road | Road linked to this node from the west. |
| Accident |
Accident | Reference to the accident that is currently taking place at this intersection. NULL if everything's okay. |
| Location | Coordinates | x,y notation of where intersection is on map. |
Coordinates: X, Y integers for use with relating locations on a grid.
Road
| Variables | Type |
Description |
| Point1 | Intersection | First Intersection the Road is connected to |
| Point2 | Intersection | Second Intersection the Road is connected to |
Vehicle
| Variables | Type | Description |
| Direction | String ("N","S","E","W") |
Character indicating which direction the vehicle is currently facing and attempting to move in. |
| Location | Object reference to an intersection or road | Current location of the emergency vehicle. |
| Accident | Accident | Represents the current accident that the vehicle is move to resolve. |
| Stats | VehStats | Contains measured vehicle statistics |
| Target | Intersection | The location to which the vehicle must go in order to resolve an accident. |
Vehicle Stats-
| Variables | Type | Description |
Accident
| Variables | Type | Description |
| Severity | Int | Represents the priority of the accident and time required for a vehicle to to resolve the accident once on the scene. |
| Location | Intersection | The location at which the accident has taken place. |
Temporal Events (Priority Queue):
All types of events have a priority, as they must be compatible with the Priority Queue we created. The two types of events currently needed are Accident events and Movement events, whose priority is a representation of how soon the given event will take place.
Pending Accident event - An accident that needs to be handled, does not require any particular extra variables at this time. When this event is triggered, create an Accident and assign it to the emergency vehicle nearest the location. If none are available, add it to the priority queue of accidents that need to be handled.
Movement event - Represents regular vehicle movement across the grid and attempts to get through intersections.
| Variables | Type | Description |
| Vehicle | Vehicle | The vehicle that will be moved when the event is triggered. |
| Destination | Object reference to an intersection or road | Represents the location to which the vehicle will be in after movement, provided it is successful. |
Show Wiki activity