71 template<
class E,
class L,
class N,
class V>
73 template<
class E,
class L,
class N,
class V>
169 std::vector<SUMOTime> stateDumpTimes, std::vector<std::string> stateDumpFiles,
201 const std::map<SUMOVehicleClass, double>*
getRestrictions(
const std::string&
id)
const;
625 bool warnOnce(
const std::string& typeAndID);
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 informVehicleStateListener(const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")
Informs all added listeners about a vehicle's state change.
void removeVehicleStateListener(VehicleStateListener *listener)
Removes a vehicle states listener.
MSPedestrianRouter * myPedestrianRouter
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.
bool warnOnce(const std::string &typeAndID)
return whether a warning regarding the given object shall be issued
const NamedRTree & getLanesRTree() const
Returns an RTree that contains lane IDs.
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
std::vector< SUMOTime > myStateDumpTimes
Times at which a state shall be written.
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.
MSIntermodalRouter & getIntermodalRouter(const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
std::map< SumoXMLTag, NamedObjectCont< MSStoppingPlace * > > myStoppingPlaces
Dictionary of bus / container stops.
A RT-tree for efficient storing of SUMO's Named objects.
virtual void createTLWrapper(MSTrafficLightLogic *)
creates a wrapper for the given logic (see GUINet)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
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.
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.
std::map< int, MSIntermodalRouter * > myIntermodalRouter
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.
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.
long long int myVehiclesMoved
The overall number of vehicle movements.
The simulation does not contain further vehicles.
An error occurred during the simulation step.
bool myAmInterrupted
whether an interrupt occured
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.
The vehicle is involved in a collision.
SimulationState simulationState(SUMOTime stopTime) const
Called after a simulation step, this method returns the current simulation state. ...
static bool hasInstance()
Returns whether the network was already constructed.
MSInsertionControl * myInserter
Controls vehicle insertion;.
Representation of a vehicle.
The vehicle had to brake harder than permitted.
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.
bool isInterrupted() const
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.
std::map< std::string, bool > myWarnedOnce
container to record warnings that shall only be issued once
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
virtual void vehicleStateChanged(const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")=0
Called if a vehicle changes its state.
MSNet & operator=(const MSNet &)
Invalidated assignment operator.
The vehicle started to teleport.
bool hasInternalLinks() const
return whether the network contains internal links
The vehicle ends to park.
MSDetectorControl & getDetectorControl()
Returns the detector control.
bool hasElevation() const
return whether the network contains elevation data
MSPedestrianRouter & getPedestrianRouter(const MSEdgeVector &prohibited=MSEdgeVector()) const
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.
PedestrianRouter< MSEdge, MSLane, MSJunction, MSVehicle > MSPedestrianRouter
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
An external interrupt occured.
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.
long mySimBeginMillis
The overall simulation duration.
virtual ~MSNet()
Destructor.
bool myHasElevation
Whether the network contains elevation data.
The parent class for traffic light logics.
std::string myStateDumpPrefix
name components for periodic state
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
double getNetworkVersion() const
return the network version
MSEdgeControl & getEdgeControl()
Returns the edge control.
IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle > MSIntermodalRouter
MSJunctionControl & getJunctionControl()
Returns the junctions control.
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)
const std::string generateStatistics(SUMOTime start)
Writes performance output and running vehicle stats.
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