Difference between revisions of "MATSim"

From TransitWiki
Jump to navigation Jump to search
(Created page with "{{edit queue |editor = Leeor }} {{infobox |title = MATSim |image = matsim-logo.png |vendor = [http://www.matsim.org/about-us MATSim Community] |license = GNU General Public...")
 
(Added the "MATSim Overview" Section)
 
Line 26: Line 26:
 
*Open Source: You get the Java Source Code, which runs on all major operating systems
 
*Open Source: You get the Java Source Code, which runs on all major operating systems
 
*Active Development: The international MATSim community constantly adds new features and improves current ones
 
*Active Development: The international MATSim community constantly adds new features and improves current ones
 +
 +
== MATSim Overview ==
 +
In a single phrase, “MATSim is an activity-based, extendable, multi-agent simulation framework implemented in Java”<ref name=":0">Horni, A., Nagel, K., & Axhausen, K. W. (2016). Chapter 1: Introducing MATSim. In The Multi-Agent Transport Simulation MATSim (pp. 3-8). London: Ubiquity Press. DOI: <nowiki>http://dx.doi.org/10.5334/baw</nowiki></ref>. The software is open-source, and available free of charge from the internet. It is designed to model a 24-hour period, although it is also possible to model longer periods in MATSim. The primary advantage of the program is that it models all agents within the population as individuals, acting to maximize their personal utility. Simulation is performed in iterations, in which agents act to maximize their personal score.
 +
 +
=== Optimization: Co-Evolutionary Algorithm ===
 +
In the MATSim software, a co-evolutionary algorithm, as opposed to an evolutionary algorithm, is used to obtain equilibrium. This process leads to a stochastic user equilibrium<ref name=":0" />, as optimization is performed in terms of an individual scoring function. Alternatively, an evolutionary algorithm would lead to a system optimum, which would not be accurate since individual actors make decisions autonomously. As described in the MATSim documentation, “Every agent repeatedly optimizes their daily activity schedule while in competition for space-time slots with all other agents on the transportation infrastructure. This is somewhat similar to the route assignment iterative cycle, but goes beyond route assignment by incorporating other choice dimensions like time choice, mode choice, or destination choice”<ref name=":0" />. 
 +
 +
=== MATSim Cycle ===
 +
The MATSim cycle (often called the MATSim loop) is shown on the MATSim webpage[https://www.matsim.org/about-matsim]. The cycle requires the input of initial demand data (including population activity chains), which is typically gathered through empirical means such as a population survey. Three stages are traversed in each iteration of the simulation, including execution (through mobsim), scoring, and replanning. A configurable number of iterations are completed, and results are outputted for analysis.
 +
 +
During each iteration, the initial demand values are optimized individually by each agent. Every agent stores a fixed number of daily plans in their memory, which includes a daily activity chain and associated score of economic utility <ref name=":0" />. Prior to simulation, each agent selects one of these plans from memory. A designated portion of agents (typically 10%) is allowed to clone the selected plan and modify it, through a process called replanning. This process includes three steps <ref name=":1">Nagel, K., Kickhofer, B., Horni, A., & Charypar, D. (2016). Chapter 3: A Closer Look at Scoring. In The Multi-Agent Transport Simulation MATSim (pp. 23-33). London: Ubiquity Press. DOI: <nowiki>http://dx.doi.org/10.5334/baw</nowiki>.</ref>:
 +
# Agents with more plans than the maximum number have plans removed according to a plan selector, through the choice set reduction process.
 +
# For the designated portion of agents engaged in replanning, a plan is copied, modified, and selected for the next iteration.
 +
# All other agents choose between their current plans.
 +
Replanning can take place along four dimensions, including departure time (which also influences activity duration), route choice, mode choice, and destination choice. MATSim offers different replanning strategies, which include random mutation, approximate suggestions, or best-response. Random mutation replanning typically involves changes in time of departure or mode used, while best-response includes changes in the chosen route.
 +
 +
Each iteration is completed by evaluating agents’ experiences with their selected plans, through a process called scoring. The simulation is called “mobsim”, a process in which each agent takes one selected plan and executes it in a synthetic reality<ref name=":1" />. The scoring function (described in the next subsection) is applied to each agent to determine their score of economic utility. Plans may originally contain a utility score as an attribute, which is then calculated and stored in the plan after its execution by the mobility simulation<ref>Rieser, M. (2016). Chapter 16: Modeling Public Transport with MATSim. In The Multi-Agent Transport Simulation MATSim (pp. 105-110). London: Ubiquity Press. DOI: <nowiki>http://dx.doi.org/10.5334/baw</nowiki>.</ref>.
 +
 +
This iterative process is repeated until the average score of the population stabilizes, converging to some asymptotic value.
 +
 +
=== Details on the MATSim Scoring Function ===
 +
When agents execute their plans through mobsim, the plans are scored according to their economic utility. Each individual agent learns by maintaining multiple plans, which are scored through execution, then selected according to score and sometimes modified<ref name=":1" />. The scoring function used may be configured along several parameters, or a custom function may be used.
 +
 +
The basic function used is derived from the Charypar-Nagel scoring function, based somewhat on the Vickery model for road congestion. The overall utility of a plan is based on the sum of all activity utilities, plus the sum of all travel disutilities.

Latest revision as of 18:51, 13 December 2019

This page still requires some edits, it has been added to Leeor's edit queue



MATSim
Matsim-logo.png
Vendor MATSim Community
License GNU General Public License
Documentation http://www.matsim.org/docs
Website http://www.matsim.org/



From the MATSim about page:

Agent-Based Transport Simulations

MATSim provides a framework to implement large-scale agent-based transport simulations. The framework consists of severel modules which can be combined or used stand-alone. Modules can be replaced by own implementations to test single aspects of your own work. Currently, MATSim offers a framework for demand-modeling, agent-based mobility-simulation (traffic flow simulation), re-planning, a controler to iteratively run simulations as well as methods to analyze the output generated by the modules.

Key Features of MATSim

  • Fast Dynamic and Agent-Based Traffic Simulation: Simulate whole days within minutes
  • Private and Public Traffic: Both private cars and transit traffic can be simulated
  • Supports Large Scenarios: MATSim can simulate millions of agents or huge, detailed networks
  • Versatile Analyses and Simulation Output: E.g. compare simulated data to real-world counting stations
  • Modular Approach: Easily extended with your own algorithms
  • Open Source: You get the Java Source Code, which runs on all major operating systems
  • Active Development: The international MATSim community constantly adds new features and improves current ones

MATSim Overview

In a single phrase, “MATSim is an activity-based, extendable, multi-agent simulation framework implemented in Java”[1]. The software is open-source, and available free of charge from the internet. It is designed to model a 24-hour period, although it is also possible to model longer periods in MATSim. The primary advantage of the program is that it models all agents within the population as individuals, acting to maximize their personal utility. Simulation is performed in iterations, in which agents act to maximize their personal score.

Optimization: Co-Evolutionary Algorithm

In the MATSim software, a co-evolutionary algorithm, as opposed to an evolutionary algorithm, is used to obtain equilibrium. This process leads to a stochastic user equilibrium[1], as optimization is performed in terms of an individual scoring function. Alternatively, an evolutionary algorithm would lead to a system optimum, which would not be accurate since individual actors make decisions autonomously. As described in the MATSim documentation, “Every agent repeatedly optimizes their daily activity schedule while in competition for space-time slots with all other agents on the transportation infrastructure. This is somewhat similar to the route assignment iterative cycle, but goes beyond route assignment by incorporating other choice dimensions like time choice, mode choice, or destination choice”[1].

MATSim Cycle

The MATSim cycle (often called the MATSim loop) is shown on the MATSim webpage[1]. The cycle requires the input of initial demand data (including population activity chains), which is typically gathered through empirical means such as a population survey. Three stages are traversed in each iteration of the simulation, including execution (through mobsim), scoring, and replanning. A configurable number of iterations are completed, and results are outputted for analysis.

During each iteration, the initial demand values are optimized individually by each agent. Every agent stores a fixed number of daily plans in their memory, which includes a daily activity chain and associated score of economic utility [1]. Prior to simulation, each agent selects one of these plans from memory. A designated portion of agents (typically 10%) is allowed to clone the selected plan and modify it, through a process called replanning. This process includes three steps [2]:

  1. Agents with more plans than the maximum number have plans removed according to a plan selector, through the choice set reduction process.
  2. For the designated portion of agents engaged in replanning, a plan is copied, modified, and selected for the next iteration.
  3. All other agents choose between their current plans.

Replanning can take place along four dimensions, including departure time (which also influences activity duration), route choice, mode choice, and destination choice. MATSim offers different replanning strategies, which include random mutation, approximate suggestions, or best-response. Random mutation replanning typically involves changes in time of departure or mode used, while best-response includes changes in the chosen route.

Each iteration is completed by evaluating agents’ experiences with their selected plans, through a process called scoring. The simulation is called “mobsim”, a process in which each agent takes one selected plan and executes it in a synthetic reality[2]. The scoring function (described in the next subsection) is applied to each agent to determine their score of economic utility. Plans may originally contain a utility score as an attribute, which is then calculated and stored in the plan after its execution by the mobility simulation[3].

This iterative process is repeated until the average score of the population stabilizes, converging to some asymptotic value.

Details on the MATSim Scoring Function

When agents execute their plans through mobsim, the plans are scored according to their economic utility. Each individual agent learns by maintaining multiple plans, which are scored through execution, then selected according to score and sometimes modified[2]. The scoring function used may be configured along several parameters, or a custom function may be used.

The basic function used is derived from the Charypar-Nagel scoring function, based somewhat on the Vickery model for road congestion. The overall utility of a plan is based on the sum of all activity utilities, plus the sum of all travel disutilities.

  1. 1.0 1.1 1.2 1.3 Horni, A., Nagel, K., & Axhausen, K. W. (2016). Chapter 1: Introducing MATSim. In The Multi-Agent Transport Simulation MATSim (pp. 3-8). London: Ubiquity Press. DOI: http://dx.doi.org/10.5334/baw
  2. 2.0 2.1 2.2 Nagel, K., Kickhofer, B., Horni, A., & Charypar, D. (2016). Chapter 3: A Closer Look at Scoring. In The Multi-Agent Transport Simulation MATSim (pp. 23-33). London: Ubiquity Press. DOI: http://dx.doi.org/10.5334/baw.
  3. Rieser, M. (2016). Chapter 16: Modeling Public Transport with MATSim. In The Multi-Agent Transport Simulation MATSim (pp. 105-110). London: Ubiquity Press. DOI: http://dx.doi.org/10.5334/baw.