Eclipse SUMO - Simulation of Urban MObility
Command_RouteReplacement Class Reference

Writes the state of the tls to a file (in each second) More...

#include <Command_RouteReplacement.h>

Inheritance diagram for Command_RouteReplacement:
[legend]
Collaboration diagram for Command_RouteReplacement:
[legend]

Public Member Functions

 Command_RouteReplacement (const std::string &vehID, ConstMSRoutePtr 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_RouteReplacementoperator= (const Command_RouteReplacement &)
 Invalidated assignment operator. More...
 

Private Attributes

ConstMSRoutePtr myRoute
 The replacement route. More...
 
std::string myVehID
 The id of the vehicle to be rerouted. More...
 

Detailed Description

Writes the state of the tls to a file (in each second)

Definition at line 41 of file Command_RouteReplacement.h.

Constructor & Destructor Documentation

◆ Command_RouteReplacement() [1/2]

Command_RouteReplacement::Command_RouteReplacement ( const std::string &  vehID,
ConstMSRoutePtr  route 
)

Constructor.

Parameters
[in]tllsThe logic to write state of
[in]odThe output device to write the state into

Definition at line 34 of file Command_RouteReplacement.cpp.

◆ ~Command_RouteReplacement()

Command_RouteReplacement::~Command_RouteReplacement ( )

Destructor.

Definition at line 40 of file Command_RouteReplacement.cpp.

◆ Command_RouteReplacement() [2/2]

Command_RouteReplacement::Command_RouteReplacement ( const Command_RouteReplacement )
private

Invalidated copy constructor.

Member Function Documentation

◆ execute()

SUMOTime Command_RouteReplacement::execute ( SUMOTime  currentTime)
virtual

toggles override

Returns always 1.

Parameters
[in]currentTimeThe current simulation time (unused)
Returns
Always DELTA_T (will be executed in next time step)
See also
Command

Implements Command.

Definition at line 44 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, SUMOTrafficObject::replaceRoute(), SIMSTEP, time2string(), and WRITE_WARNING.

◆ operator=()

Command_RouteReplacement& Command_RouteReplacement::operator= ( const Command_RouteReplacement )
private

Invalidated assignment operator.

◆ shiftTime()

virtual SUMOTime Command::shiftTime ( SUMOTime  ,
SUMOTime  ,
SUMOTime   
)
inlinevirtualinherited

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.

Parameters
[in]currentTimeThe current simulation time
[in]execTimeThe time at which the command would have been executed
[in]newTimeThe simulation time at which the simulation is restarted
Returns
The time at which the command shall be executed again

Reimplemented in MSCalibrator::CalibratorCommand, and MSTrafficLightLogic::SwitchCommand.

Definition at line 83 of file Command.h.

Field Documentation

◆ myRoute

ConstMSRoutePtr Command_RouteReplacement::myRoute
private

The replacement route.

Definition at line 74 of file Command_RouteReplacement.h.

Referenced by execute().

◆ myVehID

std::string Command_RouteReplacement::myVehID
private

The id of the vehicle to be rerouted.

Definition at line 71 of file Command_RouteReplacement.h.

Referenced by execute().

◆ priority

int Command::priority = 0
inherited

The documentation for this class was generated from the following files: