Generate and modify transport demand scenarios via a Python API.
Full Changelog: https://github.com/arup-group/pam/compare/v0.3.0...v0.3.1
TourPlanner
][pam.samplers.tour.TourPlanner] prevents sampling of duplicate destinations, and prevents origin being sampled as a destination ([#231]).pandas.MultiIndex.groupby
, see pandas issue #55256). ([#258])city-modelling-lab
channel ([#211]).TourPlanner
][pam.samplers.tour.TourPlanner] class sequences stops using GreedyTSP algorithm, rather than previous method sorting by distance from depot ([#231]).pip install '.[dev]'
)([#219]).ActivityDuration
class, replaced with methods in [TourPlanner
][pam.samplers.tour.TourPlanner] and in pam.samplers.tour
([#231]).Allows retaining existing facility locations during facility sampling.
By passing population.sample_locs(sampler, location_override=False) , any activities which already have a location (under act.location.loc will be skipped.
This can be of use when applying hybrid location choice approaches, where part of the location choice is done at zone level (+facility sampling), and part is done directly at facility level.
Introduces abstract mode and location choice modules.
The pam.planner.choice class allows the user to apply a choice model for selecting the location of activities and the mode for accessing them, given person characteristics, network conditions and/or zone attraction data. The module is designed to be extendable, supporting different kinds of choice models and sampling approaches.
The typical workflow goes as follows:
choice_model = ChoiceMNL(population, od, zones) # initialize the model and point to the data objects choice_model.configure(u, scope) # configure the model by specifying a utility function and the scope of application. choice_model.apply() # apply the model and update the population with the results. The module design is shown below:
We use the planner.choice.Choice class as a mediator between the population, data, and configuration.
The od object manages origin-destination data, for example travel time and travel distance between each origin and destination, for each travel mode. The zones dataset includes destination attraction data, for example the number of jobs or schools in each likely destination zone. Population is a PAM population (pam.core.Population) object We configure the model by specifying:
Coefficients can be passed either as a number, or as a list, with each element in the list corresponding to one of the modes in the od object.
An example application is presented in this notebook: examples/14_Advanced_Plan_Cropping.ipynb
.
Introduces the PAM planner module.