public class IncidentEvent extends ScenarioEvent implements java.lang.Comparable<IncidentEvent>
Modifier and Type | Class and Description |
---|---|
static class |
IncidentEvent.Comparators |
private class |
IncidentEvent.InvalidSegmentTypeException |
Modifier and Type | Field and Description |
---|---|
private int[] |
scenarioLanesAvailable
Array holding the number of open lanes in the segment in each period for
the duration of the incident event.
|
private int |
segment
Segment in which the incident event occurs.
|
int |
segmentType
Segment type of the incident (GP or ML).
|
private static long |
serialVersionUID |
private static int |
TYPE_GP
Identifier for General Purpose (GP) segment incidents.
|
private static int |
TYPE_ML
Identifier for Managed Lane (ML) segment incidents.
|
duration, scenarioInfo, seed, severity, startPeriod
Constructor and Description |
---|
IncidentEvent(Seed seed,
ScenarioInfo scenarioInfo,
int severity,
int startPeriod,
int duration,
int segment,
int segmentType)
Constructor for Incident ScenarioEvents
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkSegmentSwapGP(java.util.ArrayList<ScenarioInfo> scenarioInfos,
IncidentEvent inc1,
IncidentEvent inc2)
Checks if swapping the segments of two incidents (GP) is valid.
|
static boolean |
checkSegmentSwapML(java.util.ArrayList<ScenarioInfo> scenarioInfos,
IncidentEvent inc1,
IncidentEvent inc2)
Checks if swapping the segments of two incidents (ML) is valid.
|
int |
compareTo(IncidentEvent o) |
float |
getEventCAF(int period,
int segment) |
float |
getEventDAF(int period,
int segment) |
int |
getEventLAF(int period,
int segment) |
float |
getEventOAF(int period,
int segment) |
float |
getEventSAF(int period,
int segment) |
int |
getSegment() |
int |
getSegmentType() |
java.lang.String |
getSeverityString() |
boolean |
hasOverlap(IncidentEvent incEvent)
Checks to see if the event overlaps with the specified incident event.
|
boolean |
hasOverlap(ScenarioEvent event)
Checks to see if the event overlaps with the specified incident event.
|
boolean |
isValid()
Checks to see if the event is valid for the seed/scenario in both the
spatial and temporal sense.
|
boolean |
isValidSeverity()
Checks if the incident is valid for the scenario.
|
private int |
mapPeriod(int period) |
void |
setSegment(int newSegment) |
java.lang.String |
toString() |
private void |
updateNumLanes()
Updates the number of lanes array to reflect any change in segment.
|
checkActiveInPeriod, getEndPeriod, hasPeriodWrapping
private static final long serialVersionUID
private static final int TYPE_GP
private static final int TYPE_ML
public final int segmentType
private int segment
private int[] scenarioLanesAvailable
public IncidentEvent(Seed seed, ScenarioInfo scenarioInfo, int severity, int startPeriod, int duration, int segment, int segmentType)
seed
- Seed instance associated with the Reliability analysis
containing the scenario event.scenarioInfo
- ScenarioInfo instance to which the event is/will be
assigned.severity
- Incident severity (0 - Shoulder closure, 1 - 1 Lane
closure, 2 - 2 lane closure, 3 - 3 Lane closure, 4 - 4+ Lane closure).startPeriod
- Period in which the incident event begins.duration
- Duration of the incident event.segment
- Segment in which the incident event occurs.segmentType
- Identifier for a GP or ML incident.private void updateNumLanes()
public boolean isValidSeverity()
public boolean isValid()
public static boolean checkSegmentSwapGP(java.util.ArrayList<ScenarioInfo> scenarioInfos, IncidentEvent inc1, IncidentEvent inc2)
scenarioInfos
- List of ScenarioInfos for the reliability analysis
the IncidentEvents are associated with.inc1
- First IncidentEvent (GP)inc2
- Second IncidentEvent (GP)public static boolean checkSegmentSwapML(java.util.ArrayList<ScenarioInfo> scenarioInfos, IncidentEvent inc1, IncidentEvent inc2)
scenarioInfos
- List of ScenarioInfos for the reliability analysis
the IncidentEvents are associated with.inc1
- First IncidentEvent (ML)inc2
- Second IncidentEvent (ML)public boolean hasOverlap(ScenarioEvent event)
hasOverlap
in class ScenarioEvent
event
- Event with which to check overlap.public boolean hasOverlap(IncidentEvent incEvent)
incEvent
- Event with which to check overlap.public float getEventCAF(int period, int segment)
getEventCAF
in class ScenarioEvent
public float getEventOAF(int period, int segment)
getEventOAF
in class ScenarioEvent
public float getEventDAF(int period, int segment)
getEventDAF
in class ScenarioEvent
public float getEventSAF(int period, int segment)
getEventSAF
in class ScenarioEvent
public int getEventLAF(int period, int segment)
getEventLAF
in class ScenarioEvent
public int compareTo(IncidentEvent o)
compareTo
in interface java.lang.Comparable<IncidentEvent>
public int getSegment()
public void setSegment(int newSegment)
public int getSegmentType()
private int mapPeriod(int period)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSeverityString()