Add Simulator, Estimated End Time, Vehicle Unassignments, and Stop Skipping - #7
Open
pamun1 wants to merge 26 commits into
Open
Add Simulator, Estimated End Time, Vehicle Unassignments, and Stop Skipping#7pamun1 wants to merge 26 commits into
pamun1 wants to merge 26 commits into
Conversation
The configuration parameters associated with the simulation (i.e., time_step, speed, update_position_time_step and max_time) can now be accessed and modified from the Environment object through the attribute simulation_config that stores a SimulationConfig object.
The attribute estimated_end_time, that corresponds to an estimate of the end time of the simulation, was added to the class Environment.
With the new object Simulator, it is possible to create a simulation from the path to the directory containing the input files. Moreover, the methods pause(), resume() and stop() were added to Simulator and Simulation to let the user pause, resume and stop a simulation, respectively..
The visualizer has now access to the simulation and the environment through the "protected" attributes _simulation and _env respectively.
-The class ShuttleGreedyDispatcher was created. The class Simulator was modified to construct a simulation based on the ShuttleGreedyDispatcher. -The class CoordinatesFromPolylineFile, that generates coordinates based on a polyline file was created. -The submodule "coordinates" was created. All the Coordinates suclasses are now located in this module.
The attributes lon and lat were added to Location since all Location subclasses are expected to have these attributes.
These events are not needed anymore. The methods Simulation.pause() and Simulation.resume() should be used instead.
It was not possible to stop the simulation while on pause. It is now possible.
The directory appeared twice in the graph file path used by SimulationInitializerShuttle.
If the graph (network) file of a fixed line simulation is not available, it can now be generated by SimulationInitializerFixedLine.
If a vehicle was already at the origin stop of the next trip, a new stop with the same location was appended. This problem was corrected. A new stop is appended only if the trip origin is different from the current stop location of the vehicle.
The method DataCollector.clean_up, that is called at the end of a simulation, was added. It can be used to perform some clean up operations of the DataCollector before finishing a simulation.
The DataCollector objects now have a direct access to the simulation and the environment (as was the case for the Visualizer objects).
The attributes "lon" and "lat" were missing from the nodes of the graph network of shuttles. Instead of reading the network directly from the graph file, the method ShuttleDataReader.get_json_graph() is now used. Among other things, this method converts the "pos" attribute of each node into "lon" and "lat".
The attribute name was added to the class Vehicle. The attribute capacity was added to the class Stop.
The method get_statistics of FixedLineDataAnalyzer now returns general information (not associated with the mode) about the vehicles and the trips.
The attribute tags was added to Request, Vehicle and Stop.
- During a connection, in PassengerAlighting, an Optimize event is not created if the next leg has already been assigned to a vehicle.
- Optimize events are now created directly in ActionEvent.process. The creation of an Optimize event is triggered according to the new status of an entity. A list of optimize triggering statuses can be passed to the Simulation as an argument. - Unassignment has been moved from PassengerRelease to PassengerUnassignment. - The example FixedLineUnassignDispatcher has been added.
- The Environment now tracks complete and non-complete trips and vehicles. - A parameter has been added to determine whether the Route history (i.e., previous_stops and alighted_legs) is included or not in the deep copy of the State (passed to the Dispatcher). If the deep copy of the State is disabled, the Route history is always included.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces several new features and improvements to the simulation system:
Major changes:
estimated_end_timeto theEnvironmentclass to provide an estimation of the simulation duration to the visualizer.Simulatorclass for controlling the simulation (simulate, pause, resume, stop).FixedLineUnassignDispatcher,FixedLineReassignDispatcherandFixedLineSkipStopDispatcher.