Skip to content

Commit

Permalink
simplifying debug output, fixing warnings #12 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Apr 30, 2024
1 parent 1b69bd9 commit 344e851
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 176 deletions.
2 changes: 1 addition & 1 deletion src/guisim/GUITrafficLightLogicWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ GUITrafficLightLogicWrapper::getCurrentTimeInCycleSeconds() const {

int
GUITrafficLightLogicWrapper::getRunningDurationSeconds() const {
return STEPS2TIME(getActiveTLLogic()->getSpentDuration());
return (int)STEPS2TIME(getActiveTLLogic()->getSpentDuration());
}


Expand Down
24 changes: 12 additions & 12 deletions src/microsim/MSLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ MSLink::MSLink(MSLane* predLane, MSLane* succLane, MSLane* via, LinkDirection di
myParallelLeft(nullptr),
myAmIndirect(indirect),
myRadius(std::numeric_limits<double>::max()),
myPermissions(myLaneBefore->getPermissions() & myLane->getPermissions() & (via == nullptr ? SVCAll : via->getPermissions())),
myPermissions(myLaneBefore->getPermissions() & myLane->getPermissions() & (via == nullptr ? SVCAll : via->getPermissions())),
myJunction(nullptr) {

if (MSGlobals::gLateralResolution > 0) {
Expand Down Expand Up @@ -1905,21 +1905,21 @@ MSLink::getZipperSpeed(const MSVehicle* ego, const double dist, double vSafe,
if (dist > MAX2(myFoeVisibilityDistance, brakeGap)) {
#ifdef DEBUG_ZIPPER
const SUMOTime now = MSNet::getInstance()->getCurrentTimeStep();
if (DEBUG_COND_ZIPPER) DEBUGOUT(SIMTIME << " getZipperSpeed ego=" << ego->getID()
<< " dist=" << dist << " ignoring foes (arrival in " << STEPS2TIME(arrivalTime - now) << ")\n")
DEBUGOUT(DEBUG_COND_ZIPPER, SIMTIME << " getZipperSpeed ego=" << ego->getID()
<< " dist=" << dist << " ignoring foes (arrival in " << STEPS2TIME(arrivalTime - now) << ")\n")
#endif
return vSafe;
return vSafe;
}
#ifdef DEBUG_ZIPPER
if (DEBUG_COND_ZIPPER) DEBUGOUT(SIMTIME << " getZipperSpeed ego=" << ego->getID()
<< " egoAT=" << arrivalTime
<< " dist=" << dist
<< " brakeGap=" << brakeGap
<< " vSafe=" << vSafe
<< " numFoes=" << foes->size()
<< "\n")
DEBUGOUT(DEBUG_COND_ZIPPER, SIMTIME << " getZipperSpeed ego=" << ego->getID()
<< " egoAT=" << arrivalTime
<< " dist=" << dist
<< " brakeGap=" << brakeGap
<< " vSafe=" << vSafe
<< " numFoes=" << foes->size()
<< "\n")
#endif
MSLink* foeLink = myFoeLinks[0];
MSLink* foeLink = myFoeLinks[0];
for (const auto& item : *foes) {
const MSVehicle* foe = dynamic_cast<const MSVehicle*>(item);
assert(foe != 0);
Expand Down

0 comments on commit 344e851

Please sign in to comment.