Skip to content

Commit

Permalink
tweaking debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Jan 27, 2025
1 parent 5b8a4d1 commit 56c3131
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

//#define DEBUG_DETECTORS
//#define DEBUG_PHASE_SELECTION
//#define DEBUG_PHASE_SELECTION_CUSTOM
#define DEBUG_COND (getID()=="C")

// ===========================================================================
Expand Down Expand Up @@ -1173,7 +1174,12 @@ MSActuatedTrafficLightLogic::decideNextPhaseCustom(bool mustSwitch) {
for (int next : getCurrentPhaseDef().nextPhases) {
const MSPhaseDefinition* phase = myPhases[next];
const std::string& condition = mustSwitch ? phase->finalTarget : phase->earlyTarget;
//std::cout << SIMTIME << " mustSwitch=" << mustSwitch << " condition=" << condition << "\n";
#ifdef DEBUG_PHASE_SELECTION_CUSTOM
if (DEBUG_COND) {
std::cout << SIMTIME << " mustSwitch=" << mustSwitch << " cur=" << myStep << " next=" << next << " condition=" << condition
<< " eval=" << (condition == "" ? NAN : evalExpression(condition)) << "\n";
}
#endif
if (condition != "") {
// backward compatibility if a user redefined DEFAULT_CONDITION
if (condition == DEFAULT_CONDITION && myConditions.count(DEFAULT_CONDITION) == 0) {
Expand Down

0 comments on commit 56c3131

Please sign in to comment.