feat: a new scenario cutter without mode choice limitations#251
Merged
Conversation
added 11 commits
August 28, 2024 17:10
…le through static attributes
This was referenced May 7, 2025
And128
pushed a commit
to And128/eqasim-java
that referenced
this pull request
Oct 10, 2025
…rg#251) * feat: ability to skip routing during RunScenarioCutter * chore: required and optional args of scenario cutter are now accessible through static attributes * feat: RunScenarioCutterV2 * chore: Testing the RunScenarioCutterV2 functionality with a DRT service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduction
The existing
RunScenarioCutterallows to focus on one small area of a large simulation by considering only the agents that travel in that area at some point during the simulation. The road network, the transit schedule as well as the plans of the concerned agents are 'cut' inside this area.outsideactivities are inserted in the agent plans when they enter or leave the area, and the whole activity sub-chains that take place outside are replaced with trips using the modeoutside. This functionality allows, for instance, to study DRT systems on a small scale and perform fleet sizing simulations that take much less time than simulations of the whole area.However, one limitiation of the the current functionalitty is the restriction introduced on the mode choice. To keep plans that are coherent on the global level, tours with an outside activity are not considered by the DMC model. In some cases, these can represent a large proportion of the overall tours. Which prevents from fully assessing the impact that a new service would have.
Functionality
In this PR, we trade this limitation against another one. We propose an approach that does not restrict the mode choice model but rather assume that the travel times outside the study area are not impacted by the new services that will be added later on.
The
RunScenarioCutterV2does not exactly cut the network, the transit schedule or the plans. Rather, the population is filtered to keep only the persons that travel in the study area, the same ones that would be left by the old functionality, with the difference that the plans remain intact. A first run of the overall simulation is required beforehand as the converged travel times need to be measured before being fixed outside the area of interest. In this version, we require the input config and the original simulation to use the VDF functionality available in Eqasim.The resulting scenario will the same network and transit schedule, have a smaller population and a DMC model configuration that considers all tours. So a simulation of it will take longer than a simulation of a scenario resulting form the base cutter, but still faster than the original simulation.
Technical implementation
The tool, available in the
org.eqasim.core.scenario.cutter.RunPopulationCutterV2, requires the following arguments, most of the arguments supported are also supported byRunPopulationCutterwith the same meaning, these will not be elaborated further here:.--vdf-travel-times-path(required): A binary file, namedvdf.binby default, written by Eqasim and containing the travel times observed by the VDF module. The travel times recorded in this file will be the input of the VDF module in the resulting scenario for the first iteration. Moreover, the VDF module will be configured to update only the travel times that are inside the study area. For the rest of the network, the travel times recorded in this file will be used during the whle simulation.--flag-area-link-modes(optional): true or false. If true, the tool will tag the links inside the study area by adding allowed modes that are the same as the pre-existing ones prefixed withinside_. However, the subnetworks consisting of each of the new modes are cleaned to make sure they are fully connected (So not every link inside the study area will end up withinside_...modes).A simple approach was adopted for the code implementation of this functionality. We basically call the exisitng
RunScenarioCutterand then we process the original population and remove all persons with an ID that does not appear in the scenario resulting from the first cutter. This takes more time than necessary as the network, transit schedule and plans are processed whereas we only need to know which agents are in the area at some point during the day. Future works will simplify the code to speed-up the tool.Unit test
This functionality is tested during the
TestSimulationPipeline.testPipelineunit test. The cutter is executed on the output of a simulation using the VDF functionality. Then, a DRT simulations is performed with a service active only in the cut-out area. We make use of the flag modes added by the cutter to have a smaller DvrpTravelTime matrix.First results
We tested this functionality on a simulation of ile-de-france, focusing on the area of Dourdan in the south of Paris, and simulating an intermodal DRT system enabled by the
feederDrtmodule available in Eqasim. We compare the simulations of the whole Ile-de-France area with the whole population (with the intermodal DRT system available only in Dourdan), the simulation of the scenario resulting from the existingRunScenarioCutter, and the simulation resulting from the cutter proposed here. We measure the run times and the number of requests generated by the DMC model in each simulation.The results show that this cutter is able to identify a demand close to the one that would be identified by a full simulation while still requiring much less time as shown in the table and figure below.
Conclusion
This work is described in more details in a paper submitted for presentation at TRB2025 (Chouaki, T., Hörl, S. (2025) A method for efficiently assessing the impact of local mobility services in large-scale agent-based simulations).
In the following months, the code will be reworked and the process simplified as explained above. Moreover, further benchmarks of this functionality will be performed in the next months. A proper documentation on how to use it will also be written.