Arcades

Class DataLabelled

Base class from which inherit to implement a corpus based data providing strategy.

Inherits from:

Info:
  • InitArgument

    __init argument.

    Todo:
    • Don't mix with dump.
    Fields:
    • environment.BaseEnvironment environment_model
      Environment to which is linked this object
    • number input_time_scale
      Time scale of the corpus timestamps (default 0.001)
    • number output_time_scale
      Time scale of the agent (default 1)
    • number time_coef
      Coefficient used to translate data corpus to agent time scale (optional)
    • string data_path
      Path to the data corpus
  • __init ( args )

    Default constructor.

    Parameters:

Public Methods

keyboard_arrow_up
  • reset ()

    Reset

    Returns:
    • `self`

Private Methods

keyboard_arrow_up
  • _compare_timestamped_data ( i1, i2 )

    Compare timestamped data based on timestamp

    Parameters:
    • i1
      timestamped data 1
    • i2
      timestamped data 2
    Returns:
  • _fill_state ( timestamp, from_current )

    Fill state with values until timestamp.

    Parameters:
    • integer timestamp
      Last value to use to fill the state
    • boolean from_current
      Fill from current state or start with a new one
  • _load_csv_file ( file_path, time_coef )

    Load a corpus from a csv file

    Parameters:
    • string file_path
      Path to the CSV file
    • number time_coef
      Coefficent to apply to timestamp
    Returns:
  • _load_data_dir ( dir_path, time_coef )

    Load data from different CSV file in a directory

    Parameters:
    • string dir_path
      Path to the directory
    • number time_coef
      Coefficent to apply to timestamp
    Returns:
  • _merge_data ( d1, d2 )

    Merge to data corpora checking timestamps consistency.

    Parameters: Returns:
  • _parse_data ( data_path, time_coef )

    Parse plain text files to build a data table.

    Parameters:
    • string data_path
      Path to the data
    • number time_coef
      Coefficent to apply to timestamp
    Returns:
  • _update_state_with_values ( data_index )

    Build state from corpus

    Parameters:
    • data_index