quetzal.model.analysismodel module

class quetzal.model.analysismodel.AnalysisModel(*args, **kwargs)[source]

Bases: quetzal.model.summarymodel.SummaryModel

analysis_car_length()[source]
analysis_car_los()[source]
analysis_car_route_type()[source]

Add columns : route_type = ‘car’ and route_types in car_los to allow concatenation with pt_los and use of logit functions.

analysis_car_time(access_time='time')[source]
analysis_checkpoints(link_checkpoints=(), node_checkpoints=(), **loaded_links_and_nodes_kwargs)[source]

tree analysis (arborescences) :param link_checkpoints: mandatory transit links collection (set) :param nodes_checkpoints: mandatory transit nodes :param volume column: column of self.od_stack to assign :loaded_links_and_nodes_kwargs: …

example:

sm.checkpoints(link_checkpoints = {}, node_checkpoints={41})
export.assigned_links_nodes_to_shp(
    sm.checkpoint_links,
    sm.checkpoint_nodes,
    gis_path=gis_path,
    link_name='links_test.shp',
    node_name='nodes_test.shp'

)

analysis_desire(store_shp=False, **to_shp_kwarg)[source]
Builds the desire matrix
  • requires: zones, shares

  • builds: neighborhood, macro_neighborhood

analysis_linear_solver(constrained_links, nb_clusters=20, cluster_column=None, link_path_column='link_path', linprog_kwargs={'bounds_A': [0.75, 1.5], 'bounds_emissions': [0.8, 1.2], 'bounds_tot_emissions': [0.95, 1.05], 'maxiter': 3000, 'pas_distance': 200, 'tolerance': 1e-05}, **kwargs)[source]

To perform the optimization on a model object once it is built and run, in order to match the observed volumes.

  • requires: od_stack, constrained_links

  • builds: aggregated model, pivot_stack_matrix

Le but de linear_solver est de modifier la matrice des volumes par OD en la multipliant par un pivot, afin de coller aux observations recueillies sur certains nœuds/liens du réseau. Etapes: 0. Construction de l’indicatrice (matrice qui indique la présence des

liens contraints dans chaque OD)

  1. Agrégation du modèle.

  2. Résolution du problème d’optimisation linéaire pour construire

    pivot_stack_matrix (matrice pivot). Plus de détails dans linearsolver_utils.

  3. Désagrégation de la matrice pivot pour revenir au modèle de base.

analysis_lines(line_columns='all', group_id='trip_id', *args, **kwargs)[source]
analysis_pr_length()[source]
analysis_pr_time(boarding_time=None)[source]
analysis_pt_fare(keep_intermediate_results=True, consecutive=False, od_fares=True, route_fares=True)[source]
analysis_pt_length(walk_on_road=False)[source]
analysis_pt_los(walk_on_road=False)[source]
analysis_pt_route_type(hierarchy)[source]

Builds ‘route_type’ in pt_los based on ‘route_types’ and hierarchy. Each path in pt_los has an attribute route_types which regroups all the modes used in the path. This functions builds the ‘route_type’ which is the principal mode of the path based on the hierarchy of modes.

Parameters

hierarchy (list) – Hierarchy of the modes found in the route_types. Ex : [‘car’,’rail’, ‘subway’, ‘tram’, ‘bus’, ‘walk’] means that when a path uses rail, tram and walk, the route_type will be defined as ‘rail’ which has the higher hierarchy.

Returns

add columns route_type

Return type

self.pt_los

analysis_pt_time(boarding_time=None, alighting_time=None, walk_on_road=False)[source]
analysis_summary()[source]

To perform on a model object once it is built and run, aggregate and analyses results.

  • requires: shared, zones, loaded_links, od_stack

  • builds: aggregated_shares, lines, economic_series

compute_arod_list()[source]
compute_od_fares()[source]
compute_route_fares(consecutive=False)[source]
compute_transfers_list()[source]
generate_production_attraction_densities(volume_columns=None)[source]
get_lines_with_offset(width=1, trip_id='trip_id')[source]
lighten(keep_summary_columns=False)[source]
lighten_car_los(los_attributes=['car_los'])[source]
lighten_los(keep_summary_columns=False)[source]
lighten_pt_los(los_attributes=['pt_los'])[source]
quetzal.model.analysismodel.read_hdf(filepath)[source]
quetzal.model.analysismodel.read_json(folder, **kwargs)[source]