coreEngine.reliabilityAnalysis.DataStruct

## Class IncidentData

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

-     public class IncidentData
      extends java.lang.Object

  Author:
    Lake and tristan

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private float` | `crashRateRatio`
    `private float[][]` | `incidentCAFs`
    `private float[][]` | `incidentDAFs`
    `private float[]` | `incidentDistribution`
    `private float[][]` | `incidentDurationInfo`
    `private float[][]` | `incidentFFSAFs`
    `private float[]` | `incidentFreqMonth`
    `private int[][]` | `incidentLAFs`
    `private float[][]` | `incidentProbabilities`
    `private int` | `modelType`
    `private float` | `pctOfAADT`
    `private Seed` | `seed`
    `static int` | `TYPE_GP`
    `static int` | `TYPE_ML`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IncidentData(int type)`
    `IncidentData(Seed seed, int type)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `calcIncidentFrequenciesCR(float[] crashRates, DemandData demandData, boolean isCrashRate)` Calculates the incident frequencies using crash rates, the incident/crash rate ratio, and the underlying demand rate.
    `private float[]` | `createWAvgDemandMultipliers(DemandData demandData)` Method to create the weighted average demand multipliers used in calculating the expected frequency of all incidents per study period in month j.
    `float` | `getCrashRateRatio()` Get method for the crash rate ratio for incident scenario generation.
    `float` | `getIncidentAdjFactor(int adjFacType, int incType, int numLanes)`
    `float[][]` | `getIncidentCAF()` Get method to return the float[][] of incident CAFs
    `float` | `getIncidentCAF(int incType, int numLanes)`
    `float[][]` | `getIncidentDAF()` Get method to return the float[][] of incident DAFs
    `float` | `getIncidentDAF(int incType, int numLanes)`
    `float[]` | `getIncidentDistribution()`
    `float` | `getIncidentDistribution(int incidentType)`
    `float` | `getIncidentDistributionDecimal(int incidentType)`
    `float` | `getIncidentDistributionSum()`
    `float` | `getIncidentDuration(int incidentType)`
    `float[][]` | `getIncidentDurationInfo()`
    `float` | `getIncidentDurationStdDev(int incidentType)`
    `float` | `getIncidentDurMax(int incidentType)`
    `float` | `getIncidentDurMin(int incidentType)`
    `float[][]` | `getIncidentFFSAF()` Get method to return the float[][] of incident FFSAFs
    `float` | `getIncidentFFSAF(int incType, int numLanes)`
    `float[]` | `getIncidentFrequencyArr()`
    `float` | `getIncidentFrequencyMonth(int month)` Getter for the expected frequency of incidents in a given month.
    `int[][]` | `getIncidentLAF()` Get method to get the int[][] array of incident LAFs.
    `int` | `getIncidentLAF(int incType, int numLanes)`
    `float` | `getIncidentProbability(int incidentType, int month)` Getter for the incident probabilities (deprecated).
    `static java.lang.String` | `getIncidentTypeFull(int incType)`
    `int` | `getModelType()`
    `float` | `getPercentOfAADT()` Get method for Percent of AADT Parameter for the HERS Model for the IncidentData instance.
    `void` | `setCrashRateRatio(float newVal)`
    `void` | `setIncidentAdjFactor(int adjFacType, int incType, int numLanes, float newVal)`
    `void` | `setIncidentCAF(int incType, int numLanes, float newVal)`
    `void` | `setIncidentDAF(int incType, int numLanes, float newVal)`
    `void` | `setIncidentDistribution(int incidentType, float newValue)`
    `void` | `setIncidentDuration(int incidentType, float newValue)`
    `void` | `setIncidentDurationStdDev(int incidentType, float newValue)`
    `void` | `setIncidentDurMax(int incidentType, float newValue)`
    `void` | `setIncidentDurMin(int incidentType, float newValue)`
    `void` | `setIncidentFFSAF(int incType, int numLanes, float newVal)`
    `void` | `setIncidentFrequency(float[] incidentFrequency)`
    `void` | `setIncidentFrequencyMonth(int month, float newValue)`
    `void` | `setIncidentLAF(int incType, int numLanes, int newVal)`
    `void` | `setIncidentProbability(int incidentType, int demandPattern, float newValue)`
    `void` | `setPercentOfAADT(float newVal)`
    `private void` | `useDefaultAdjFactors()`
    `private void` | `useDefaultAdjFactors(int adjFactor)` Method to set default values for a particular adjustment factor type.
    `private void` | `useDefaultCAFs()`
    `private void` | `useDefaultDAFs()`
    `void` | `useDefaultDistribution()`
    `void` | `useDefaultDuration()`
    `private void` | `useDefaultFFSAFs()`
    `void` | `useDefaultFrequencies()`
    `private void` | `useDefaultLAFs()`
    `void` | `useFrequenciesFromSeed()`
    `private void` | `useMLDefaultAdjFactors()`
    `private void` | `useMLDefaultCAFs()`
    `private void` | `useMLDefaultDAFs()`
    `void` | `useMLDefaultDistribution()`
    `private void` | `useMLDefaultFFSAFs()`
    `private void` | `useMLDefaultLAFs()`
    `void` | `useNationalDefaultDistribution()`
    `void` | `useOldI40DefaultFrequencies()`
    `void` | `useSeedFileDistribution()`
    `void` | `useSeedFileDurations()`

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

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

- - ### Field Detail

    - #### incidentProbabilities

          private final float[][] incidentProbabilities

    - #### incidentFreqMonth

          private final float[] incidentFreqMonth

    - #### incidentDistribution

          private final float[] incidentDistribution

    - #### incidentDurationInfo

          private final float[][] incidentDurationInfo

    - #### incidentFFSAFs

          private final float[][] incidentFFSAFs

    - #### incidentCAFs

          private final float[][] incidentCAFs

    - #### incidentDAFs

          private final float[][] incidentDAFs

    - #### incidentLAFs

          private final int[][] incidentLAFs

    - #### crashRateRatio

          private float crashRateRatio

    - #### pctOfAADT

          private float pctOfAADT

    - #### seed

          private Seed seed

    - #### modelType

          private final int modelType

    - #### TYPE_GP

          public static final int TYPE_GP

      See Also:
        Constant Field Values

    - #### TYPE_ML

          public static final int TYPE_ML

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### IncidentData

          public IncidentData(int type)

      Parameters:
        `type` -

    - #### IncidentData

          public IncidentData(Seed seed,
                              int type)

      Parameters:
        `seed` -
        `type` -

  - ### Method Detail

    - #### getCrashRateRatio

          public float getCrashRateRatio()

      Get method for the crash rate ratio for incident scenario generation.
      Returns:
        float crashRateRatio

    - #### getPercentOfAADT

          public float getPercentOfAADT()

      Get method for Percent of AADT Parameter for the HERS Model for the IncidentData instance. generation
      Returns:
        float crashRateRatio

    - #### getIncidentProbability

          public float getIncidentProbability(int incidentType,
                                              int month)

      Getter for the incident probabilities (deprecated).
      Parameters:
        `incidentType` -
        `month` -
      Returns:

    - #### getIncidentFrequencyMonth

          public float getIncidentFrequencyMonth(int month)

      Getter for the expected frequency of incidents in a given month.
      Parameters:
        `month` - 0 - January, 1 - February, etc.
      Returns:

    - #### getIncidentFrequencyArr

          public float[] getIncidentFrequencyArr()

      Returns:

    - #### getIncidentDistribution

          public float getIncidentDistribution(int incidentType)

      Parameters:
        `incidentType` -
      Returns:

    - #### getIncidentDistributionDecimal

          public float getIncidentDistributionDecimal(int incidentType)

      Parameters:
        `incidentType` -
      Returns:

    - #### getIncidentDistribution

          public float[] getIncidentDistribution()

      Returns:

    - #### getIncidentDurMin

          public float getIncidentDurMin(int incidentType)

      Parameters:
        `incidentType` -
      Returns:

    - #### getIncidentDurMax

          public float getIncidentDurMax(int incidentType)

      Parameters:
        `incidentType` -
      Returns:

    - #### getIncidentDistributionSum

          public float getIncidentDistributionSum()

      Returns:

    - #### getIncidentDuration

          public float getIncidentDuration(int incidentType)

      Parameters:
        `incidentType` -
      Returns:

    - #### getIncidentDurationInfo

          public float[][] getIncidentDurationInfo()

      Returns:

    - #### getIncidentDurationStdDev

          public float getIncidentDurationStdDev(int incidentType)

      Parameters:
        `incidentType` -
      Returns:

    - #### getIncidentAdjFactor

          public float getIncidentAdjFactor(int adjFacType,
                                            int incType,
                                            int numLanes)

      Parameters:
        `adjFacType` - 0 - FFSAF, 1 - CAF, 2 - DAF, 3 - LAF
        `incType` - 0 - Shoulder, 1 - 1 lane closure, 2 - 2 lane closure, 3 - 3 lane closure, 4 - 4 lane closure
        `numLanes` -
      Returns:

    - #### getIncidentFFSAF

          public float getIncidentFFSAF(int incType,
                                        int numLanes)

      Parameters:
        `incType` -
        `numLanes` -
      Returns:

    - #### getIncidentFFSAF

          public float[][] getIncidentFFSAF()

      Get method to return the float[][] of incident FFSAFs
      Returns:
        float[][] incidentFFSAFs

    - #### getIncidentCAF

          public float getIncidentCAF(int incType,
                                      int numLanes)

      Parameters:
        `incType` -
        `numLanes` -
      Returns:

    - #### getIncidentCAF

          public float[][] getIncidentCAF()

      Get method to return the float[][] of incident CAFs
      Returns:
        float[][] incidentCAFs

    - #### getIncidentDAF

          public float getIncidentDAF(int incType,
                                      int numLanes)

      Parameters:
        `incType` -
        `numLanes` -
      Returns:

    - #### getIncidentDAF

          public float[][] getIncidentDAF()

      Get method to return the float[][] of incident DAFs
      Returns:
        float[][] incidentDAFs

    - #### getIncidentLAF

          public int getIncidentLAF(int incType,
                                    int numLanes)

      Parameters:
        `incType` -
        `numLanes` -
      Returns:

    - #### getIncidentLAF

          public int[][] getIncidentLAF()

      Get method to get the int[][] array of incident LAFs.
      Returns:
        int[][] incident LAFs

    - #### getIncidentTypeFull

          public static java.lang.String getIncidentTypeFull(int incType)

      Parameters:
        `incType` -
      Returns:

    - #### useFrequenciesFromSeed

          public void useFrequenciesFromSeed()

    - #### getModelType

          public int getModelType()

      Returns:

    - #### setCrashRateRatio

          public void setCrashRateRatio(float newVal)

      Parameters:
        `newVal` -

    - #### setPercentOfAADT

          public void setPercentOfAADT(float newVal)

      Parameters:
        `newVal` -

    - #### setIncidentProbability

          public void setIncidentProbability(int incidentType,
                                             int demandPattern,
                                             float newValue)

      Parameters:
        `incidentType` -
        `demandPattern` -
        `newValue` -

    - #### setIncidentFrequencyMonth

          public void setIncidentFrequencyMonth(int month,
                                                float newValue)

      Parameters:
        `month` -
        `newValue` -

    - #### setIncidentFrequency

          public void setIncidentFrequency(float[] incidentFrequency)

      Parameters:
        `incidentFrequency` -

    - #### setIncidentDistribution

          public void setIncidentDistribution(int incidentType,
                                              float newValue)

      Parameters:
        `incidentType` -
        `newValue` -

    - #### setIncidentDurMin

          public void setIncidentDurMin(int incidentType,
                                        float newValue)

      Parameters:
        `incidentType` -
        `newValue` -

    - #### setIncidentDurMax

          public void setIncidentDurMax(int incidentType,
                                        float newValue)

      Parameters:
        `incidentType` -
        `newValue` -

    - #### setIncidentDuration

          public void setIncidentDuration(int incidentType,
                                          float newValue)

      Parameters:
        `incidentType` -
        `newValue` -

    - #### setIncidentDurationStdDev

          public void setIncidentDurationStdDev(int incidentType,
                                                float newValue)

      Parameters:
        `incidentType` -
        `newValue` -

    - #### setIncidentAdjFactor

          public void setIncidentAdjFactor(int adjFacType,
                                           int incType,
                                           int numLanes,
                                           float newVal)

      Parameters:
        `adjFacType` - 0 - FFSAF, 1 - CAF, 2 - DAF, 3 - LAF
        `incType` - 0 - Shoulder, 1 - 1 lane closure, 2 - 2 lane closure, 3 - 3 lane closure, 4 - 4 lane closure
        `numLanes` -
        `newVal` -

    - #### setIncidentFFSAF

          public void setIncidentFFSAF(int incType,
                                       int numLanes,
                                       float newVal)

      Parameters:
        `incType` -
        `numLanes` -
        `newVal` -

    - #### setIncidentCAF

          public void setIncidentCAF(int incType,
                                     int numLanes,
                                     float newVal)

      Parameters:
        `incType` -
        `numLanes` -
        `newVal` -

    - #### setIncidentDAF

          public void setIncidentDAF(int incType,
                                     int numLanes,
                                     float newVal)

      Parameters:
        `incType` -
        `numLanes` -
        `newVal` -

    - #### setIncidentLAF

          public void setIncidentLAF(int incType,
                                     int numLanes,
                                     int newVal)

      Parameters:
        `incType` -
        `numLanes` -
        `newVal` -

    - #### useDefaultFrequencies

          public void useDefaultFrequencies()

    - #### useOldI40DefaultFrequencies

          public void useOldI40DefaultFrequencies()

    - #### useDefaultDistribution

          public void useDefaultDistribution()

    - #### useSeedFileDistribution

          public void useSeedFileDistribution()

    - #### useSeedFileDurations

          public void useSeedFileDurations()

    - #### useNationalDefaultDistribution

          public void useNationalDefaultDistribution()

    - #### useMLDefaultDistribution

          public void useMLDefaultDistribution()

    - #### useDefaultDuration

          public void useDefaultDuration()

    - #### useDefaultAdjFactors

          private void useDefaultAdjFactors()

    - #### useMLDefaultAdjFactors

          private void useMLDefaultAdjFactors()

    - #### useDefaultAdjFactors

          private void useDefaultAdjFactors(int adjFactor)

      Method to set default values for a particular adjustment factor type. 0 - SAF (FFSAF), 1 - CAF, 2 - DAF, 3 - LAF
      Parameters:
        `adjFactor` - Integer of adjustment factor to fill with default values.

    - #### useDefaultFFSAFs

          private void useDefaultFFSAFs()

    - #### useDefaultCAFs

          private void useDefaultCAFs()

    - #### useDefaultDAFs

          private void useDefaultDAFs()

    - #### useDefaultLAFs

          private void useDefaultLAFs()

    - #### useMLDefaultFFSAFs

          private void useMLDefaultFFSAFs()

    - #### useMLDefaultCAFs

          private void useMLDefaultCAFs()

    - #### useMLDefaultDAFs

          private void useMLDefaultDAFs()

    - #### useMLDefaultLAFs

          private void useMLDefaultLAFs()

    - #### createWAvgDemandMultipliers

          private float[] createWAvgDemandMultipliers(DemandData demandData)

      Method to create the weighted average demand multipliers used in calculating the expected frequency of all incidents per study period in month j.
      Parameters:
        `demandData` -
      Returns:
        float[12] containing weighted average demand multipliers of each month.

    - #### calcIncidentFrequenciesCR

          public void calcIncidentFrequenciesCR(float[] crashRates,
                                                DemandData demandData,
                                                boolean isCrashRate)

      Calculates the incident frequencies using crash rates, the incident/crash rate ratio, and the underlying demand rate.
      Parameters:
        `crashRates` - 12 by 1 array of month crash rates
        `demandData` - Demand data on which the frequencies are based
        `isCrashRate` - True if crash rates, false if incident rates