![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Writes the state of the tls to a file (in each second) More...
#include <Command_RouteReplacement.h>
Public Member Functions | |
| Command_RouteReplacement (const std::string &vehID, const MSRoute *route) | |
| Constructor. More... | |
| virtual SUMOTime | shiftTime (SUMOTime, SUMOTime, SUMOTime) |
| Reschedule or deschedule the command when quick-loading state. More... | |
| ~Command_RouteReplacement () | |
| Destructor. More... | |
Derived from Command | |
| SUMOTime | execute (SUMOTime currentTime) |
| toggles override More... | |
Data Fields | |
| int | priority = 0 |
Private Member Functions | |
| Command_RouteReplacement (const Command_RouteReplacement &) | |
| Invalidated copy constructor. More... | |
| Command_RouteReplacement & | operator= (const Command_RouteReplacement &) |
| Invalidated assignment operator. More... | |
Private Attributes | |
| const MSRoute * | myRoute |
| The replacement route. More... | |
| std::string | myVehID |
| The id of the vehicle to be rerouted. More... | |
Writes the state of the tls to a file (in each second)
Definition at line 41 of file Command_RouteReplacement.h.
| Command_RouteReplacement::Command_RouteReplacement | ( | const std::string & | vehID, |
| const MSRoute * | route | ||
| ) |
Constructor.
| [in] | tlls | The logic to write state of |
| [in] | od | The output device to write the state into |
Definition at line 34 of file Command_RouteReplacement.cpp.
References MSRoute::addReference(), and myRoute.
| Command_RouteReplacement::~Command_RouteReplacement | ( | ) |
Destructor.
Definition at line 41 of file Command_RouteReplacement.cpp.
|
private |
Invalidated copy constructor.
toggles override
Returns always 1.
| [in] | currentTime | The current simulation time (unused) |
Implements Command.
Definition at line 45 of file Command_RouteReplacement.cpp.
References MSGlobals::gCheckRoutes, Named::getID(), MSNet::getInstance(), SUMOTrafficObject::getLane(), MSRoute::getReplacedIndex(), SUMOVehicle::getRoute(), MSVehicleControl::getVehicle(), MSNet::getVehicleControl(), SUMOVehicle::hasValidRoute(), myRoute, myVehID, MSRoute::release(), SUMOVehicle::replaceRoute(), SIMSTEP, time2string(), and WRITE_WARNING.
|
private |
Invalidated assignment operator.
Reschedule or deschedule the command when quick-loading state.
The implementations should return -1 if the command shall not be re-scheduled, or a value >= 0 that describe the new time at which the command shall be executed again.
| [in] | currentTime | The current simulation time |
| [in] | execTime | The time at which the command would have been executed |
| [in] | newTime | The simulation time at which the simulation is restarted |
Reimplemented in MSTrafficLightLogic::SwitchCommand, and MSCalibrator::CalibratorCommand.
|
private |
The replacement route.
Definition at line 74 of file Command_RouteReplacement.h.
Referenced by Command_RouteReplacement(), and execute().
|
private |
The id of the vehicle to be rerouted.
Definition at line 71 of file Command_RouteReplacement.h.
Referenced by execute().
|
inherited |
Definition at line 87 of file Command.h.
Referenced by MSTrafficLightLogic::SwitchCommand::SwitchCommand().