coreEngine.reliabilityAnalysis.DataStruct

## Class ScenarioEvent

- java.lang.Object
- - coreEngine.reliabilityAnalysis.DataStruct.ScenarioEvent

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    IncidentEvent, WeatherEvent

      public abstract class ScenarioEvent
      extends java.lang.Object
      implements java.io.Serializable

  Author:
    jltrask
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `duration` Duration (in periods) of the event.
    `ScenarioInfo` | `scenarioInfo` Index of the scenario the event is associated with.
    `Seed` | `seed` Seed instance associated with the Reliability analysis containing the scenario event.
    `private static long` | `serialVersionUID`
    `int` | `severity` Severity of the event.
    `int` | `startPeriod` Period in which the event starts (First period is considered to be period 0).

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScenarioEvent(Seed seed, ScenarioInfo scenarioInfo, int severity, int startPeriod, int duration)` Constructor of Scenario Event

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkActiveInPeriod(int period)` Checks to see if the event is active in the input period.
    `int` | `getEndPeriod()` Returns the end period of the ScenarioEvent.
    `abstract float` | `getEventCAF(int period, int segment)`
    `abstract float` | `getEventDAF(int period, int segment)`
    `abstract int` | `getEventLAF(int period, int segment)`
    `abstract float` | `getEventOAF(int period, int segment)`
    `abstract float` | `getEventSAF(int period, int segment)`
    `abstract boolean` | `hasOverlap(ScenarioEvent event)` Checks to see if the event overlaps with an event of the same type (weather, incident, or work zone).
    `boolean` | `hasPeriodWrapping()` Method to check if the scenario event startTime + duration exceeds causes its endPeriod to fall beyond the final analysis period.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### serialVersionUID

          private static final long serialVersionUID

      See Also:
        Constant Field Values

    - #### seed

          public final Seed seed

      Seed instance associated with the Reliability analysis containing the scenario event.

    - #### scenarioInfo

          public final ScenarioInfo scenarioInfo

      Index of the scenario the event is associated with. Indexing starts at 0.

    - #### startPeriod

          public int startPeriod

      Period in which the event starts (First period is considered to be period 0).

    - #### duration

          public int duration

      Duration (in periods) of the event.

    - #### severity

          public int severity

      Severity of the event.

  - ### Constructor Detail

    - #### ScenarioEvent

          public ScenarioEvent(Seed seed,
                               ScenarioInfo scenarioInfo,
                               int severity,
                               int startPeriod,
                               int duration)

      Constructor of Scenario Event
      Parameters:
        `seed` - Seed instance associated with the reliability analysis containing the event.
        `scenarioInfo` - Scenario the event is associated with
        `severity` - Severity of the event
        `startPeriod` - Period in which the event starts.
        `duration` - Duration (in periods) of the event.

  - ### Method Detail

    - #### getEndPeriod

          public int getEndPeriod()

      Returns the end period of the ScenarioEvent. Scenario Events can "wrap" around the Analysis Period. Also note that the end period is "inclusive" in that it is the last period in which the event is active. If an event starts in period 4 and has a duration of 1, then the end period is also 4.
      Returns:
        Last period in which the event is active.

    - #### hasPeriodWrapping

          public boolean hasPeriodWrapping()

      Method to check if the scenario event startTime + duration exceeds causes its endPeriod to fall beyond the final analysis period. If so, the event is consider to have "periodWrapping".
      Returns:
        True if the event wraps past the number of periods, false otherwise.

    - #### checkActiveInPeriod

          public boolean checkActiveInPeriod(int period)

      Checks to see if the event is active in the input period.
      Parameters:
        `period` - Input period
      Returns:
        True if the event is active, false otherwise.

    - #### hasOverlap

          public abstract boolean hasOverlap(ScenarioEvent event)

      Checks to see if the event overlaps with an event of the same type (weather, incident, or work zone).
      Parameters:
        `event` - Event with which to check overlap.
      Returns:
        True if the events overlap, false otherwise.

    - #### getEventCAF

          public abstract float getEventCAF(int period,
                                            int segment)

    - #### getEventOAF

          public abstract float getEventOAF(int period,
                                            int segment)

    - #### getEventDAF

          public abstract float getEventDAF(int period,
                                            int segment)

    - #### getEventSAF

          public abstract float getEventSAF(int period,
                                            int segment)

    - #### getEventLAF

          public abstract int getEventLAF(int period,
                                          int segment)