coreEngine.reliabilityAnalysis.DataStruct

## Class WeatherData

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

-     public class WeatherData
      extends java.lang.Object

  Author:
    tristan and lake

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `WeatherData.InvalidAdjustmentFactorTypeException`
    `class` | `WeatherData.InvalidWeatherTypeException`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `AF_TYPE_CAF`
    `static int` | `AF_TYPE_DAF`
    `static int` | `AF_TYPE_SAF`
    `private float[]` | `averageDuration`
    `private float[]` | `defaultCAF`
    `static int` | `HeavyRain`
    `static int` | `HeavySnow`
    `static int` | `LightMediumSnow`
    `static int` | `LightSnow`
    `static int` | `LowVisibility`
    `static int` | `MediumHeavySnow`
    `static int` | `MediumRain`
    `static int` | `MinimumVisibility`
    `private boolean[]` | `monthActive`
    `private java.lang.String` | `nearestMetroArea`
    `static int` | `NormalWeather`
    `private int` | `seedDefaultFFS`
    `static int` | `SevereCold`
    `static int` | `VeryLowVisibility`
    `private float[]` | `weatherCAFs`
    `private float[]` | `weatherDAFs`
    `private float[][]` | `weatherProbability`
    `private float[]` | `weatherSAFs`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WeatherData()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkNonNegative()`
    `void` | `extractFromWeatherDB(boolean useAgencySpecificDB, java.lang.String metroAreaName, CETime startTime, CETime endTime)`
    `float` | `getAdjustmentFactor(int factorType, int weatherType)` Returns the adjustment factor of the specified type for the input weather type/severity.
    `float[]` | `getAdjustmentFactorArray(int factorType)` Returns the adjustment factor array of the specified type.
    `float` | `getAverageDurationHours(int weatherType)`
    `float[]` | `getAverageDurationMinutes()`
    `float` | `getAverageDurationMinutes(int weatherType)`
    `float` | `getAvgDurRoundedTo15MinIncrHour(int weatherType)`
    `int` | `getAvgDurRoundedTo15MinIncrMinute(int weatherType)`
    `int` | `getAvgDurRoundedTo15MinIncrNumIncr(int weatherType)`
    `boolean` | `getMonthActive(int month)`
    `java.lang.String` | `getNearestMetroArea()`
    `int` | `getNumWeatherTypes()`
    `float[][]` | `getProbability()`
    `float` | `getProbability(int month, int weatherType)`
    `float` | `getProbabilityDecimal(int month, int weatherType)`
    `float` | `getWeatherCAF(int weatherType)` Returns the Capacity Adjustment Factor (CAF) for the specified weather type/severity.
    `float[]` | `getWeatherCAFArray()` Returns the array of Capacity Adjustment Factors (CAFs).
    `float` | `getWeatherDAF(int weatherType)` Returns the Demand Adjustment Factor (DAF) for the specified weather type/severity.
    `float[]` | `getWeatherDAFArray()` Returns the array of Demand Adjustment Factors (DAFs).
    `float` | `getWeatherSAF(int weatherType)` Returns the Speed Adjustment Factor (SAF) for the specified weather type/severity.
    `float[]` | `getWeatherSAFArray()` Returns the array of Speed Adjustment Factors (SAFs).
    `static java.lang.String` | `getWeatherTypeAbbrev(int weatherType)`
    `static java.lang.String` | `getWeatherTypeFull(int weatherType)`
    `void` | `initializeBySeed(Seed seed)`
    `private void` | `initializeFields()`
    `void` | `setAdjustmentFactor(int adjFactorType, int weatherType, float value)` Sets the adjustment factor for the specified weather type.
    `void` | `setAdjustmentFactors(int adjFactorType, float[] values)` Sets the adjustment factor array for the specified adjustment factor type.
    `private void` | `setAdjustmentFactorsBySeed(Seed seed)`
    `void` | `setAverageDurations(float[] seedDurations)`
    `private void` | `setDefaultCAFs()`
    `private void` | `setDefaultDAFs()`
    `private void` | `setDefaultSAFs(int defaultFFS)`
    `void` | `setMonthActive(int month, boolean active)`
    `void` | `setNearestMetroArea(java.lang.String location)`
    `void` | `setProbability(float[][] seedWeatherProbabilities)`
    `void` | `setSeedDefaultFFS(int seedDefaultFFS)`
    `void` | `setValue(int month, int weatherType, float value)`
    `void` | `setWeatherCAF(int weatherType, float newCAF)` Sets the Capacity Adjustment Factor (CAF) for the specified weather type/severity.
    `void` | `setWeatherCAFArray(float[] newCAFArray)` Sets the array of Capacity Adjustment Factors (CAFs).
    `void` | `setWeatherDAF(int weatherType, float newDAF)` Sets the Demand Adjustment Factor (DAF) for the specified weather type/severity.
    `void` | `setWeatherDAFArray(float[] newDAFArray)` Sets the array of Demand Adjustment Factors (DAFs).
    `void` | `setWeatherSAF(int weatherType, float newSAF)` Sets the Speed Adjustment Factor (SAF) for the specified weather type/severity.
    `void` | `setWeatherSAFArray(float[] newSAFArray)` Sets the array of Speed Adjustment Factors (CAFs).
    `void` | `updateNormalWeather()`
    `private void` | `updateNormalWeather(int month)`
    `void` | `useFacilitySpecific()`
    `void` | `useSeedValues(Seed seed)`

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

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

- - ### Field Detail

    - #### MediumRain

          public static final int MediumRain

      See Also:
        Constant Field Values

    - #### HeavyRain

          public static final int HeavyRain

      See Also:
        Constant Field Values

    - #### LightSnow

          public static final int LightSnow

      See Also:
        Constant Field Values

    - #### LightMediumSnow

          public static final int LightMediumSnow

      See Also:
        Constant Field Values

    - #### MediumHeavySnow

          public static final int MediumHeavySnow

      See Also:
        Constant Field Values

    - #### HeavySnow

          public static final int HeavySnow

      See Also:
        Constant Field Values

    - #### SevereCold

          public static final int SevereCold

      See Also:
        Constant Field Values

    - #### LowVisibility

          public static final int LowVisibility

      See Also:
        Constant Field Values

    - #### VeryLowVisibility

          public static final int VeryLowVisibility

      See Also:
        Constant Field Values

    - #### MinimumVisibility

          public static final int MinimumVisibility

      See Also:
        Constant Field Values

    - #### NormalWeather

          public static final int NormalWeather

      See Also:
        Constant Field Values

    - #### AF_TYPE_CAF

          public static final int AF_TYPE_CAF

      See Also:
        Constant Field Values

    - #### AF_TYPE_DAF

          public static final int AF_TYPE_DAF

      See Also:
        Constant Field Values

    - #### AF_TYPE_SAF

          public static final int AF_TYPE_SAF

      See Also:
        Constant Field Values

    - #### weatherProbability

          private final float[][] weatherProbability

    - #### averageDuration

          private final float[] averageDuration

    - #### weatherCAFs

          private final float[] weatherCAFs

    - #### weatherDAFs

          private final float[] weatherDAFs

    - #### weatherSAFs

          private final float[] weatherSAFs

    - #### defaultCAF

          private final float[] defaultCAF

    - #### seedDefaultFFS

          private int seedDefaultFFS

    - #### monthActive

          private final boolean[] monthActive

    - #### nearestMetroArea

          private java.lang.String nearestMetroArea

  - ### Constructor Detail

    - #### WeatherData

          public WeatherData()

  - ### Method Detail

    - #### initializeBySeed

          public void initializeBySeed(Seed seed)

    - #### useSeedValues

          public void useSeedValues(Seed seed)

    - #### useFacilitySpecific

          public void useFacilitySpecific()

    - #### setAdjustmentFactorsBySeed

          private void setAdjustmentFactorsBySeed(Seed seed)

    - #### getProbability

          public float getProbability(int month,
                                      int weatherType)

      Parameters:
        `month` -
        `weatherType` -
      Returns:

    - #### getProbability

          public float[][] getProbability()

      Returns:

    - #### getProbabilityDecimal

          public float getProbabilityDecimal(int month,
                                             int weatherType)

      Parameters:
        `month` -
        `weatherType` -
      Returns:

    - #### getAverageDurationMinutes

          public float getAverageDurationMinutes(int weatherType)

      Parameters:
        `weatherType` -
      Returns:

    - #### getAverageDurationMinutes

          public float[] getAverageDurationMinutes()

      Returns:

    - #### getAverageDurationHours

          public float getAverageDurationHours(int weatherType)

      Parameters:
        `weatherType` -
      Returns:

    - #### getAvgDurRoundedTo15MinIncrHour

          public float getAvgDurRoundedTo15MinIncrHour(int weatherType)

      Parameters:
        `weatherType` -
      Returns:

    - #### getAvgDurRoundedTo15MinIncrMinute

          public int getAvgDurRoundedTo15MinIncrMinute(int weatherType)

      Parameters:
        `weatherType` -
      Returns:

    - #### getAvgDurRoundedTo15MinIncrNumIncr

          public int getAvgDurRoundedTo15MinIncrNumIncr(int weatherType)

      Parameters:
        `weatherType` -
      Returns:

    - #### getAdjustmentFactor

          public float getAdjustmentFactor(int factorType,
                                           int weatherType)

      Returns the adjustment factor of the specified type for the input weather type/severity.
      Parameters:
        `factorType` - Adjustment factor type identifier (AF_TYPE_CAF, AF_TYPE_DAF, AF_TYPE_SAF).
        `weatherType` - Weather type/severity identifier.
      Returns:
        Adjustment factor

    - #### getAdjustmentFactorArray

          public float[] getAdjustmentFactorArray(int factorType)

      Returns the adjustment factor array of the specified type.
      Parameters:
        `factorType` - Adjustment factor type identifier (AF_TYPE_CAF, AF_TYPE_DAF, AF_TYPE_SAF).
      Returns:
        Adjustment factor array.

    - #### getWeatherCAF

          public float getWeatherCAF(int weatherType)

      Returns the Capacity Adjustment Factor (CAF) for the specified weather type/severity.
      Parameters:
        `weatherType` - Weather event type (also called severity)
      Returns:
        Capacity adjustment factor of weather type.

    - #### getWeatherCAFArray

          public float[] getWeatherCAFArray()

      Returns the array of Capacity Adjustment Factors (CAFs).
      Returns:
        Array of capacity adjustment factors.

    - #### getWeatherDAF

          public float getWeatherDAF(int weatherType)

      Returns the Demand Adjustment Factor (DAF) for the specified weather type/severity.
      Parameters:
        `weatherType` - Weather event type (also called severity)
      Returns:
        Demand adjustment factor of weather type.

    - #### getWeatherDAFArray

          public float[] getWeatherDAFArray()

      Returns the array of Demand Adjustment Factors (DAFs).
      Returns:
        Array of demand adjustment factors.

    - #### getWeatherSAF

          public float getWeatherSAF(int weatherType)

      Returns the Speed Adjustment Factor (SAF) for the specified weather type/severity.
      Parameters:
        `weatherType` - Weather event type (also called severity)
      Returns:
        Speed adjustment factor of weather type.

    - #### getWeatherSAFArray

          public float[] getWeatherSAFArray()

      Returns the array of Speed Adjustment Factors (SAFs).
      Returns:
        Array of speed adjustment factors.

    - #### getMonthActive

          public boolean getMonthActive(int month)

      Parameters:
        `month` -
      Returns:

    - #### getNumWeatherTypes

          public int getNumWeatherTypes()

      Returns:

    - #### getWeatherTypeAbbrev

          public static java.lang.String getWeatherTypeAbbrev(int weatherType)

      Parameters:
        `weatherType` -
      Returns:

    - #### getWeatherTypeFull

          public static java.lang.String getWeatherTypeFull(int weatherType)

      Parameters:
        `weatherType` -
      Returns:

    - #### getNearestMetroArea

          public java.lang.String getNearestMetroArea()

      Returns:

    - #### setSeedDefaultFFS

          public void setSeedDefaultFFS(int seedDefaultFFS)

      Parameters:
        `seedDefaultFFS` -

    - #### setValue

          public void setValue(int month,
                               int weatherType,
                               float value)

      Parameters:
        `month` -
        `weatherType` -
        `value` -

    - #### setProbability

          public void setProbability(float[][] seedWeatherProbabilities)

      Parameters:
        `seedWeatherProbabilities` -

    - #### setAdjustmentFactor

          public void setAdjustmentFactor(int adjFactorType,
                                          int weatherType,
                                          float value)

      Sets the adjustment factor for the specified weather type.
      Parameters:
        `adjFactorType` - Adjustment factor type identifier (AF_TYPE_CAF, AF_TYPE_DAF, AF_TYPE_SAF).
        `weatherType` - Weather type/severity identifier/
        `value` - New adjustment factor value.

    - #### setAdjustmentFactors

          public void setAdjustmentFactors(int adjFactorType,
                                           float[] values)

      Sets the adjustment factor array for the specified adjustment factor type.
      Parameters:
        `adjFactorType` - Adjustment factor type identifier (AF_TYPE_CAF, AF_TYPE_DAF, AF_TYPE_SAF).
        `values` - New adjustment factor array.

    - #### setWeatherCAF

          public void setWeatherCAF(int weatherType,
                                    float newCAF)

      Sets the Capacity Adjustment Factor (CAF) for the specified weather type/severity.
      Parameters:
        `weatherType` - Weather event type (also called severity).
        `newCAF` - New capacity adjustment factor for the weather type/severity.

    - #### setWeatherCAFArray

          public void setWeatherCAFArray(float[] newCAFArray)

      Sets the array of Capacity Adjustment Factors (CAFs).
      Parameters:
        `newCAFArray` -

    - #### setWeatherDAF

          public void setWeatherDAF(int weatherType,
                                    float newDAF)

      Sets the Demand Adjustment Factor (DAF) for the specified weather type/severity.
      Parameters:
        `weatherType` - Weather event type (also called severity).
        `newDAF` - New demand adjustment factor for the weather type/severity.

    - #### setWeatherDAFArray

          public void setWeatherDAFArray(float[] newDAFArray)

      Sets the array of Demand Adjustment Factors (DAFs).
      Parameters:
        `newDAFArray` -

    - #### setWeatherSAF

          public void setWeatherSAF(int weatherType,
                                    float newSAF)

      Sets the Speed Adjustment Factor (SAF) for the specified weather type/severity.
      Parameters:
        `weatherType` - Weather event type (also called severity).
        `newSAF` - New speed adjustment factor for the weather type/severity.

    - #### setWeatherSAFArray

          public void setWeatherSAFArray(float[] newSAFArray)

      Sets the array of Speed Adjustment Factors (CAFs).
      Parameters:
        `newSAFArray` -

    - #### setAverageDurations

          public void setAverageDurations(float[] seedDurations)

      Parameters:
        `seedDurations` -

    - #### setMonthActive

          public void setMonthActive(int month,
                                     boolean active)

      Parameters:
        `month` -
        `active` -

    - #### setNearestMetroArea

          public void setNearestMetroArea(java.lang.String location)

      Parameters:
        `location` -

    - #### initializeFields

          private void initializeFields()

    - #### updateNormalWeather

          private void updateNormalWeather(int month)

    - #### updateNormalWeather

          public void updateNormalWeather()

    - #### extractFromWeatherDB

          public void extractFromWeatherDB(boolean useAgencySpecificDB,
                                           java.lang.String metroAreaName,
                                           CETime startTime,
                                           CETime endTime)

      Parameters:
        `metroAreaName` -
        `startTime` -
        `endTime` -

    - #### setDefaultCAFs

          private void setDefaultCAFs()

    - #### setDefaultSAFs

          private void setDefaultSAFs(int defaultFFS)

    - #### setDefaultDAFs

          private void setDefaultDAFs()

    - #### checkNonNegative

          public boolean checkNonNegative()

      Returns: