20 #ifndef MSDevice_ToC_h 21 #define MSDevice_ToC_h 39 class Command_ToCTrigger;
40 class Command_ToCProcess;
121 void setParameter(
const std::string& key,
const std::string& value);
152 std::string manualType, std::string automatedType,
153 SUMOTime responseTime,
double recoveryRate,
double initialAwareness,
static std::string getManualType(const SUMOVehicle &v, const OptionsCont &oc)
Representation of a vehicle in the micro simulation.
void descheduleRecovery()
Remove ongoing awareness recovery process from the event-queue.
ToCState myState
Current state of the device.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_ToC-options.
static double getRecoveryRate(const SUMOVehicle &v, const OptionsCont &oc)
SUMOTime MRMExecutionStep(SUMOTime t)
Continue the MRM for one time step.
void descheduleToCPreparation()
Remove ongoing ToC-Preparation process from the event-queue.
static ToCState _2ToCState(const std::string &)
void descheduleMRM()
Break MRM Process or remove MRM-Trigger command from the event-queue.
SUMOTime triggerUpwardToC(SUMOTime t)
Trigger execution of a ToC X–>AUTOMATED ("upwards")
MSDevice_ToC & operator=(const MSDevice_ToC &)
Invalidated assignment operator.
WrappingCommand< MSDevice_ToC > * myExecuteMRMCommand
static double getResponseTime(const SUMOVehicle &v, const OptionsCont &oc)
void initColorScheme()
Initialize vehicle colors for different states.
static std::string _2string(ToCState state)
SUMOTime triggerDownwardToC(SUMOTime t)
Trigger execution of a ToC X–>MANUAL ("downwards")
static bool useColorScheme(const SUMOVehicle &v, const OptionsCont &oc)
std::string myAutomatedTypeID
vehicle type ID for automated driving
void requestToC(SUMOTime timeTillMRM)
Request a ToC. If the device is in AUTOMATED or MRM state, a driver response time is sampled and the ...
void requestMRM()
Request an MRM to be initiated immediately. No downward ToC will be scheduled.
WrappingCommand< MSDevice_ToC > * myTriggerMRMCommand
void setAwareness(double value)
Set the awareness to the given value.
SUMOTime ensureDriverStateExistence(SUMOTime)
Ensure existence of DriverState for equipped vehicles.
bool myUseColorScheme
Whether a coloring scheme shall by applied to indicate the different toc stages,. ...
MSDevice_ToC(SUMOVehicle &holder, const std::string &id, std::string manualType, std::string automatedType, SUMOTime responseTime, double recoveryRate, double initialAwareness, double mrmDecel, bool useColorScheme)
Constructor.
Representation of a vehicle.
ToCState
Enum describing the different regimes for the device,.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key ...
MSVehicle * myHolderMS
The holder vehicle casted to MSVehicle*.
static double getMRMDecel(const SUMOVehicle &v, const OptionsCont &oc)
std::string myManualTypeID
vehicle type ID for manual driving
double myCurrentAwareness
static double getInitialAwareness(const SUMOVehicle &v, const OptionsCont &oc)
SUMOTime ToCPreparationStep(SUMOTime t)
Continue the ToC preparation for one time step.
Abstract in-vehicle device.
A storage for options typed value containers)
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice *> &into)
Build devices for the given vehicle, if needed.
void setState(ToCState state)
Set the ToC device's state.
void descheduleToC()
Remove scheduled ToC-Trigger command from the event-queue.
WrappingCommand< MSDevice_ToC > * myRecoverAwarenessCommand
SUMOTime awarenessRecoveryStep(SUMOTime t)
Continue the awareness recovery for one time step.
~MSDevice_ToC()
Destructor.
WrappingCommand< MSDevice_ToC > * myTriggerToCCommand
const std::string deviceName() const
return the name for this type of device
void switchHolderType(const std::string &targetTypeID)
Switch the device holder's vehicle type.
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key ...
SUMOTime triggerMRM(SUMOTime t)
Trigger execution of an MRM.
WrappingCommand< MSDevice_ToC > * myPrepareToCCommand
std::map< ToCState, RGBColor > myColorScheme
Coloring scheme,.
The ToC Device controls transition of control between automated and manual driving.
double myMRMDecel
Deceleration rate applied during MRM.
double myInitialAwareness
static std::string getAutomatedType(const SUMOVehicle &v, const OptionsCont &oc)