Demand

Import Demand

The key steps involved in the demand importer process in EMME, includes;

  1. Building or Importing Demand (build_or_import_demand method) - Determines the type of model (events or frequency) and imports or builds demand matrices accordingly. For timetable models, it imports future timetable matrices if required.
  2. Copying Matrices from Other Schemas (copy_from_other_schema method) - Copies demand and impedance matrices from a base schema for elastic runs. Uses helper functions to build matrix names and copy matrices from other projects.
  3. Getting Matrices to Import (get_matrices_to_import method) - Reads a CSV file to get a list of matrices to import.
  4. Importing Matrices from OMX (import_from_omx method) - Imports matrices stored in an OMX file into EMME. Initialises empty matrices before importing.
  5. Importing Future Timetable Matrices (import_future_timetable_matrices method) - Imports matrices and exports them for timetable assignments. Handles aggregate user groups if required.

Estimate Project Demand (PTM Elastic Process)

  1. calculate_store_project_demand - Key steps include;
    • Initialises matrix names for base and project demand and impedance.
    • Initialises an empty project demand matrix.
    • Converts matrices to numpy arrays for calculations.
    • Caps journey times to a maximum duration stored in the config file.
    • Logs base demand and impedance statistics.
    • Retrieves elastic parameters and base and project fare matrices.
    • Converts impedance matrices to generalised costs and calculates change in demand based on generalised costs. This is shown below;
         base_fare_matrix = emme_modeller.emmebank.matrix(elastic_parameters.base_fare_matrix_name).get_numpy_data()
         proj_fare_matrix = emme_modeller.emmebank.matrix(elastic_parameters.proj_fare_matrix_name).get_numpy_data()
    
         # convert from dollars per hour to dollars per minute
         value_of_time = elastic_parameters.value_of_time_hrs / 60
    
         # convert from impedance matrix to generalised cost
         base_generalised_cost = (base_impedance_mx * value_of_time) + base_fare_matrix
         proj_generalised_cost = (project_impedance_mx * value_of_time) + proj_fare_matrix
    
         # get change in demand
         change_in_demand = (proj_generalised_cost / base_generalised_cost) ** elastic_parameters.elasticity
    
    • Applies change to base demand to get project demand. This is shown below;
        # apply to base demand to achieve project demand
        project_demand = base_demand_mx * change_in_demand
      
    • Logs project demand and impedance statistics.
    • Stores the project demand matrix.
  2. get_elastic_params
    • Retrieves elastic demand parameters from CSV files based on time period and user group codes.
    • Returns an ElasticParameters object with value of time, elasticity, and fare matrix name.