Skip to content

Commit

Permalink
fix #14737
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 18, 2024
1 parent cfc106e commit 051c739
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ MSSimpleTrafficLightLogic::getParameter(const std::string& key, const std::strin
return toString(myCoordinated);
} else if (key == "cycleSecond") {
return toString(STEPS2TIME(getTimeInCycle()));
} else if (key == "typeName") {
return toString(this->getLogicType());
}
return Parameterised::getParameter(key, defaultValue);
}
Expand All @@ -346,7 +348,7 @@ MSSimpleTrafficLightLogic::setParameter(const std::string& key, const std::strin
if (key == "cycleTime") {
myDefaultCycleTime = string2time(value);
Parameterised::setParameter(key, value);
} else if (key == "cycleSecond") {
} else if (key == "cycleSecond" || key == "typeName") {
throw InvalidArgument(key + " cannot be changed dynamically for traffic light '" + getID() + "'");
} else if (key == "offset") {
myOffset = string2time(value);
Expand Down
8 changes: 0 additions & 8 deletions src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,9 @@ class MSSimpleTrafficLightLogic : public MSTrafficLightLogic {
* @see MSTrafficLightLogic::getPhase
*/
const MSPhaseDefinition& getPhase(int givenstep) const override;

/** @brief Returns the type of the logic as a string
* @return The type of the logic
*/
const std::string getLogicType() const {
return "simpleTrafficLightLogic";
}
/// @}



/// @name Dynamic Information Retrieval
/// @{

Expand Down

0 comments on commit 051c739

Please sign in to comment.