-
Notifications
You must be signed in to change notification settings - Fork 0
Database read write for scenario components
Scenario consists of the following components:
- Network(s) containing node and link lists;
- Vehicle Type Set - describes vehicle types modeled in the scenario;
- Initial Density Set - describes initial conditions for a simulation;
- Sensor Set - describes detectors of various kinds assigned to a road network;
- Signal Set - describes signal configurations for nodes representing signalized intersections;
- Controller Set - describes the set of controllers that operate on links, nodes, sensors, other controllers;
- Fundamental Diagram Set - set of quadruplet (free flow speed, critical speed, capacity, jam density) time series referring to links;
- Demand Set - set of demand flow time series referring to origin links;
- Downstream Boundary Capacity Set - set of time series describing constraints for outgoing flows in destination links;
- Split Ratio Set - set of time series describing proportions of traffic flow division between outgoing links, assigned to multi-output nodes;
- Weaving Factor Set - describes the weaving effect due to upstream merge or downstream diverge;
- Event Set - describes the set of events.
It is logical to have 7 separate editing modes for the scenario. Or, if it is an easier solution, break up Scenario Editor into 7 application with the following functions:
- Network Editor - provides editing capabilities for scenario component 1. All other sets, except Vehicle Type Set, depend on/ refer to the network. Thus, when editing all the other sets, the network loaded into the Scenario Editor must be in sync with its database copy.
- Vehicle Type Set Editor - very simple editor (e.g. multiple selection box) that does not require network or any other info to be displayed.
- Initial Density Set Editor - low priority, since initial densities should generally be automatically generated.
- Sensor Set Editor - creation/deletion of sensors, snapping of sensors to links specifying link offset, unsnapping the sensors in order to be able to re-assign to different links; editing sensor parameters; displaying sensor health status.
- Signal Editor - creation/deletion of signal configurations; editing of signal phases and other signal parameters.
- Controller Editor - creation/deletion of controllers; assigning feedback and target scenario elements; editing control parameters.
- Data Explorer/Editor for scenario components 7-12 - these components describe the environment, something the traffic operator has no control of. Sets 7-12 have no cross-referencing, so that saving/syncing one with the database does not affect the others.
Each of the 7 listed editors/modes saves (syncs with the database) independently of the others: that is, when I am editing demand or events, I am assuming network, vehicle types, sensors, signals, controllers, initial densities fixed.
Another, special editor/mode can be called Scenario Manager: it builds/edits scenarios using whole ready blocks - networks and sets - without going deeper than that.
Saving the network happens 3 ways:
- New network is inserted. New network record is created with new network ID generated by the database. Then, new node and link records are generated with newly generated IDs, to be referred to by {network ID, node ID} or {network ID, link ID}.
- Existing network is updated. Existing network record is updated. Then, all nodes and links for this network ID are deleted, and after that, nodes and links with existing IDs are inserted. New nodes and links get IDs, newly generated by the database.
- Existing network is copied. New network record is created, which is a copy of the existing one but with new ID. Nodes and links from existing network are duplicated with the new network ID.
Saving the network is to be implemented using Network, Node and Link model objects and the corresponding database access writers and readers. The insert/update process initiated in the UI happens in 2 steps:
- Insert/update the network in the database;
- Read the inserted/updated network from the database into the UI.
In the case of network copy, re-reading of the whole network is not necessary: if successful, nodes and links retain their IDs. The only part that needs to be retrieved is the new network ID.
...