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

Private Attributes

const MSRoutemyRoute
 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,
const MSRoute 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.

References MSRoute::addReference(), and myRoute.

◆ ~Command_RouteReplacement()

Command_RouteReplacement::~Command_RouteReplacement ( )

Destructor.

Definition at line 41 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 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.

◆ 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 MSTrafficLightLogic::SwitchCommand, and MSCalibrator::CalibratorCommand.

Definition at line 83 of file Command.h.

Field Documentation

◆ myRoute

const MSRoute* Command_RouteReplacement::myRoute
private

The replacement route.

Definition at line 74 of file Command_RouteReplacement.h.

Referenced by Command_RouteReplacement(), and 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

Definition at line 87 of file Command.h.

Referenced by MSTrafficLightLogic::SwitchCommand::SwitchCommand().


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