polaris.runs.calibrate.calibration_config.CalibrationConfig#

pydantic model polaris.runs.calibrate.calibration_config.CalibrationConfig#

Bases: BaseModel

Configuration class for the POLARIS calibration procedure.

Calibration in POLARIS occurs by determining a delta from observed counts for key models (activity generation, mode choice, destination choice, timing choice) and using this to adjust the Alternative Specific Constants (ASC) of that model. This is done by modifying the JSON files in the root of the project at specified ‘calibration’ iterations and then allowing the model to stabilise before re-evaluating.

Show JSON schema
{
   "title": "CalibrationConfig",
   "description": "Configuration class for the POLARIS calibration procedure.\n\nCalibration in POLARIS occurs by determining a delta from observed counts for key models (activity generation,\nmode choice, destination choice, timing choice) and using this to adjust the Alternative Specific Constants\n(ASC) of that model. This is done by modifying the JSON files in the root of the project at specified\n'calibration' iterations and then allowing the model to stabilise before re-evaluating.",
   "type": "object",
   "properties": {
      "enabled": {
         "default": false,
         "title": "Enabled",
         "type": "boolean"
      },
      "target_csv_dir": {
         "default": "calibration_targets",
         "format": "path",
         "title": "Target Csv Dir",
         "type": "string"
      },
      "first_calibration_iteration": {
         "default": 1,
         "title": "First Calibration Iteration",
         "type": "integer"
      },
      "calibrate_every_x_iter": {
         "default": 4,
         "title": "Calibrate Every X Iter",
         "type": "integer"
      },
      "last_calibration_iteration": {
         "default": 21,
         "title": "Last Calibration Iteration",
         "type": "integer"
      },
      "calibrate_activities": {
         "default": true,
         "title": "Calibrate Activities",
         "type": "boolean"
      },
      "calibrate_destinations": {
         "default": true,
         "title": "Calibrate Destinations",
         "type": "boolean"
      },
      "calibrate_modes": {
         "default": true,
         "title": "Calibrate Modes",
         "type": "boolean"
      },
      "calibrate_timings": {
         "default": true,
         "title": "Calibrate Timings",
         "type": "boolean"
      },
      "step_size": {
         "default": 2.0,
         "title": "Step Size",
         "type": "number"
      },
      "warm_calibrating": {
         "default": false,
         "title": "Warm Calibrating",
         "type": "boolean"
      }
   }
}

Fields:
field enabled: bool = False#

Flag that defines whether the calibation is used or not in a model run

field target_csv_dir: Path = 'calibration_targets'#

Directory where the calibration target files are located (mode_choice_targets.csv, destination_choice_targets.csv, timing_choice_targets.csv, activity_generation_targets.csv)

field first_calibration_iteration: int = 1#

The first iteration at which ASC adjustment should be undertaken (i.e. start)

field calibrate_every_x_iter: int = 4#

The number of iterations between calibration iterations (i.e. step)

field last_calibration_iteration: int = 21#

Last iteration at which ASC adjustment can take place, note that calibration is not guaranteed to happen at this iteration unless it is specified by the start and step parameters.

field calibrate_activities: bool = True#

Flag that defines if activity generation ASCs are adjusted at each calibration iteration

field calibrate_destinations: bool = True#

Flag that defines if destination choice ASCs (by activity type) are adjusted at each calibration iteration

field calibrate_modes: bool = True#

Flag that defines if mode shares ASCs (by trip purpose) are adjusted at each calibration iteration

field calibrate_timings: bool = True#

Flag that defines if departure time ASCs (by trip purpose) are adjusted at each calibration iteration

field step_size: float = 2.0#

The rate at which the calibrated ASCs are changed during each calibration iteration (e.g., 2 means calibrated values are increased/decreased by 2x the value they should be based on the gap in model outputs and targets)

field warm_calibrating: bool = False#

Flag to run calibration with only planning outputs meaning demand has not been assigned on network and no feedback of travel times for choices is not accounted

normalise_paths()#
should_calibrate(iteration)#