Select to view content in your preferred language

Incident Detect Node = modify Incident Duration

161
4
Jump to solution
3 weeks ago
JeffSilberberg
Frequent Contributor

I have modified an RTA so that the incident detection node now uses a TrackFieldWindow("speedInMph", -3, 0) expression to look at the last three (Current, -1, and -2) transactions for vehicle speeding.  

The Incident starts based on this logic, and defaults to Ends when the Logic returns false.

  // $feature.speedInMph > 25

// Get last 3 speed observations
var speeds = TrackFieldWindow("speedInMph", -3, 0);

// Check that all 3 speeds are > 25 MPH
return
    Count(speeds) == 3 &&
    speeds[0] > 25 &&
    speeds[1] > 25 &&
    speeds[2] > 25;


 Now I am trying to decide if I can fix the IncidentDuration added to the Schema, as the reports are 30 seconds apart, so speeds[2] is actually 60 seconds old at this point.  Could I add a fieldCalculation after the Detection Node to adjust the tIncidentDuration time? If so, would I need to do it for all Started, Ended, and Ongoing states, or can I somehow impact the value in the stored state?  

 

0 Kudos
1 Solution

Accepted Solutions
PeterNasuti
Esri Contributor

@JeffSilberberg Thanks for clarifying - the changes would need to be applied each time. The attribute state is maintained at the tool level and the arcade expression only evaluates to true vs false to determine whether the incident should be opened/continue/closed. We would not expect the contents of this arcade expression to change feature attribute prior state values.

View solution in original post

0 Kudos
4 Replies
JeffSilberberg
Frequent Contributor

Just thought I would bump this --- 

0 Kudos
PeterNasuti
Esri Contributor

Hi @JeffSilberberg not sure I am understanding your question correctly. Yes - you can add the Calculate Fields tool after any other tool in your model to adjust datetime values as desired. However this would need to occur outside/after the Detect Incidents tool.

https://developers.arcgis.com/arcade/function-reference/date_functions/#dateadd (can add negatives)

0 Kudos
JeffSilberberg
Frequent Contributor

@PeterNasuti

   It's not a question of whether I can add the Calculate Fields; it's a question of whether I can change the Incident Duration time as it started, not at the current transaction, but two transactions before, based on the 

TrackFieldWindow("speedInMph", -3, 0);

  

  If I change it on "Started", does it keep the change, or does the change need to be applied each time a transaction passes through the logic?  

 

0 Kudos
PeterNasuti
Esri Contributor

@JeffSilberberg Thanks for clarifying - the changes would need to be applied each time. The attribute state is maintained at the tool level and the arcade expression only evaluates to true vs false to determine whether the incident should be opened/continue/closed. We would not expect the contents of this arcade expression to change feature attribute prior state values.

0 Kudos