quetzal.model.analysismodel module
- class quetzal.model.analysismodel.AnalysisModel(*args, **kwargs)[source]
Bases:
quetzal.model.summarymodel.SummaryModel
- 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_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)
Agrégation du modèle.
- Résolution du problème d’optimisation linéaire pour construire
pivot_stack_matrix (matrice pivot). Plus de détails dans linearsolver_utils.
Désagrégation de la matrice pivot pour revenir au modèle de base.
- analysis_pt_fare(keep_intermediate_results=True, consecutive=False, od_fares=True, route_fares=True)[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