Skip to content

Commit

Permalink
Disable occ. spike auto-fail for parking detectors
Browse files Browse the repository at this point in the history
  • Loading branch information
DougLau committed Jan 29, 2025
1 parent 5f9189c commit 4289e4a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docs/vehicle_detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ All others | 24 hours

### Occ Spike

A spike timer is kept for each detector. For every 25% change in occupancy
between two consecutive data values, 30 seconds are added to the timer. If its
value ever exceeds 60 seconds, the condidtion is triggered. After every poll,
30 seconds are removed from the timer. The condition will be cleared after 24
hours of no spikes.
A spike timer is kept for each non-parking detector. For every 25% change in
occupancy between two consecutive data values, 30 seconds are added to the
timer. If its value ever exceeds 60 seconds, the condidtion is triggered.
After every poll, 30 seconds are removed from the timer. The condition will
be cleared after 24 hours of no spikes.

## Force Fail

Expand Down
19 changes: 18 additions & 1 deletion src/us/mn/state/dot/tms/LaneCode.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* IRIS -- Intelligent Roadway Information System
* Copyright (C) 2008-2022 Minnesota Department of Transportation
* Copyright (C) 2008-2025 Minnesota Department of Transportation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,6 +15,7 @@
package us.mn.state.dot.tms;

import us.mn.state.dot.tms.units.Interval;
import static us.mn.state.dot.tms.units.Interval.Units.SECONDS;
import static us.mn.state.dot.tms.units.Interval.Units.MINUTES;
import static us.mn.state.dot.tms.units.Interval.Units.HOURS;
import static us.mn.state.dot.tms.units.Interval.Units.WEEKS;
Expand Down Expand Up @@ -108,6 +109,14 @@ private LaneCode(String c, String d, Interval nht, boolean ml,
static private final Interval NO_CHANGE_THRESHOLD_FALLBACK =
new Interval(2, WEEKS);

/** Scan "occ spike" threshold for regular sensors */
static private final Interval OCC_SPIKE_THRESHOLD =
new Interval(29, SECONDS);

/** Scan "occ spike" threshold for parking sensors */
static private final Interval OCC_SPIKE_THRESHOLD_PARKING =
new Interval(2, WEEKS);

/** Description */
public final String description;

Expand Down Expand Up @@ -135,6 +144,14 @@ public final Interval getNoChangeThreshold() {
return NO_CHANGE_THRESHOLD_FALLBACK;
}

/** Get the occ spike threshold */
public final Interval getOccSpikeThreshold() {
if (this != PARKING)
return OCC_SPIKE_THRESHOLD;
else
return OCC_SPIKE_THRESHOLD_PARKING;
}

/** Mainline lane */
public final boolean is_mainline;

Expand Down
8 changes: 2 additions & 6 deletions src/us/mn/state/dot/tms/server/DetectorImpl.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* IRIS -- Intelligent Roadway Information System
* Copyright (C) 2000-2024 Minnesota Department of Transportation
* Copyright (C) 2000-2025 Minnesota Department of Transportation
* Copyright (C) 2011 Berkeley Transportation Systems Inc.
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -167,10 +167,6 @@ private boolean checkLoggingThreshold() {
static private final Interval CHATTER_THRESHOLD =
new Interval(30, SECONDS);

/** Scan "occ spike" trigger threshold */
static private final Interval OCC_SPIKE_THRESHOLD =
new Interval(29, SECONDS);

/** Clear threshold */
static private final Interval CLEAR_THRESHOLD =
new Interval(24, Interval.Units.HOURS);
Expand Down Expand Up @@ -429,7 +425,7 @@ private Interval getNoChangeThreshold() {

/** Get the scan "occ spike" trigger threshold */
private Interval getOccSpikeTriggerThreshold() {
return OCC_SPIKE_THRESHOLD;
return LaneCode.fromCode(lane_code).getOccSpikeThreshold();
}

/** Destroy an object */
Expand Down

0 comments on commit 4289e4a

Please sign in to comment.