178 throw ProcessError(
"A network was not yet constructed.");
200 myAmInterrupted(false),
203 myHavePermissions(false),
204 myHasInternalLinks(false),
205 myJunctionHigherSpeeds(false),
206 myHasElevation(false),
207 myHasPedestrianNetwork(false),
208 myHasBidiEdges(false),
209 myEdgeDataEndTime(-1),
210 myDynamicShapeUpdater(nullptr) {
212 throw ProcessError(
"A network was already constructed.");
250 std::vector<SUMOTime> stateDumpTimes,
251 std::vector<std::string> stateDumpFiles,
252 bool hasInternalLinks,
253 bool junctionHigherSpeeds,
277 throw ProcessError(
"Option weights.separate-turns is only supported when simulating with internal lanes");
309 delete router.second;
313 delete router.second;
317 delete router.second;
321 delete router.second;
339 const std::map<SUMOVehicleClass, double>*
341 std::map<std::string, std::map<SUMOVehicleClass, double> >::const_iterator i =
myRestrictions.find(
id);
383 bool doStepLog =
false;
395 std::cout <<
SIMTIME <<
" MSNet::simulate(" << start <<
", " << stop <<
")"
424 std::ostringstream msg;
428 msg <<
"Performance: " <<
"\n" <<
" Duration: " <<
elapsedMs2string(duration) <<
"\n";
433 msg <<
" Real time factor: " << (
STEPS2TIME(
myStep - start) * 1000. / (double)duration) <<
"\n";
434 msg.setf(std::ios::fixed, std::ios::floatfield);
435 msg.setf(std::ios::showpoint);
436 msg <<
" UPS: " << ((double)
myVehiclesMoved / ((
double)duration / 1000)) <<
"\n";
438 msg <<
" UPS-Persons: " << ((double)
myPersonsMoved / ((
double)duration / 1000)) <<
"\n";
444 msg <<
"Vehicles: " <<
"\n"
451 std::vector<std::string> reasons;
470 msg <<
"Persons: " <<
"\n"
478 msg <<
"Containers: " <<
"\n"
496 for (
const auto& c : item.second) {
504 od.
writeAttr(
"colliderType", c.colliderType);
505 od.
writeAttr(
"victimType", c.victimType);
506 od.
writeAttr(
"colliderSpeed", c.colliderSpeed);
507 od.
writeAttr(
"victimSpeed", c.victimSpeed);
585 std::cout <<
SIMTIME <<
": MSNet::simulationStep() called"
586 <<
", myStep = " <<
myStep
596 bool loadRequested = !TraCI::getLoadArgs().empty();
621 std::replace(timeStamp.begin(), timeStamp.end(),
':',
'-');
634 MSRoutingEngine::waitForAll();
683 MSRoutingEngine::waitForAll();
739 if (stopTime >= 0 &&
myStep >= stopTime) {
779 return "The final simulation step has been reached.";
781 return "All vehicles have left the simulation.";
783 return "TraCI requested termination.";
785 return "An error occurred (see log).";
787 return "Interrupted.";
789 return "Too many teleports.";
791 return "TraCI issued load command.";
793 return "Unknown reason.";
836 for (
MSLane* lane : lanes) {
837 lane->getVehiclesSecure();
839 lane->releaseVehicles();
852 for (
auto& item2 : item.second) {
853 item2.second->clearState();
878 if (oc.
isSet(
"netstate-dump")) {
880 oc.
getInt(
"netstate-dump.precision"));
891 oc.
getInt(
"emission-output.precision"));
897 oc.
getInt(
"battery-output.precision"));
904 if (oc.
getBool(
"elechybrid-output.aggregated")) {
907 oc.
getInt(
"elechybrid-output.precision"));
918 std::string vehID = veh->
getID();
919 std::string filename2 = output +
"_" + vehID +
".xml";
921 std::map<SumoXMLAttr, std::string> attrs;
953 timestep = timestep.substr(0, timestep.length() - 3);
955 std::string filename = output +
"_" + timestep +
".vtp";
985 od.
writeAttr(
"meanWaitingTime", meanWaitingTime);
986 od.
writeAttr(
"meanTravelTime", meanTravelTime);
988 od.
writeAttr(
"meanSpeed", meanSpeed.first);
989 od.
writeAttr(
"meanSpeedRelative", meanSpeed.second);
1025 for (
const MSLane*
const lane : edge->getLanes()) {
1026 for (
const MSLink*
const link : lane->getLinkCont()) {
1027 link->writeApproaching(od, lane->getID());
1036 dev->updateAndWriteOutput();
1041 if (dev->generatesOutput()) {
1099 std::ostringstream oss;
1100 oss.setf(std::ios::fixed, std::ios::floatfield);
1101 oss.setf(std::ios::showpoint);
1106 << (
TS / durationSec) <<
"*RT, ~"
1109 oss <<
" (0ms ?*RT. ?";
1120 std::cout << oss.str().substr(0, 90 - prev.length());
1149 listener->vehicleStateChanged(vehicle, to, info);
1177 listener->transportableStateChanged(transportable, to, info);
1191 old.
type = collisionType;
1205 c.
type = collisionType;
1217 for (
auto it2 = it->second.begin(); it2 != it->second.end();) {
1218 if (it2->time !=
myStep) {
1219 it2 = it->second.erase(it2);
1224 if (it->second.size() == 0) {
1263 if (&stop->
getLane() == lane && stop->
getBeginLanePosition() - POSITION_EPS <= pos && stop->getEndLanePosition() + POSITION_EPS >= pos) {
1264 return stop->
getID();
1299 if (rs !=
nullptr) {
1323 it->writeTractionSubstationOutput(output);
1332 if ((*it)->getID() == substationId) {
1343 if ((*it)->getID() == substationId) {
1355 if (routingAlgorithm ==
"dijkstra") {
1358 if (routingAlgorithm !=
"astar") {
1359 WRITE_WARNING(
"TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm +
"'. using 'astar' instead.");
1392 const int key = rngIndex * oc.
getInt(
"thread-rngs") + routingMode;
1395 for (
const std::string& opt : oc.
getStringVector(
"persontrip.transfer.car-walk")) {
1396 if (opt ==
"parkingAreas") {
1398 }
else if (opt ==
"ptStops") {
1400 }
else if (opt ==
"allJunctions") {
1405 const std::string& taxiDropoff = oc.
getValueString(
"persontrip.transfer.taxi-walk");
1406 const std::string& taxiPickup = oc.
getValueString(
"persontrip.transfer.walk-taxi");
1407 if (taxiDropoff ==
"") {
1411 }
else if (taxiDropoff ==
"ptStops") {
1413 }
else if (taxiDropoff ==
"allJunctions") {
1416 if (taxiPickup ==
"") {
1420 }
else if (taxiPickup ==
"ptStops") {
1422 }
else if (taxiPickup ==
"allJunctions") {
1446 for (
const auto& i : stopType.second) {
1447 const MSEdge*
const edge = &i.second->getLane().getEdge();
1448 router.
getNetwork()->
addAccess(i.first, edge, i.second->getBeginLanePosition(), i.second->getEndLanePosition(),
1449 i.second->getAccessDistance(edge), element,
false, taxiWait);
1452 for (
const auto& a : i.second->getAllAccessPos()) {
1453 router.
getNetwork()->
addAccess(i.first, &std::get<0>(a)->getEdge(), std::get<1>(a), std::get<1>(a), std::get<2>(a), element,
true, taxiWait);
1455 if (external !=
nullptr) {
1477 for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
1478 for (std::vector<MSLane*>::const_iterator i = (*e)->getLanes().begin(); i != (*e)->getLanes().end(); ++i) {
1479 if ((*i)->getShape().hasElevation()) {
1502 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_TRAIN_STOP
A train stop (alias for bus stop)
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ SUMO_ATTR_MAXIMUMBATTERYCAPACITY
Maxium battery capacity.
@ SUMO_ATTR_RECUPERATIONENABLE
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
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 startPos, const double endPos, 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 double gWeightsSeparateTurns
Whether turning specific weights are estimated (and how much)
static bool gOverheadWireRecuperation
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static bool gCheck4Accidents
static bool gClearState
whether the simulation is in the process of clearing state (MSNet::clearState)
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
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 transportable state changes.
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.
long myTraCIMillis
The overall time spent waiting for traci operations including.
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.
void informTransportableStateListener(const MSTransportable *const transportable, TransportableState to, const std::string &info="")
Informs all added listeners about a transportable's state change.
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.
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)
void removeOutdatedCollisions()
remove collisions from the previous simulation step
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
std::vector< std::string > myPeriodicStateFiles
The names of the last K periodic state files (only only K shall be kept)
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
void removeTransportableStateListener(TransportableStateListener *listener)
Removes a transportable states listener.
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.
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 junctionHigherSpeeds, double version)
Closes the network's building process.
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;.
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;.
std::vector< TransportableStateListener * > myTransportableStateListeners
Container for transportable state listener.
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.
void writeCollisions() const
write collision output to (xml) file
MSEdgeControl & getEdgeControl()
Returns the edge control.
std::vector< SUMOTime > myStateDumpTimes
Times at which a state shall be written.
void addTransportableStateListener(TransportableStateListener *listener)
Adds a transportable states listener.
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 addMesoType(const std::string &typeID, const MESegment::MesoEdgeType &edgeType)
Adds edge type specific meso parameters.
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.
long myTraCIStepDuration
The last simulation step duration.
TransportableState
Definition of a transportable state.
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
std::map< std::string, MESegment::MesoEdgeType > myMesoEdgeTypes
The edge type specific meso parameters.
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.
bool registerCollision(const SUMOTrafficObject *collider, const SUMOTrafficObject *victim, const std::string &collisionType, const MSLane *lane, double pos)
register collision and return whether it was the first one involving these vehicles
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.
bool myJunctionHigherSpeeds
Whether the network was built with higher speed on junctions.
long mySimBeginMillis
The overall simulation duration.
bool myHasPedestrianNetwork
Whether the network contains pedestrian network elements.
const MESegment::MesoEdgeType & getMesoType(const std::string &typeID)
Returns edge type specific meso parameters if no type specific parameters have been loaded,...
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
CollisionMap myCollisions
collisions in the current time step
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.
static MSStopOut * getInstance()
void generateOutputForUnfinished()
generate output for vehicles which are still stopped at simulation end
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.
Traction substaction powering one or more overhead wire sections.
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.
void clearState()
Resets transportables when quick-loading state.
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.
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
void clearState(const bool reinit)
Remove all vehicles before quick-loading state.
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.
const std::string & getID() const
Returns the name of the vehicle type.
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.
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.
void setPrecision(int precision=gPrecision)
Sets the precision or resets it to default.
static void closeAll(bool keepErrorRetrievers=false)
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >(), bool includeConfig=true)
Writes an XML header with optional configuration.
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, person, or container.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
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)
A scoped lock which only triggers on condition.
Storage for geometrical objects.
void clearState()
Remove all dynamics before quick-loading state.
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