Skip to content

Commit

Permalink
Setting ToC device's default response time to -1.0 to trigger random …
Browse files Browse the repository at this point in the history
…response time sampling if no value is specified, refs #5484
  • Loading branch information
Leonhard Luecken committed May 22, 2019
1 parent b07b7dd commit 42d4828
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/microsim/devices/MSDevice_ToC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// ===========================================================================

// default value for the average response time, that a driver needs to take back control
#define DEFAULT_RESPONSE_TIME 5.0
#define DEFAULT_RESPONSE_TIME -1.0
// default value for the average rate at which the driver's awareness recovers to
// 1.0 after a ToC has been performed
#define DEFAULT_RECOVERY_RATE 0.1
Expand Down Expand Up @@ -536,11 +536,11 @@ MSDevice_ToC::requestMRM() {
void
MSDevice_ToC::requestToC(SUMOTime timeTillMRM, SUMOTime responseTime) {
#ifdef DEBUG_TOC
std::cout << SIMTIME << " requestToC() for vehicle '" << myHolder.getID() << "' , timeTillMRM=" << timeTillMRM << std::endl;
std::cout << SIMTIME << " requestToC() for vehicle '" << myHolder.getID() << "', timeTillMRM=" << timeTillMRM << ", responseTime=" << responseTime << std::endl;
#endif
if (myState == AUTOMATED) {
// Initialize preparation phase
if (responseTime == -1) {
if (responseTime == -1000) {
// Sample response time from distribution
responseTime = TIME2STEPS(sampleResponseTime(STEPS2TIME(timeTillMRM)));
}
Expand Down
2 changes: 1 addition & 1 deletion src/microsim/devices/MSDevice_ToC.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class MSDevice_ToC : public MSVehicleDevice {
/// @param timeTillMRM
/// @param responseTime If the default is given (== -1), the response time is sampled randomly,
/// @see sampleResponseTime()
void requestToC(SUMOTime timeTillMRM, SUMOTime responseTime = -1);
void requestToC(SUMOTime timeTillMRM, SUMOTime responseTime = -1000);

/// @brief Request an MRM to be initiated immediately. No downward ToC will be scheduled.
/// @note The initiated MRM process will run forever until a new ToC is requested.
Expand Down

0 comments on commit 42d4828

Please sign in to comment.