Trip structure analysis of activity plans

For a description of the algorithms see the respective child pages.

Configuring location type for trip structure analysis

The algorithms can use different location attributes of activities as the basis for the trip structure analysis.

An activity can be located at a facility, a link or another type of location. By default, the algorithms described use the facility information as the location information. Sometimes it might be useful to use the link as the location information, e.g. if facilities are not part if the scenario. This can be configured as follows.

<module name="planomat">
    <param name="tripStructureAnalysisLayer" value="link"  />
</module>

 

Feasible mode chain analysis

Description

This plan algorithm is an implementation of Miller et al.'s (2005) individual trip maker mode choice, described in Section 3.2 of that paper. It computes a choice set of feasible trip mode combinations given

  • the subtour structure of a home-based activity plan,
  • the set of modes available to the agent, and
  • the set of chain-based modes, i.e. modes an agent is bound to when chosen for a subtour (default: car, bike). Chain-based modes are opposed to trip-based modes for which no such commitment exists (such as public transport modes or walk). This means, chain-based modes are interpreted of the actual means of transportation the agent owns/has access to (the agent's car, the agent's bike). A boundary condition for the choice set generation is that the chain-based modes must be at home again at the end of the home-based activity plan.

Examples

Consider the following scenario:

  • Activity plan with location sequence A-B-A-C-A, with A being the location identifier of the home activity.
  • Modes available to the agent: car, pt, walk
  • chain-based modes: car

The plan consists of two subtours, each of which might be performed with one of the car. Alternatively, each trip might be performed woth a trip-based mode (walk, pt). The resulting choice set is:

car-car-car-car

car-car-pt-pt
car-car-walk-walk
car-car-walk-pt
car-car-pt-walk

pt-pt-car-car
walk-walk-car-car
walk-pt-car-car
pt-walk-car-car

pt-pt-pt-pt
pt-pt-pt-walk
pt-pt-walk-pt
pt-pt-walk-walk
pt-walk-pt-pt
pt-walk-pt-walk
pt-walk-walk-pt
pt-walk-walk-walk

walk-pt-pt-pt
walk-pt-pt-walk
walk-pt-walk-pt
walk-pt-walk-walk
walk-walk-pt-pt
walk-walk-pt-walk
walk-walk-walk-pt
walk-walk-walk-walk

See also attached Figure 1 from Miller et al. (2005).

Usage in MATSim

  • Configure set of chain-based modes

To do.

  • Usage
Plan plan = ...;
// generate instance of the plan algorithm
MeisterkConfigGroup meisterk = new MeisterkConfigGroup();
PlanAnalyzeTourModeChoiceSet patmcs = new PlanAnalyzeTourModeChoiceSet(meisterk);
// specify and set set of modes available to the agent
EnumSet<BasicLeg.Mode> possibleModes =
EnumSet.of(BasicLeg.Mode.walk, BasicLeg.Mode.bike, BasicLeg.Mode.pt, BasicLeg.Mode.car);
patmcs.setModeSet(possibleModes);
// run algorithm
patmcs.run(plan);
// obtain result: choice set of feasible mode combinations
ArrayList<BasicLeg.Mode[]> actual = patmcs.getResult();

See example usage in the test class: playground.meisterk.org.matsim.population.algorithms.PlanAnalyzeTourModeChoiceSetTest

References

Miller, E. J., M. J. Roorda und J. A. Carrasco (2005) A tour-based model of travel mode choice, Transportation, 32 (4) 399–422.

Subtour indexation

Description

With this algorithm, subtours in activity plans with given activity locations can be identified.

Subtour is defined like the following:

  • A tour is a set of consecutive trips where the origin activity of the first trip and the destination activity of the last trip have the same location.
  • This common location is called anchor point.
  • A tour may consist of several subtours if another tour can be identified within it. Thus a subtour can be defined as a tour within another tour, while its trips not necessarily have to be consecutive.

Examples

  1. Imagine an activity plan with the location sequence A-B-C-A. All trips belong to the same tour with the anchor point A.
  2. Imagine the location sequence A-B-A-B-A. Two subtours exist with the anchor point A. The location sequence A-B-A-C-A has the same subtour structure.
  3. Imagine the location sequence A-B-B-B-B-A. As tours/subtours may consist of a single trip, each trip between the locations B and B constitutes a subtour. Finally the first and the last trip of that location sequence is a subtour with anchor point A.

Usage in MATSim

Each subtour is assigned an index, starting with 0 for the first subtour identified. The algorithm returns a list with n elements, n being the number of trips in the given activity plan, which is the number of activities -1. The results for the above examples are:

  1. 0-0-0
  2. 0-0-1-1
  3. 3-0-1-2-3

The algorithm is of a backtracking type which means that tour-like subtours are identifed first, and thus get the lower indices. This explains the indexation of the last example.

See more examples in the test class: org.matsim.population.algorithms.PlanAnalyzeSubtoursTest

The usage of the subtour indexation is as follows.

Plan plan = ...;
PlanAnalyzeSubtours past = new PlanAnalyzeSubtours();
testee.run(plan);
...
int numSubtours = past.getNumSubtours(); // get the number of subtours
int[] subtourIndexation = past.getSubtourIndexation(); // get the subtour indexation array