165 std::vector<SUMOTime> stateDumpTimes, std::vector<std::string> stateDumpFiles,
197 const std::map<SUMOVehicleClass, double>*
getRestrictions(
const std::string&
id)
const;
std::string myStateDumpSuffix
The vehicle has departed (was inserted into the network)
SumoXMLTag
Numbers representing SUMO-XML - element names.
Representation of a vehicle in the micro simulation.
Interface for objects listening to vehicle state changes.
bool hasPersons() const
Returns whether persons are simulated.
void removeVehicleStateListener(VehicleStateListener *listener)
Removes a vehicle states listener.
MSEventControl * myEndOfTimestepEvents
Controls events executed at the end of a time step;.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
std::string getStoppingPlaceID(const MSLane *lane, const double pos, const SumoXMLTag category) const
Returns the stop of the given category close to the given position.
A lane area vehicles can halt at.
bool hasPermissions() const
Returns whether the network has specific vehicle class permissions.
const NamedRTree & getLanesRTree() const
Returns an RTree that contains lane IDs.
std::pair< double, double > getVehicleMeanSpeeds() const
get current absolute and relative mean vehicle speed in the network
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
std::vector< MSEdge * > MSEdgeVector
double getVehicleMeanSpeed() const
std::vector< SUMOTime > myStateDumpTimes
Times at which a state shall be written.
The base class for an intersection.
SimulationState simulate(SUMOTime start, SUMOTime stop)
Simulates from timestep start to stop.
SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouterEffort
bool logSimulationDuration() const
Returns whether duration shall be logged.
virtual void vehicleStateChanged(const SUMOVehicle *const vehicle, VehicleState to)=0
Called if a vehicle changes its state.
std::map< SumoXMLTag, NamedObjectCont< MSStoppingPlace * > > myStoppingPlaces
Dictionary of bus / container stops.
A RT-tree for efficient storing of SUMO's Named objects.
MSIntermodalRouter * myIntermodalRouter
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSPedestrianRouterDijkstra & getPedestrianRouter(const MSEdgeVector &prohibited=MSEdgeVector()) const
bool myHavePermissions
Whether the network contains edges which not all vehicles may pass.
MSEdgeControl * myEdges
Controls edges, performs vehicle movement;.
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
The final simulation step has been performed.
MSIntermodalRouter & getIntermodalRouter(const MSEdgeVector &prohibited=MSEdgeVector()) const
double myVersion
the network version
std::vector< std::string > myStateDumpFiles
The names for the state files.
bool myLogExecutionTime
Information whether the simulation duration shall be logged.
Storage for geometrical objects.
static const std::string STAGE_LANECHANGE
Detectors container; responsible for string and output generation.
bool myLefthand
Whether the network was built for left-hand traffic.
A storage for edge travel times and efforts.
void addVehicleStateListener(VehicleStateListener *listener)
Adds a vehicle states listener.
SimulationState
Possible states of a simulation - running or stopped with different reasons.
bool addStoppingPlace(const SumoXMLTag category, MSStoppingPlace *stop)
Adds a stopping place.
MSPedestrianRouterDijkstra * myPedestrianRouter
The simulated network and simulation perfomer.
ShapeContainer * myShapeContainer
A container for geometrical shapes;.
std::pair< bool, NamedRTree > myLanesRTree
An RTree structure holding lane IDs.
Container for junctions; performs operations on all stored junctions.
virtual MSTransportableControl & getContainerControl()
Returns the container control.
The vehicles starts to stop.
void writeChargingStationOutput() const
write charging station output
A class that stores and controls tls and switching of their programs.
A road/street connecting two junctions.
double version() const
return the network version
long long int myVehiclesMoved
The overall number of vehicle movements.
The simulation does not contain further vehicles.
int getHaltingVehicleNumber() const
count number of standing vehicles in the network
An error occured during the simulation step.
void writeOutput()
Write netstate, summary and detector output.
The vehicle got a new route.
The vehicle arrived at his destination (is deleted)
The vehicles starts to park.
SimulationState simulationState(SUMOTime stopTime) const
Called after a simulation step, this method returns the current simulation state. ...
MSInsertionControl * myInserter
Controls vehicle insertion;.
Representation of a vehicle.
SUMORouteLoaderControl * myRouteLoaders
Route loader for dynamic loading of routes.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
ShapeContainer & getShapeContainer()
Returns the shapes container.
void closeSimulation(SUMOTime start)
Closes the simulation (all files, connections, etc.)
std::map< std::string, std::map< SUMOVehicleClass, double > > myRestrictions
The vehicle class specific speed restrictions.
bool myLogStepNumber
Information whether the number of the simulation step shall be logged.
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
MSDetectorControl * myDetectorControl
Controls detectors;.
void setPermissionsFound()
Labels the network to contain vehicle class permissions.
void postSimStepOutput() const
Prints the statistics of the step at its end.
bool hasContainers() const
Returns whether containers are simulated.
Stores edges and lanes, performs moving of vehicle.
const std::map< SUMOVehicleClass, double > * getRestrictions(const std::string &id) const
Returns the restrictions for an edge type If no restrictions are present, 0 is returned.
MSTLLogicControl * myLogics
Controls tls logics, realizes waiting on tls rules;.
The connection to a client was closed by the client.
The simulation is running.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
MSNet & operator=(const MSNet &)
Invalidated assignment operator.
The vehicle started to teleport.
bool hasInternalLinks() const
return whether the network contains internal links
PedestrianRouterDijkstra< MSEdge, MSLane, MSJunction, MSVehicle > MSPedestrianRouterDijkstra
The vehicle ends to park.
MSDetectorControl & getDetectorControl()
Returns the detector control.
bool hasElevation() const
return whether the network contains elevation data
bool lefthand() const
return whether the network was built for lefthand traffic
SUMOTime myStateDumpPeriod
The period for writing state.
Inserts vehicles into the network when their departure time is reached.
long myTraCIStepDuration
The last simulation step duration.
int myMaxTeleports
Maximum number of teleports.
VehicleState
Definition of a vehicle state.
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a time step.
void closeBuilding(const OptionsCont &oc, MSEdgeControl *edges, MSJunctionControl *junctions, SUMORouteLoaderControl *routeLoaders, MSTLLogicControl *tlc, std::vector< SUMOTime > stateDumpTimes, std::vector< std::string > stateDumpFiles, bool hasInternalLinks, bool hasNeighs, bool lefthand, double version)
Closes the network's building process.
static const std::string STAGE_MOVEMENTS
VehicleStateListener()
Constructor.
The vehicle was built, but has not yet departed.
std::vector< VehicleStateListener * > myVehicleStateListeners
Container for vehicle state listener.
static MSNet * myInstance
Unique instance of MSNet.
static void clearAll()
Clears all dictionaries.
The simulation is loading.
MSTransportableControl * myContainerControl
Controls container building and deletion;.
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
MSTransportableControl * myPersonControl
Controls person building and deletion;.
bool checkElevation()
check all lanes for elevation data
void preSimStepOutput() const
Prints the current step number.
MSEventControl * myBeginOfTimestepEvents
Controls events executed at the begin of a time step;.
A storage for options typed value containers)
virtual ~VehicleStateListener()
Destructor.
MSEdgeWeightsStorage * myEdgeWeights
The net's knowledge about edge efforts/travel times;.
The simulation had too many teleports.
MSNet(MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents, ShapeContainer *shapeCont=0)
Constructor.
The vehicle ends to stop.
MSEventControl * getInsertionEvents()
Returns the event control for insertion events.
void informVehicleStateListener(const SUMOVehicle *const vehicle, VehicleState to)
Informs all added listeners about a vehicle's state change.
long mySimBeginMillis
The overall simulation duration.
virtual ~MSNet()
Destructor.
bool myHasElevation
Whether the network contains elevation data.
std::string myStateDumpPrefix
name components for periodic state
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
MSEdgeControl & getEdgeControl()
Returns the edge control.
IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle > MSIntermodalRouter
MSJunctionControl & getJunctionControl()
Returns the junctions control.
double getVehicleMeanSpeedRelative() const
SUMOTime myStep
Current time step.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const MSEdgeVector &prohibited=MSEdgeVector()) const
The class responsible for building and deletion of vehicles.
std::vector< MSEdge * > MSEdgeVector
void simulationStep()
Performs a single simulation step.
void loadRoutes()
loads routes for the next few steps
static const std::string STAGE_INSERTIONS
MSEventControl * myInsertionEvents
Controls insertion events;.
Representation of a lane in the micro simulation.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterEffort(const MSEdgeVector &prohibited=MSEdgeVector()) const
Stores time-dependant events and executes them at the proper time.
The vehicle ended being teleported.
bool myHasInternalLinks
Whether the network contains internal links/lanes/edges.
SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouterTT
static void adaptIntermodalRouter(MSIntermodalRouter &router)
static double getEffort(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the effort to pass an edge.
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
static const std::string STAGE_EVENTS
string constants for simstep stages