coreEngine.Helper.ASCIIAdapter

## Class ASCIISeedFileAdapter_RLFormat

- java.lang.Object
- - coreEngine.Helper.ASCIIAdapter.ASCIISeedFileAdapter_RLFormat

-     public class ASCIISeedFileAdapter_RLFormat
      extends java.lang.Object

  (Deprecated, used for import old format ASCII only) This class import/export a Seed instance from/to an ASCII file using FREEVAL_RL format. The ASCII(text) input file contains seed input data for GP segments, but ML, RL and ATDM are not included.
  Author:
    Tristan Dyer, Shu Liu

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static class` | `ASCIISeedFileAdapter_RLFormat.FieldTypeGen`
    `private static class` | `ASCIISeedFileAdapter_RLFormat.FieldTypeGeo`
    `private static class` | `ASCIISeedFileAdapter_RLFormat.HeaderType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.String` | `CAF_HDR`
    `private static java.lang.String` | `DDAF_HDR`
    `private static java.lang.String` | `delimiters`
    `private static java.lang.String` | `FACILITY_GEOMETRY_HDR`
    `private java.text.DecimalFormat` | `formatter` The output formatter
    `private static java.lang.String` | `GENERAL_HDR`
    `private ASCIISeedFileAdapter_RLFormat.FieldTypeGen[]` | `generalDataOrder`
    `private ASCIISeedFileAdapter_RLFormat.FieldTypeGeo[]` | `geometryDataOrder`
    `private java.util.HashMap<java.lang.String,ASCIISeedFileAdapter_RLFormat.HeaderType>` | `headerMap`
    `private java.util.HashMap<ASCIISeedFileAdapter_RLFormat.HeaderType,java.lang.String>` | `headerMapInverse`
    `private static java.lang.String` | `LATERAL_CLEARANCE_HDR`
    `private static java.lang.String` | `MAINLINE_DEMAND_HDR`
    `private static java.lang.String` | `ODAF_HDR`
    `private ASCIISeedFileAdapter_RLFormat.HeaderType[]` | `outputOrder`
    `private static java.lang.String` | `RAMP_ENTRY_HDR`
    `private static java.lang.String` | `RAMP_EXIT_HDR`
    `private static java.lang.String` | `RAMP_METERING_HDR`
    `private static java.lang.String` | `RAMP_RAMP_HDR`
    `private static java.lang.String` | `RV_CAR_EQ_HDR`
    `private static java.lang.String` | `RV_MAINLINE_HDR`
    `private static java.lang.String` | `RV_OFR_HDR`
    `private static java.lang.String` | `RV_ONR_HDR`
    `private static java.lang.String` | `SAF_HDR`
    `private static java.lang.String` | `STR_ACCEL_DECEL_LENGTH`
    `private static java.lang.String` | `STR_ALPHA`
    `private static java.lang.String` | `STR_ANALYSIS_YEAR`
    `private static java.lang.String` | `STR_END_DAY`
    `private static java.lang.String` | `STR_END_HR`
    `private static java.lang.String` | `STR_END_MIN`
    `private static java.lang.String` | `STR_END_MONTH`
    `private static java.lang.String` | `STR_FFS`
    `private static java.lang.String` | `STR_FFS_KNOWN`
    `private static java.lang.String` | `STR_HEADER_STYLE`
    `private static java.lang.String` | `STR_JAM_DENSITY`
    `private static java.lang.String` | `STR_LANE_WIDTH`
    `private static java.lang.String` | `STR_NUM_LANES_ML`
    `private static java.lang.String` | `STR_NUM_LANES_RAMP`
    `private static java.lang.String` | `STR_NUM_PERIODS`
    `private static java.lang.String` | `STR_NUM_SEGMENTS`
    `private static java.lang.String` | `STR_RAMP_FFS`
    `private static java.lang.String` | `STR_RAMP_METERING`
    `private static java.lang.String` | `STR_RAMP_SIDE`
    `private static java.lang.String` | `STR_SEED_DEMAND_DAY`
    `private static java.lang.String` | `STR_SEED_DEMAND_MONTH`
    `private static java.lang.String` | `STR_SEGMENT_LENGTHS`
    `private static java.lang.String` | `STR_SEGMENT_NUMBER`
    `private static java.lang.String` | `STR_SEGMENT_TYPES`
    `private static java.lang.String` | `STR_START_DAY`
    `private static java.lang.String` | `STR_START_HR`
    `private static java.lang.String` | `STR_START_MIN`
    `private static java.lang.String` | `STR_START_MONTH`
    `private static java.lang.String` | `STR_TERRAIN_CODE`
    `private java.util.HashMap<java.lang.String,ASCIISeedFileAdapter_RLFormat.FieldTypeGen>` | `stringMapGen`
    `private java.util.HashMap<ASCIISeedFileAdapter_RLFormat.FieldTypeGen,java.lang.String>` | `stringMapGenInverse`
    `private java.util.HashMap<java.lang.String,ASCIISeedFileAdapter_RLFormat.FieldTypeGeo>` | `stringMapGeo`
    `private java.util.HashMap<ASCIISeedFileAdapter_RLFormat.FieldTypeGeo,java.lang.String>` | `stringMapGeoInverse`
    `private static java.lang.String` | `TRUCK_CAR_EQ_HDR`
    `private static java.lang.String` | `TRUCK_MAINLINE_HDR`
    `private static java.lang.String` | `TRUCK_OFR_HDR`
    `private static java.lang.String` | `TRUCK_ONR_HDR`
    `private static java.lang.String` | `WEAVE_LCFR_HDR`
    `private static java.lang.String` | `WEAVE_LCRF_HDR`
    `private static java.lang.String` | `WEAVE_LCRR_HDR`
    `private static java.lang.String` | `WEAVE_LS_HDR`
    `private static java.lang.String` | `WEAVE_NW_HDR`
    `private static java.lang.String` | `WEAVE_ONE_SIDED_HDR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ASCIISeedFileAdapter_RLFormat()` Constructor

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `buildMaps()`
    `private void` | `buildOutputOrdering()`
    `private java.lang.String` | `formatValue(float val)`
    `private int` | `getSegmentTypeInt(java.lang.String type)`
    `private java.lang.String` | `getSegmentTypeStr(int type)`
    `Seed` | `importFromFile(java.lang.String newFilePath)` Import a Seed instance from an ASCII file
    `private boolean` | `isSeparatorLine(java.lang.String line)`
    `static void` | `main(java.lang.String[] args)` Unit test for this class
    `private ASCIISeedFileAdapter_RLFormat.FieldTypeGen` | `parseFieldGen(java.lang.String field)`
    `private ASCIISeedFileAdapter_RLFormat.FieldTypeGeo` | `parseFieldGeo(java.lang.String field)`
    `private ASCIISeedFileAdapter_RLFormat.HeaderType` | `parseHeader(java.lang.String header)`
    `private int[]` | `read1DSectionInt(java.io.BufferedReader reader, int numAnalysisPeriods)`
    `private float[][]` | `read2DSectionFloat(java.io.BufferedReader reader, int numSegments, int numAnalysisPeriods)`
    `private int[][]` | `read2DSectionInt(java.io.BufferedReader reader, int numSegments, int numAnalysisPeriods)`
    `private void` | `readFacitiltyGeometry(java.io.BufferedReader reader, Seed seed)`
    `private float` | `readFloat(java.lang.String dat)`
    `private void` | `readGeneralData(java.io.BufferedReader reader, Seed seed)`
    `private int` | `readInt(java.lang.String dat)`

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

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

- - ### Field Detail

    - #### delimiters

          private static final java.lang.String delimiters

      See Also:
        Constant Field Values

    - #### CAF_HDR

          private static final java.lang.String CAF_HDR

      See Also:
        Constant Field Values

    - #### DDAF_HDR

          private static final java.lang.String DDAF_HDR

      See Also:
        Constant Field Values

    - #### FACILITY_GEOMETRY_HDR

          private static final java.lang.String FACILITY_GEOMETRY_HDR

      See Also:
        Constant Field Values

    - #### GENERAL_HDR

          private static final java.lang.String GENERAL_HDR

      See Also:
        Constant Field Values

    - #### LATERAL_CLEARANCE_HDR

          private static final java.lang.String LATERAL_CLEARANCE_HDR

      See Also:
        Constant Field Values

    - #### MAINLINE_DEMAND_HDR

          private static final java.lang.String MAINLINE_DEMAND_HDR

      See Also:
        Constant Field Values

    - #### ODAF_HDR

          private static final java.lang.String ODAF_HDR

      See Also:
        Constant Field Values

    - #### RAMP_ENTRY_HDR

          private static final java.lang.String RAMP_ENTRY_HDR

      See Also:
        Constant Field Values

    - #### RAMP_EXIT_HDR

          private static final java.lang.String RAMP_EXIT_HDR

      See Also:
        Constant Field Values

    - #### RAMP_METERING_HDR

          private static final java.lang.String RAMP_METERING_HDR

      See Also:
        Constant Field Values

    - #### RAMP_RAMP_HDR

          private static final java.lang.String RAMP_RAMP_HDR

      See Also:
        Constant Field Values

    - #### RV_CAR_EQ_HDR

          private static final java.lang.String RV_CAR_EQ_HDR

      See Also:
        Constant Field Values

    - #### RV_MAINLINE_HDR

          private static final java.lang.String RV_MAINLINE_HDR

      See Also:
        Constant Field Values

    - #### RV_OFR_HDR

          private static final java.lang.String RV_OFR_HDR

      See Also:
        Constant Field Values

    - #### RV_ONR_HDR

          private static final java.lang.String RV_ONR_HDR

      See Also:
        Constant Field Values

    - #### SAF_HDR

          private static final java.lang.String SAF_HDR

      See Also:
        Constant Field Values

    - #### TRUCK_CAR_EQ_HDR

          private static final java.lang.String TRUCK_CAR_EQ_HDR

      See Also:
        Constant Field Values

    - #### TRUCK_MAINLINE_HDR

          private static final java.lang.String TRUCK_MAINLINE_HDR

      See Also:
        Constant Field Values

    - #### TRUCK_OFR_HDR

          private static final java.lang.String TRUCK_OFR_HDR

      See Also:
        Constant Field Values

    - #### TRUCK_ONR_HDR

          private static final java.lang.String TRUCK_ONR_HDR

      See Also:
        Constant Field Values

    - #### WEAVE_LS_HDR

          private static final java.lang.String WEAVE_LS_HDR

      See Also:
        Constant Field Values

    - #### WEAVE_LCRF_HDR

          private static final java.lang.String WEAVE_LCRF_HDR

      See Also:
        Constant Field Values

    - #### WEAVE_LCFR_HDR

          private static final java.lang.String WEAVE_LCFR_HDR

      See Also:
        Constant Field Values

    - #### WEAVE_LCRR_HDR

          private static final java.lang.String WEAVE_LCRR_HDR

      See Also:
        Constant Field Values

    - #### WEAVE_NW_HDR

          private static final java.lang.String WEAVE_NW_HDR

      See Also:
        Constant Field Values

    - #### WEAVE_ONE_SIDED_HDR

          private static final java.lang.String WEAVE_ONE_SIDED_HDR

      See Also:
        Constant Field Values

    - #### STR_ALPHA

          private static final java.lang.String STR_ALPHA

      See Also:
        Constant Field Values

    - #### STR_ANALYSIS_YEAR

          private static final java.lang.String STR_ANALYSIS_YEAR

      See Also:
        Constant Field Values

    - #### STR_END_DAY

          private static final java.lang.String STR_END_DAY

      See Also:
        Constant Field Values

    - #### STR_END_HR

          private static final java.lang.String STR_END_HR

      See Also:
        Constant Field Values

    - #### STR_END_MIN

          private static final java.lang.String STR_END_MIN

      See Also:
        Constant Field Values

    - #### STR_END_MONTH

          private static final java.lang.String STR_END_MONTH

      See Also:
        Constant Field Values

    - #### STR_FFS_KNOWN

          private static final java.lang.String STR_FFS_KNOWN

      See Also:
        Constant Field Values

    - #### STR_JAM_DENSITY

          private static final java.lang.String STR_JAM_DENSITY

      See Also:
        Constant Field Values

    - #### STR_NUM_PERIODS

          private static final java.lang.String STR_NUM_PERIODS

      See Also:
        Constant Field Values

    - #### STR_NUM_SEGMENTS

          private static final java.lang.String STR_NUM_SEGMENTS

      See Also:
        Constant Field Values

    - #### STR_RAMP_METERING

          private static final java.lang.String STR_RAMP_METERING

      See Also:
        Constant Field Values

    - #### STR_SEED_DEMAND_DAY

          private static final java.lang.String STR_SEED_DEMAND_DAY

      See Also:
        Constant Field Values

    - #### STR_SEED_DEMAND_MONTH

          private static final java.lang.String STR_SEED_DEMAND_MONTH

      See Also:
        Constant Field Values

    - #### STR_START_DAY

          private static final java.lang.String STR_START_DAY

      See Also:
        Constant Field Values

    - #### STR_START_HR

          private static final java.lang.String STR_START_HR

      See Also:
        Constant Field Values

    - #### STR_START_MIN

          private static final java.lang.String STR_START_MIN

      See Also:
        Constant Field Values

    - #### STR_START_MONTH

          private static final java.lang.String STR_START_MONTH

      See Also:
        Constant Field Values

    - #### STR_TERRAIN_CODE

          private static final java.lang.String STR_TERRAIN_CODE

      See Also:
        Constant Field Values

    - #### STR_ACCEL_DECEL_LENGTH

          private static final java.lang.String STR_ACCEL_DECEL_LENGTH

      See Also:
        Constant Field Values

    - #### STR_FFS

          private static final java.lang.String STR_FFS

      See Also:
        Constant Field Values

    - #### STR_LANE_WIDTH

          private static final java.lang.String STR_LANE_WIDTH

      See Also:
        Constant Field Values

    - #### STR_NUM_LANES_ML

          private static final java.lang.String STR_NUM_LANES_ML

      See Also:
        Constant Field Values

    - #### STR_NUM_LANES_RAMP

          private static final java.lang.String STR_NUM_LANES_RAMP

      See Also:
        Constant Field Values

    - #### STR_RAMP_FFS

          private static final java.lang.String STR_RAMP_FFS

      See Also:
        Constant Field Values

    - #### STR_RAMP_SIDE

          private static final java.lang.String STR_RAMP_SIDE

      See Also:
        Constant Field Values

    - #### STR_SEGMENT_LENGTHS

          private static final java.lang.String STR_SEGMENT_LENGTHS

      See Also:
        Constant Field Values

    - #### STR_SEGMENT_NUMBER

          private static final java.lang.String STR_SEGMENT_NUMBER

      See Also:
        Constant Field Values

    - #### STR_SEGMENT_TYPES

          private static final java.lang.String STR_SEGMENT_TYPES

      See Also:
        Constant Field Values

    - #### STR_HEADER_STYLE

          private static final java.lang.String STR_HEADER_STYLE

      See Also:
        Constant Field Values

    - #### headerMap

          private java.util.HashMap<java.lang.String,ASCIISeedFileAdapter_RLFormat.HeaderType> headerMap

    - #### headerMapInverse

          private java.util.HashMap<ASCIISeedFileAdapter_RLFormat.HeaderType,java.lang.String> headerMapInverse

    - #### stringMapGen

          private java.util.HashMap<java.lang.String,ASCIISeedFileAdapter_RLFormat.FieldTypeGen> stringMapGen

    - #### stringMapGenInverse

          private java.util.HashMap<ASCIISeedFileAdapter_RLFormat.FieldTypeGen,java.lang.String> stringMapGenInverse

    - #### stringMapGeo

          private java.util.HashMap<java.lang.String,ASCIISeedFileAdapter_RLFormat.FieldTypeGeo> stringMapGeo

    - #### stringMapGeoInverse

          private java.util.HashMap<ASCIISeedFileAdapter_RLFormat.FieldTypeGeo,java.lang.String> stringMapGeoInverse

    - #### outputOrder

          private ASCIISeedFileAdapter_RLFormat.HeaderType[] outputOrder

    - #### generalDataOrder

          private ASCIISeedFileAdapter_RLFormat.FieldTypeGen[] generalDataOrder

    - #### geometryDataOrder

          private ASCIISeedFileAdapter_RLFormat.FieldTypeGeo[] geometryDataOrder

    - #### formatter

          private final java.text.DecimalFormat formatter

      The output formatter

  - ### Constructor Detail

    - #### ASCIISeedFileAdapter_RLFormat

          public ASCIISeedFileAdapter_RLFormat()

      Constructor

  - ### Method Detail

    - #### importFromFile

          public Seed importFromFile(java.lang.String newFilePath)

      Import a Seed instance from an ASCII file
      Parameters:
        `newFilePath` - path of the ASCII file
      Returns:
        a Seed instance

    - #### readGeneralData

          private void readGeneralData(java.io.BufferedReader reader,
                                       Seed seed)

    - #### readFacitiltyGeometry

          private void readFacitiltyGeometry(java.io.BufferedReader reader,
                                             Seed seed)

    - #### readInt

          private int readInt(java.lang.String dat)

    - #### readFloat

          private float readFloat(java.lang.String dat)

    - #### read1DSectionInt

          private int[] read1DSectionInt(java.io.BufferedReader reader,
                                         int numAnalysisPeriods)

    - #### read2DSectionInt

          private int[][] read2DSectionInt(java.io.BufferedReader reader,
                                           int numSegments,
                                           int numAnalysisPeriods)

    - #### read2DSectionFloat

          private float[][] read2DSectionFloat(java.io.BufferedReader reader,
                                               int numSegments,
                                               int numAnalysisPeriods)

    - #### parseHeader

          private ASCIISeedFileAdapter_RLFormat.HeaderType parseHeader(java.lang.String header)

    - #### parseFieldGen

          private ASCIISeedFileAdapter_RLFormat.FieldTypeGen parseFieldGen(java.lang.String field)

    - #### parseFieldGeo

          private ASCIISeedFileAdapter_RLFormat.FieldTypeGeo parseFieldGeo(java.lang.String field)

    - #### isSeparatorLine

          private boolean isSeparatorLine(java.lang.String line)

    - #### getSegmentTypeInt

          private int getSegmentTypeInt(java.lang.String type)

    - #### getSegmentTypeStr

          private java.lang.String getSegmentTypeStr(int type)

    - #### formatValue

          private java.lang.String formatValue(float val)

    - #### buildMaps

          private void buildMaps()

    - #### buildOutputOrdering

          private void buildOutputOrdering()

    - #### main

          public static void main(java.lang.String[] args)

      Unit test for this class
      Parameters:
        `args` - command line arguments (not in use)