Skip to content

Commit

Permalink
Improved fault debugging for ramp meter algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
DougLau committed Jan 23, 2025
1 parent 8317360 commit 789f0d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/us/mn/state/dot/tms/server/KAdaptiveAlgorithm.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,14 @@ private R_NodeImpl findRNode(RampMeterImpl meter) {
Corridor cor =
BaseObjectImpl.corridors.getCorridor(cid);
if (cor != null) {
return cor.findActiveNode(
R_NodeImpl n = cor.findActiveNode(
new ForkFinder(rnode));
if (null == n && ALG_LOG.isOpen()) {
log("Fork not found " +
rnode.getName() + " for " +
meter.getName());
}
return n;
}
}
return rnode;
Expand Down
17 changes: 12 additions & 5 deletions src/us/mn/state/dot/tms/server/RampMeterImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -559,16 +559,23 @@ private MeterAlgorithmState createState() {
case SIMPLE:
return new SimpleAlgorithm();
case K_ADAPTIVE:
MeterAlgorithmState as =
KAdaptiveAlgorithm.meterState(this);
if (null == as)
updateFault(RampMeterFault.MISSING_STATE);
return as;
return createKAdaptiveState();
default:
return null;
}
}

/** Create K-Adaptive algorithm state */
private MeterAlgorithmState createKAdaptiveState() {
MeterAlgorithmState as = null;
if (ent_node != null) {
as = KAdaptiveAlgorithm.meterState(this);
if (null == as)
updateFault(RampMeterFault.MISSING_STATE);
}
return as;
}

/** Validate the metering algorithm */
public void validateAlgorithm() {
MeterAlgorithmState s = alg_state;
Expand Down

0 comments on commit 789f0d3

Please sign in to comment.