Eclipse SUMO - Simulation of Urban MObility
MSCalibrator::CalibratorCommand Class Reference

#include <MSCalibrator.h>

Inheritance diagram for MSCalibrator::CalibratorCommand:
[legend]
Collaboration diagram for MSCalibrator::CalibratorCommand:
[legend]

Public Member Functions

 CalibratorCommand (MSCalibrator *cali)
 
SUMOTime execute (SUMOTime currentTime)
 Executes the command. More...
 
SUMOTime shiftTime (SUMOTime currentTime, SUMOTime execTime, SUMOTime newTime)
 Reschedule or deschedule the command when quick-loading state. More...
 

Data Fields

int priority = 0
 

Private Attributes

MSCalibratormyCalibrator
 

Detailed Description

Definition at line 139 of file MSCalibrator.h.

Constructor & Destructor Documentation

◆ CalibratorCommand()

MSCalibrator::CalibratorCommand::CalibratorCommand ( MSCalibrator cali)
inline

Definition at line 141 of file MSCalibrator.h.

Member Function Documentation

◆ execute()

SUMOTime MSCalibrator::CalibratorCommand::execute ( SUMOTime  currentTime)
inlinevirtual

Executes the command.

The implementations should return 0 if the command shall not be repeated, or a value larger than 0 that describe the time after which the command shall be executed again. Values below 0 must not be returned.

Parameters
[in]currentTimeThe current simulation time
Returns
The time after which the command shall be executed again, 0 if this command shall be descheduled.
Exceptions
ProcessErrorDerived actions may throw this exception

Implements Command.

Definition at line 144 of file MSCalibrator.h.

References MSCalibrator::execute(), and myCalibrator.

◆ shiftTime()

SUMOTime MSCalibrator::CalibratorCommand::shiftTime ( SUMOTime  currentTime,
SUMOTime  execTime,
SUMOTime  newTime 
)
virtual

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 from Command.

Definition at line 63 of file MSCalibrator.cpp.

References myCalibrator, MSCalibrator::myCurrentStateInterval, MSCalibrator::myIntervals, and UNUSED_PARAMETER.

Field Documentation

◆ myCalibrator

MSCalibrator* MSCalibrator::CalibratorCommand::myCalibrator
private

Definition at line 162 of file MSCalibrator.h.

Referenced by execute(), and shiftTime().

◆ 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: