coreEngine.Helper

## Class CEHelper

- java.lang.Object
- - coreEngine.Helper.CEHelper

-     public class CEHelper
      extends java.lang.Object

  This class contains static methods to create various type of ArrayList or normal array, to sum and average of Array/ArrayList, to compare LOS, and to convert between veh and pc. Only used in coreEngine package.
  Author:
    Shu Liu

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CEHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static float` | `average(java.util.ArrayList<java.lang.Float> array)` Average the array
    `static float` | `average(float[] array)` Average the array
    `static float` | `average(int[] array)` Average the array
    `static boolean[]` | `bool_1D_normal(int length, boolean value)` Create 1D Boolean Array
    `static java.util.ArrayList<java.lang.Boolean>` | `bool_1D(int length, boolean value)` Create 1D Boolean ArrayList
    `static boolean[][]` | `bool_2D_normal(int row, int col, boolean value)` Create 2D Boolean Array
    `static java.util.ArrayList<java.util.ArrayList<java.lang.Boolean>>` | `bool_2D(int row, int col, boolean value)` Create 2D Boolean ArrayList
    `static float[]` | `float_1D_normal(int length, float value)` Create 1D Float Array
    `static java.util.ArrayList<java.lang.Float>` | `float_1D(int length, float value)` Create 1D Float ArrayList
    `static float[][]` | `float_2D_normal(int row, int col, float value)` Create 2D Float Array
    `static java.util.ArrayList<java.util.ArrayList<java.lang.Float>>` | `float_2D(int row, int col, float value)` Create 2D Float ArrayList
    `static int[]` | `int_1D_normal(int length, int value)` Create 1D Integer Array
    `static java.util.ArrayList<java.lang.Integer>` | `int_1D(int length, int value)` Create 1D Integer ArrayList
    `static int[][]` | `int_2D_normal(int row, int col, int value)` Create 2D Integer Array
    `static java.util.ArrayList<java.util.ArrayList<java.lang.Integer>>` | `int_2D(int row, int col, int value)` Create 2D Integer ArrayList
    `static float` | `pc_to_veh(float value, float coe)` Convert pc to veh
    `static java.util.ArrayList<ScenarioInfo>` | `scenInfo_1D(int length)` Create 1D ScenarioInfo ArrayList
    `static java.lang.String[]` | `str_1D_normal(int length, java.lang.String value)` Create 1D String Array
    `static java.util.ArrayList<java.lang.String>` | `str_1D(int length, java.lang.String value)` Create 1D String ArrayList
    `static java.lang.String[][]` | `str_2D_normal(int row, int col, java.lang.String value)` Create 2D String Array
    `static java.util.ArrayList<java.util.ArrayList<java.lang.String>>` | `str_2D(int row, int col, java.lang.String value)` Create 2D String ArrayList
    `static float` | `sum(java.util.ArrayList<java.lang.Float> array)` Sum the array
    `static float` | `sum(float[] array)` Sum the array
    `static int` | `sum(int[] array)` Sum the array
    `static float` | `veh_to_pc(float value, float coe)` Convert veh to pc
    `static java.lang.String` | `worseLOS(java.lang.String LOS1, java.lang.String LOS2)` Compare two level of service

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

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

- - ### Constructor Detail

    - #### CEHelper

          public CEHelper()

  - ### Method Detail

    - #### int_2D

          public static java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> int_2D(int row,
                                                                                           int col,
                                                                                           int value)

      Create 2D Integer ArrayList
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D Integer ArrayList (prefilled with default value)

    - #### float_2D

          public static java.util.ArrayList<java.util.ArrayList<java.lang.Float>> float_2D(int row,
                                                                                           int col,
                                                                                           float value)

      Create 2D Float ArrayList
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D Float ArrayList (prefilled with default value)

    - #### str_2D

          public static java.util.ArrayList<java.util.ArrayList<java.lang.String>> str_2D(int row,
                                                                                          int col,
                                                                                          java.lang.String value)

      Create 2D String ArrayList
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D String ArrayList (prefilled with default value)

    - #### bool_2D

          public static java.util.ArrayList<java.util.ArrayList<java.lang.Boolean>> bool_2D(int row,
                                                                                            int col,
                                                                                            boolean value)

      Create 2D Boolean ArrayList
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D Float ArrayList (prefilled with default value)

    - #### int_1D

          public static java.util.ArrayList<java.lang.Integer> int_1D(int length,
                                                                      int value)

      Create 1D Integer ArrayList
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D Integer ArrayList (prefilled with default value)

    - #### float_1D

          public static java.util.ArrayList<java.lang.Float> float_1D(int length,
                                                                      float value)

      Create 1D Float ArrayList
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D Float ArrayList (prefilled with default value)

    - #### str_1D

          public static java.util.ArrayList<java.lang.String> str_1D(int length,
                                                                     java.lang.String value)

      Create 1D String ArrayList
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D String ArrayList (prefilled with default value)

    - #### bool_1D

          public static java.util.ArrayList<java.lang.Boolean> bool_1D(int length,
                                                                       boolean value)

      Create 1D Boolean ArrayList
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D Float ArrayList (prefilled with default value)

    - #### scenInfo_1D

          public static java.util.ArrayList<ScenarioInfo> scenInfo_1D(int length)

      Create 1D ScenarioInfo ArrayList
      Parameters:
        `length` - length of array
      Returns:
        1D ScenarioInfo ArrayList (prefilled with default ScenarioInfo)

    - #### int_2D_normal

          public static int[][] int_2D_normal(int row,
                                              int col,
                                              int value)

      Create 2D Integer Array
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D Integer Array (prefilled with default value)

    - #### float_2D_normal

          public static float[][] float_2D_normal(int row,
                                                  int col,
                                                  float value)

      Create 2D Float Array
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D Float Array (prefilled with default value)

    - #### str_2D_normal

          public static java.lang.String[][] str_2D_normal(int row,
                                                           int col,
                                                           java.lang.String value)

      Create 2D String Array
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D String Array (prefilled with default value)

    - #### bool_2D_normal

          public static boolean[][] bool_2D_normal(int row,
                                                   int col,
                                                   boolean value)

      Create 2D Boolean Array
      Parameters:
        `row` - number of rows
        `col` - number of columns
        `value` - default value of array
      Returns:
        2D Float Array (prefilled with default value)

    - #### int_1D_normal

          public static int[] int_1D_normal(int length,
                                            int value)

      Create 1D Integer Array
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D Integer Array (prefilled with default value)

    - #### float_1D_normal

          public static float[] float_1D_normal(int length,
                                                float value)

      Create 1D Float Array
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D Float Array (prefilled with default value)

    - #### str_1D_normal

          public static java.lang.String[] str_1D_normal(int length,
                                                         java.lang.String value)

      Create 1D String Array
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D String Array (prefilled with default value)

    - #### bool_1D_normal

          public static boolean[] bool_1D_normal(int length,
                                                 boolean value)

      Create 1D Boolean Array
      Parameters:
        `length` - length of array
        `value` - default value of array
      Returns:
        1D Float Array (prefilled with default value)

    - #### sum

          public static float sum(float[] array)

      Sum the array
      Parameters:
        `array` - data array
      Returns:
        sum of the array

    - #### average

          public static float average(float[] array)

      Average the array
      Parameters:
        `array` - data array
      Returns:
        average of the array

    - #### sum

          public static int sum(int[] array)

      Sum the array
      Parameters:
        `array` - data array
      Returns:
        sum of the array

    - #### average

          public static float average(int[] array)

      Average the array
      Parameters:
        `array` - data array
      Returns:
        average of the array

    - #### sum

          public static float sum(java.util.ArrayList<java.lang.Float> array)

      Sum the array
      Parameters:
        `array` - data array
      Returns:
        sum of the array

    - #### average

          public static float average(java.util.ArrayList<java.lang.Float> array)

      Average the array
      Parameters:
        `array` - data array
      Returns:
        average of the array

    - #### veh_to_pc

          public static float veh_to_pc(float value,
                                        float coe)

      Convert veh to pc
      Parameters:
        `value` - value to be converted
        `coe` - coefficient
      Returns:
        value in pc

    - #### pc_to_veh

          public static float pc_to_veh(float value,
                                        float coe)

      Convert pc to veh
      Parameters:
        `value` - value to be converted
        `coe` - coefficient
      Returns:
        value in veh

    - #### worseLOS

          public static java.lang.String worseLOS(java.lang.String LOS1,
                                                  java.lang.String LOS2)

      Compare two level of service
      Parameters:
        `LOS1` - first level of service
        `LOS2` - second level of service
      Returns:
        worse level of service