175 throw ProcessError(
"A network was not yet constructed.");
197 myAmInterrupted(false),
200 myHavePermissions(false),
201 myHasInternalLinks(false),
202 myHasElevation(false),
203 myHasPedestrianNetwork(false),
204 myHasBidiEdges(false),
205 myEdgeDataEndTime(-1),
206 myDynamicShapeUpdater(nullptr) {
208 throw ProcessError(
"A network was already constructed.");
246 std::vector<SUMOTime> stateDumpTimes,
247 std::vector<std::string> stateDumpFiles,
248 bool hasInternalLinks,
266 throw ProcessError(
"Opposite direction driving does not work together with the sublane model.");
302 delete router.second;
306 delete router.second;
310 delete router.second;
314 delete router.second;
332 const std::map<SUMOVehicleClass, double>*
334 std::map<std::string, std::map<SUMOVehicleClass, double> >::const_iterator i =
myRestrictions.find(
id);
376 bool doStepLog =
false;
388 std::cout <<
SIMTIME <<
" MSNet::simulate(" << start <<
", " << stop <<
")"
417 std::ostringstream msg;
421 msg <<
"Performance: " <<
"\n" <<
" Duration: " <<
elapsedMs2string(duration) <<
"\n";
423 msg <<
" Real time factor: " << (
STEPS2TIME(
myStep - start) * 1000. / (double)duration) <<
"\n";
424 msg.setf(std::ios::fixed, std::ios::floatfield);
425 msg.setf(std::ios::showpoint);
426 msg <<
" UPS: " << ((double)
myVehiclesMoved / ((
double)duration / 1000)) <<
"\n";
428 msg <<
" UPS-Persons: " << ((double)
myPersonsMoved / ((
double)duration / 1000)) <<
"\n";
434 msg <<
"Vehicles: " <<
"\n"
441 std::vector<std::string> reasons;
460 msg <<
"Persons: " <<
"\n"
542 std::cout <<
SIMTIME <<
": MSNet::simulationStep() called"
543 <<
", myStep = " <<
myStep
553 bool loadRequested = !TraCI::getLoadArgs().empty();
578 std::replace(timeStamp.begin(), timeStamp.end(),
':',
'-');
584 MSRoutingEngine::waitForAll();
633 MSRoutingEngine::waitForAll();
683 if (stopTime >= 0 &&
myStep >= stopTime) {
723 return "The final simulation step has been reached.";
725 return "All vehicles have left the simulation.";
727 return "TraCI requested termination.";
729 return "An error occurred (see log).";
731 return "Interrupted.";
733 return "Too many teleports.";
735 return "TraCI issued load command.";
737 return "Unknown reason.";
783 for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
793 for (
auto& item2 : item.second) {
794 item2.second->clearState();
811 if (oc.
isSet(
"netstate-dump")) {
813 oc.
getInt(
"netstate-dump.precision"));
824 oc.
getInt(
"emission-output.precision"));
830 oc.
getInt(
"battery-output.precision"));
837 if (oc.
getBool(
"elechybrid-output.aggregated")) {
840 oc.
getInt(
"elechybrid-output.precision"));
850 std::string vehID = veh->
getID();
851 std::string filename2 = output +
"_" + vehID +
".xml";
853 std::map<SumoXMLAttr, std::string> attrs;
884 timestep = timestep.substr(0, timestep.length() - 3);
886 std::string filename = output +
"_" + timestep +
".vtp";
916 od.
writeAttr(
"meanWaitingTime", meanWaitingTime);
917 od.
writeAttr(
"meanTravelTime", meanTravelTime);
919 od.
writeAttr(
"meanSpeed", meanSpeed.first);
920 od.
writeAttr(
"meanSpeedRelative", meanSpeed.second);
956 for (
const MSLane*
const lane : edge->getLanes()) {
957 for (
const MSLink*
const link : lane->getLinkCont()) {
958 link->writeApproaching(od, lane->getID());
967 dev->updateAndWriteOutput();
972 if (dev->generatesOutput()) {
1026 std::ostringstream oss;
1027 oss.setf(std::ios::fixed, std::ios::floatfield);
1028 oss.setf(std::ios::showpoint);
1033 << (
TS / durationSec) <<
"*RT, ~"
1036 oss <<
" (0ms ?*RT. ?";
1047 std::cout << oss.str().substr(0, 90 - prev.length());
1076 listener->vehicleStateChanged(vehicle, to, info);
1111 if (&stop->
getLane() == lane && stop->
getBeginLanePosition() - POSITION_EPS <= pos && stop->getEndLanePosition() + POSITION_EPS >= pos) {
1112 return stop->
getID();
1147 if (rs !=
nullptr) {
1179 if ((*it)->getID() == substationId) {
1190 if ((*it)->getID() == substationId) {
1202 if (routingAlgorithm ==
"dijkstra") {
1205 if (routingAlgorithm !=
"astar") {
1206 WRITE_WARNING(
"TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm +
"'. using 'astar' instead.");
1239 const int key = rngIndex * oc.
getInt(
"thread-rngs") + routingMode;
1242 for (
const std::string& opt : oc.
getStringVector(
"persontrip.transfer.car-walk")) {
1243 if (opt ==
"parkingAreas") {
1245 }
else if (opt ==
"ptStops") {
1247 }
else if (opt ==
"allJunctions") {
1252 const std::string& taxiDropoff = oc.
getValueString(
"persontrip.transfer.taxi-walk");
1253 const std::string& taxiPickup = oc.
getValueString(
"persontrip.transfer.walk-taxi");
1254 if (taxiDropoff ==
"") {
1258 }
else if (taxiDropoff ==
"ptStops") {
1260 }
else if (taxiDropoff ==
"allJunctions") {
1263 if (taxiPickup ==
"") {
1267 }
else if (taxiPickup ==
"ptStops") {
1269 }
else if (taxiPickup ==
"allJunctions") {
1290 const MSEdge*
const edge = &i.second->getLane().getEdge();
1296 const MSEdge*
const edge = &i.second->getLane().getEdge();
1299 for (
const auto& a : i.second->getAllAccessPos()) {
1302 if (external !=
nullptr) {
1322 for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
1323 for (std::vector<MSLane*>::const_iterator i = (*e)->getLanes().begin(); i != (*e)->getLanes().end(); ++i) {
1324 if ((*i)->getShape().hasElevation()) {
1347 if (e->getBidiEdge() !=
nullptr) {
std::vector< MSEdge * > MSEdgeVector
#define WRITE_MESSAGE(msg)
#define WRITE_WARNING(msg)
std::string elapsedMs2string(long long int t)
convert ms to string for log output
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_TAXI
vehicle is a taxi
@ SVC_PEDESTRIAN
pedestrian
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ SUMO_ATTR_MAXIMUMBATTERYCAPACITY
Maxium battery capacity.
int gPrecision
the precision for floating point outputs
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Computes the shortest path through a network using the A* algorithm.
Computes the shortest path through a network using the Dijkstra algorithm.
the effort calculator interface
virtual void addStop(const int stopEdge, const Parameterised ¶ms)=0
A scoped lock which only triggers on condition.
int getNumericalID() const
void addCarAccess(const E *edge, SUMOVehicleClass svc, double traveltime)
Adds access edges for transfering from walking to vehicle use.
void addAccess(const std::string &stopId, const E *stopEdge, const double pos, const double length, const SumoXMLTag category, bool isAccess, double taxiWait)
Adds access edges for stopping places to the intermodal network.
_IntermodalEdge * getStopEdge(const std::string &stopId) const
Returns the associated stop edge.
@ TAXI_PICKUP_ANYWHERE
taxi customer may be picked up anywhere
@ TAXI_DROPOFF_ANYWHERE
taxi customer may exit anywhere
@ PARKING_AREAS
parking areas
@ ALL_JUNCTIONS
junctions with edges allowing the additional mode
@ TAXI_PICKUP_PT
taxi customer may be picked up at public transport stop
@ PT_STOPS
public transport stops and access
@ TAXI_DROPOFF_PT
taxi customer may be picked up at public transport stop
EffortCalculator * getExternalEffort() const
Network * getNetwork() const
int getCarWalkTransfer() const
The main mesocopic simulation loop.
void simulate(SUMOTime tMax)
Perform simulation up to the given time.
void clearState()
Remove all vehicles before quick-loading state.
A single mesoscopic segment (cell)
static void write(OutputDevice &of, const SUMOTime timestep)
Writes the complete network state into the given device.
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
static void write(OutputDevice &of, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
static void cleanup()
cleanup remaining data structures
Detectors container; responsible for string and output generation.
void writeOutput(SUMOTime step, bool closing)
Writes the output to be generated within the given time step.
void clearState()
Remove all vehicles before quick-loading state.
void updateDetectors(const SUMOTime step)
Computes detector values.
void close(SUMOTime step)
Closes the detector outputs.
static void cleanup()
removes remaining vehicleInformation in sVehicles
A device which collects info on the vehicle trip (mainly on departure and arrival)
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
A device which collects info on the vehicle trip (mainly on departure and arrival)
static const std::set< MSDevice_SSM *, ComparatorNumericalIdLess > & getInstances()
returns all currently existing SSM devices
static void cleanup()
Clean up remaining devices instances.
static bool hasServableReservations()
check whether there are still (servable) reservations in the system
static SUMOVehicle * getTaxi()
returns a taxi if any exist or nullptr
The ToC Device controls transition of control between automated and manual driving.
static void cleanup()
Closes root tags of output files.
static const std::set< MSDevice_ToC *, ComparatorNumericalIdLess > & getInstances()
returns all currently existing ToC devices
static void writeStatistics(OutputDevice &od)
write statistic output to (xml) file
static std::string printStatistics()
get statistics for printing to stdout
static void generateOutputForUnfinished()
generate output for vehicles which are still in the network
static void generateOutputForUnfinished()
generate vehroute output for vehicles which are still in the network
static void cleanupAll()
perform cleanup for all devices
Stores edges and lanes, performs moving of vehicle.
void patchActiveLanes()
Resets information whether a lane is active for all lanes.
void detectCollisions(SUMOTime timestep, const std::string &stage)
Detect collisions.
const MSEdgeVector & getEdges() const
Returns loaded edges.
void setJunctionApproaches(SUMOTime t)
Register junction approaches for all vehicles after velocities have been planned. This is a prerequis...
void executeMovements(SUMOTime t)
Executes planned vehicle movements with regards to right-of-way.
void planMovements(SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step....
void changeLanes(const SUMOTime t)
Moves (precomputes) critical vehicles.
A road/street connecting two junctions.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
static void clear()
Clears the dictionary.
static int dictSize()
Returns the number of edges.
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
A storage for edge travel times and efforts.
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
static void writeAggregated(OutputDevice &of, SUMOTime timestep, int precision)
static void write(OutputDevice &of, const SUMOVehicle *veh, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
static void write(OutputDevice &of, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
Stores time-dependant events and executes them at the proper time.
virtual void execute(SUMOTime time)
Executes time-dependant commands.
void clearState(SUMOTime currentTime, SUMOTime newTime)
Remove all events before quick-loading state.
static void write(OutputDevice &of, SUMOTime timestep, bool elevation)
Writes the position and the angle of each vehicle into the given device.
static void write(OutputDevice &of, SUMOTime timestep)
Dumping a hugh List of Parameters available in the Simulation.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static double gLateralResolution
static bool gCheck4Accidents
static int gNumThreads
how many threads to use
Inserts vehicles into the network when their departure time is reached.
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
int emitVehicles(SUMOTime time)
Emits vehicles that want to depart at the given time.
void determineCandidates(SUMOTime time)
Checks for all vehicles whether they can be emitted.
int getPendingFlowCount() const
Returns the number of flows that are still active.
void adaptIntermodalRouter(MSNet::MSIntermodalRouter &router) const
void clearState()
Remove all vehicles before quick-loading state.
Container for junctions; performs operations on all stored junctions.
Representation of a lane in the micro simulation.
static void clear()
Clears the dictionary.
Interface for objects listening to vehicle state changes.
The simulated network and simulation perfomer.
std::map< SumoXMLTag, NamedObjectCont< MSStoppingPlace * > > myStoppingPlaces
Dictionary of bus / container stops.
static double getEffort(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the effort to pass an edge.
bool warnOnce(const std::string &typeAndID)
return whether a warning regarding the given object shall be issued
std::map< int, SUMOAbstractRouter< MSEdge, SUMOVehicle > * > myRouterEffort
MSIntermodalRouter & getIntermodalRouter(const int rngIndex, const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
bool myLogExecutionTime
Information whether the simulation duration shall be logged.
MSTransportableControl * myPersonControl
Controls person building and deletion;.
void removeVehicleStateListener(VehicleStateListener *listener)
Removes a vehicle states listener.
SUMORouteLoaderControl * myRouteLoaders
Route loader for dynamic loading of routes.
bool addStoppingPlace(const SumoXMLTag category, MSStoppingPlace *stop)
Adds a stopping place.
SUMOTime myStateDumpPeriod
The period for writing state.
const std::string generateStatistics(SUMOTime start)
Writes performance output and running vehicle stats.
void writeOverheadWireSegmentOutput() const
write the output generated by an overhead wire segment
void writeChargingStationOutput() const
write charging station output
std::pair< bool, NamedRTree > myLanesRTree
An RTree structure holding lane IDs.
bool checkBidiEdges()
check wether bidirectional edges occur in the network
VehicleState
Definition of a vehicle state.
int myLogStepPeriod
Period between successive step-log outputs.
SUMOTime myStep
Current time step.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
bool myHasBidiEdges
Whether the network contains bidirectional rail edges.
MSEventControl * myBeginOfTimestepEvents
Controls events executed at the begin of a time step;.
bool addTractionSubstation(MSTractionSubstation *substation)
Adds a traction substation.
const MesoEdgeType & getMesoType(const std::string &typeID)
Returns edge type specific meso parameters if no type specific parameters have been loaded,...
std::map< std::string, bool > myWarnedOnce
container to record warnings that shall only be issued once
static void initStatic()
Place for static initializations of simulation components (called after successful net build)
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
ShapeContainer * myShapeContainer
A container for geometrical shapes;.
double myVersion
the network version
std::string myStateDumpSuffix
bool checkElevation()
check all lanes for elevation data
bool existTractionSubstation(const std::string &substationId)
return whether given electrical substation exists in the network
bool myLogStepNumber
Information whether the number of the simulation step shall be logged.
MSEventControl * myInsertionEvents
Controls insertion events;.
virtual MSTransportableControl & getContainerControl()
Returns the container control.
SimulationState
Possible states of a simulation - running or stopped with different reasons.
@ SIMSTATE_TOO_MANY_TELEPORTS
The simulation had too many teleports.
@ SIMSTATE_NO_FURTHER_VEHICLES
The simulation does not contain further vehicles.
@ SIMSTATE_LOADING
The simulation is loading.
@ SIMSTATE_ERROR_IN_SIM
An error occurred during the simulation step.
@ SIMSTATE_CONNECTION_CLOSED
The connection to a client was closed by the client.
@ SIMSTATE_INTERRUPTED
An external interrupt occured.
@ SIMSTATE_RUNNING
The simulation is running.
@ SIMSTATE_END_STEP_REACHED
The final simulation step has been performed.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
std::map< int, MSPedestrianRouter * > myPedestrianRouter
static const std::string STAGE_MOVEMENTS
int myMaxTeleports
Maximum number of teleports.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
PedestrianRouter< MSEdge, MSLane, MSJunction, MSVehicle > MSPedestrianRouter
MSEventControl * myEndOfTimestepEvents
Controls events executed at the end of a time step;.
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
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.
bool myHasInternalLinks
Whether the network contains internal links/lanes/edges.
SimulationState adaptToState(const SimulationState state) const
Called after a simulation step, this method adapts the current simulation state if necessary.
void writeSubstationOutput() const
write electrical substation output
static const std::string STAGE_INSERTIONS
long long int myPersonsMoved
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
std::map< std::string, MesoEdgeType > myMesoEdgeTypes
The edge type specific meso parameters.
void addMesoType(const std::string &typeID, const MesoEdgeType &edgeType)
Adds edge type specific meso parameters.
static void clearAll()
Clears all dictionaries.
static void cleanupStatic()
Place for static initializations of simulation components (called after successful net build)
IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle > MSIntermodalRouter
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
MSEdgeControl * myEdges
Controls edges, performs vehicle movement;.
std::unique_ptr< MSDynamicShapeUpdater > myDynamicShapeUpdater
Updater for dynamic shapes that are tracking traffic objects (ensures removal of shape dynamics when ...
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.
void closeSimulation(SUMOTime start, const std::string &reason="")
Closes the simulation (all files, connections, etc.)
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
void simulationStep()
Performs a single simulation step.
bool myHasElevation
Whether the network contains elevation data.
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
MSTransportableControl * myContainerControl
Controls container building and deletion;.
void writeOutput()
Write netstate, summary and detector output.
bool myAmInterrupted
whether an interrupt occured
void addVehicleStateListener(VehicleStateListener *listener)
Adds a vehicle states listener.
void preSimStepOutput() const
Prints the current step number.
MSEdgeControl & getEdgeControl()
Returns the edge control.
std::vector< SUMOTime > myStateDumpTimes
Times at which a state shall be written.
std::vector< MSTractionSubstation * > myTractionSubstations
Dictionary of traction substations.
SUMOTime myEdgeDataEndTime
end of loaded edgeData
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
std::map< std::string, std::map< SUMOVehicleClass, double > > myRestrictions
The vehicle class specific speed restrictions.
std::vector< std::string > myStateDumpFiles
The names for the state files.
void writeRailSignalBlocks() const
write rail signal block output
MSInsertionControl & getInsertionControl()
Returns the insertion control.
MSTLLogicControl * myLogics
Controls tls logics, realizes waiting on tls rules;.
bool logSimulationDuration() const
Returns whether duration shall be logged.
long long int myVehiclesMoved
The overall number of vehicle movements.
void informVehicleStateListener(const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")
Informs all added listeners about a vehicle's state change.
std::vector< VehicleStateListener * > myVehicleStateListeners
Container for vehicle state listener.
SimulationState simulationState(SUMOTime stopTime) const
This method returns the current simulation state. It should not modify status.
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, double version)
Closes the network's building process.
long myTraCIStepDuration
The last simulation step duration.
MSDetectorControl * myDetectorControl
Controls detectors;.
static const std::string STAGE_LANECHANGE
MSNet(MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents, ShapeContainer *shapeCont=0)
Constructor.
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
std::map< int, SUMOAbstractRouter< MSEdge, SUMOVehicle > * > myRouterTT
static void adaptIntermodalRouter(MSIntermodalRouter &router)
MSEdgeWeightsStorage * myEdgeWeights
The net's knowledge about edge efforts/travel times;.
MSDynamicShapeUpdater * makeDynamicShapeUpdater()
Creates and returns a dynamic shapes updater.
std::map< int, MSIntermodalRouter * > myIntermodalRouter
virtual ~MSNet()
Destructor.
MSPedestrianRouter & getPedestrianRouter(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
MSTractionSubstation * findTractionSubstation(const std::string &substationId)
find electrical substation by its id
static MSNet * myInstance
Unique instance of MSNet.
MSInsertionControl * myInserter
Controls vehicle insertion;.
void postSimStepOutput() const
Prints the statistics of the step at its end.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
static const std::string STAGE_EVENTS
string constants for simstep stages
void loadRoutes()
loads routes for the next few steps
std::string myStateDumpPrefix
name components for periodic state
void clearState(const SUMOTime step)
Resets events when quick-loading state.
long mySimBeginMillis
The overall simulation duration.
bool myHasPedestrianNetwork
Whether the network contains pedestrian network elements.
void writeStatistics() const
write statistic output to (xml) file
bool hasInternalLinks() const
return whether the network contains internal links
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterEffort(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
bool checkWalkingarea()
check all lanes for type walkingArea
const NamedObjectCont< MSStoppingPlace * > & getStoppingPlaces(SumoXMLTag category) const
SimulationState simulate(SUMOTime start, SUMOTime stop)
Simulates from timestep start to stop.
Definition of overhead wire segment.
static void write(OutputDevice &of, SUMOTime timestep)
Export the queueing length in front of a junction (very experimental!)
static void cleanup()
clean up state
void writeBlocks(OutputDevice &od) const
write rail signal block output for all links and driveways
static void recheckGreen()
final check for driveway compatibility of signals that switched green in this step
static void dict_clearState()
Decrement all route references before quick-loading state.
static void clear()
Clears the dictionary (delete all known routes, too)
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.
A lane area vehicles can halt at.
double getBeginLanePosition() const
Returns the begin position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
A class that stores and controls tls and switching of their programs.
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
void clearState()
Clear all tls states before quick-loading state.
void check2Switch(SUMOTime step)
Checks whether any WAUT is trying to switch a tls into another program.
int getRunningNumber() const
Returns the number of build and inserted, but not yet deleted transportables.
int getDepartedNumber() const
bool hasTransportables() const
checks whether any transportable waits to finish her plan
int getWaitingForVehicleNumber() const
Returns the number of transportables waiting for a ride.
int getEndedNumber() const
Returns the number of transportables that exited the simulation.
void checkWaiting(MSNet *net, const SUMOTime time)
checks whether any transportables waiting time is over
int getArrivedNumber() const
Returns the number of transportables that arrived at their destination.
int getLoadedNumber() const
Returns the number of build transportables.
int getWaitingUntilNumber() const
Returns the number of transportables waiting for a specified amount of time.
void abortAnyWaitingForVehicle()
aborts the plan for any transportable that is still waiting for a ride
bool hasNonWaiting() const
checks whether any transportable is still engaged in walking / stopping
int getMovingNumber() const
Returns the number of transportables moving by themselvs (i.e. walking)
int getJammedNumber() const
Returns the number of times a transportables was jammed.
int getRidingNumber() const
Returns the number of transportables riding a vehicle.
static void cleanup()
properly deletes all trigger instances
static void write(OutputDevice &of, SUMOTime timestep)
Produce a VTK output to use with Tools like ParaView.
static void init()
Static initalization.
static void cleanup()
Static cleanup.
The class responsible for building and deletion of vehicles.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
void clearState()
Remove all vehicles before quick-loading state.
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
void removePending()
Removes a vehicle after it has ended.
double getTotalTravelTime() const
Returns the total travel time.
void adaptIntermodalRouter(MSNet::MSIntermodalRouter &router) const
int getLoadedVehicleNo() const
Returns the number of build vehicles.
int getCollisionCount() const
return the number of collisions
int getTeleportsWrongLane() const
return the number of teleports due to vehicles stuck on the wrong lane
int getStoppedVehiclesCount() const
return the number of vehicles that are currently stopped
int getTeleportsYield() const
return the number of teleports due to vehicles stuck on a minor road
int getEmergencyStops() const
return the number of emergency stops
double getTotalDepartureDelay() const
Returns the total departure delay.
virtual std::pair< double, double > getVehicleMeanSpeeds() const
get current absolute and relative mean vehicle speed in the network
int getDepartedVehicleNo() const
Returns the number of inserted vehicles.
int getArrivedVehicleNo() const
Returns the number of arrived vehicles.
int getActiveVehicleCount() const
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a ...
int getTeleportsJam() const
return the number of teleports due to jamming
int getEndedVehicleNo() const
Returns the number of removed vehicles.
virtual int getHaltingVehicleNo() const
Returns the number of halting vehicles.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
int getTeleportCount() const
return the number of teleports (including collisions)
void abortWaiting()
informes about all waiting vehicles (deletion in destructor)
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Representation of a vehicle in the micro simulation.
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
void checkInsertions(SUMOTime time)
Checks "movement" of stored vehicles.
void clearState()
Remove all vehicles before quick-loading state.
static void write(OutputDevice &of, const MSEdgeControl &ec, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
const std::string & getID() const
Returns the id.
A map of named object pointers.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
std::string getValueString(const std::string &name) const
Returns the string-value of the named option (all options)
static OptionsCont & getOptions()
Retrieves the options.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
An output device that encapsulates an ofstream.
Static storage of an output device and its base (abstract) implementation.
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >())
Writes an XML header with optional configuration.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static void closeAll(bool keepErrorRetrievers=false)
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
void loadNext(SUMOTime step)
loads the next routes up to and including the given time step
Representation of a vehicle.
virtual MSVehicleDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or 0.
virtual bool isOnRoad() const =0
Returns the information whether the vehicle is on a road (is simulated)
Storage for geometrical objects.
static long getCurrentMillis()
Returns the current time in milliseconds.
TraCI server used to control sumo by a remote TraCI client.
static bool wasClosed()
check whether close was requested
SUMOTime getTargetTime() const
std::vector< std::string > & getLoadArgs()
void cleanup()
clean up subscriptions
void processCommandsUntilSimStep(SUMOTime step)
process all commands until the next SUMO simulation step. It is guaranteed that t->getTargetTime() >=...
static TraCIServer * getInstance()
static void postProcessRemoteControl()
TRACI_CONST int ROUTING_MODE_COMBINED
edge type specific meso parameters