Giter VIP home page Giter VIP logo

matsim-maas's Introduction

100,000 robo-taxis driving in Berlin (10% sample)

MATSim โ€“ Mobility as a Service

Build Status

This project contains a collection of examples to simulate Mobility as a Service (MaaS) and Mobility on Demand (MoD) in MATSim. All services may be simulated with a driver or using Autonomous Vehicles (AVs). The basic framework for these services are the Dynamic Vehicle Routing Problem (DVRP), Autonomous Vehicles, Taxi and Demand Responsive Transport (DRT) extensions. This means, vehicles will be dispatched on-line while the MATSim Mobility Simulation is running.

Integration of DVRP into MATSim

The main goal of the code in this repository is to provide examples of different usage scenarios for MaaS / AV services and make them easy to access in one single place, while the actual optimizer code remains in the MATSim contributions. All the examples run on the current MATSim Snapshot, as there are continuous improvement to the functionality.

Functionality

The following extensions might be of particular interest:

Taxi

The centralized dispatched of Taxi services may be simulated using different algorithms, which may be set in the Config file. An overview of different Taxi dispatch strategies and their performance is provided in:

M. Maciejewski; J. Bischoff, & K. Nagel An Assignment-Based Approach to Efficient Real-Time City-Scale Taxi Dispatching, IEEE Intelligent Systems, 2016, 31, 68-77 Available here

Robotaxi / Shared Autonomous Vehicles

Shared Autonomous Vehicles provide the capability to simulate large fleets of automated taxi vehicles. This is done by combining a fast, rule-based dispatch algorithm with the possibility to adjust the consumed road capacity of Autonomous Vehicles.

The algorithm and results are presented in J. Bischoff, M. Maciejewski Simulation of city-wide replacement of private cars with autonomous taxis in Berlin, Procedia Computer Science, 2016, 83, https://doi.org/10.1016/j.procs.2016.04.121

The effects of different road capacity use are described in M. Maciejewski, J. Bischoff Congestion Effects of Autonomous Taxi Fleets; Transport, 2017, 0, 1-10, Full text available here

Demand Responsive Transport (DRT)

Demand Responsive Transport allows the pooling of several passengers into a single vehicle. Several constraints, such as maximum travel times and maximum waiting times, can be taken into account when organizing the vehicle dispatch. Please find a full documentation here.

Autonomous Vehicles

All MaaS extensions may be simulated with and without drivers. Arguably, the biggest influence of AV operations are road capacity and pricing.

  • Road capacity can be influenced using the AVCapacityModule
  • Pricing of MaaS modes can be influenced using Standard MATSim scoring parameters.

Common infrastructure

With DVRP being the common base to all the modules described here, there is some common infrastructure all of the MaaS modules share:

  • The DVRP config group. In this, both the Leg mode of an agent using MaaS can be defined (such as "taxi") as well as the network mode vehicles are using (such as "car"). Furthermore, the on-line Travel Time Calculator can be adapted, if required.
  • The Vehicles Container. This is a file containing information about the fleet used by any MaaS extension. Fleet vehicle files can be created using the CreateFleetVehicles script.

Test scenarios

The scenarios folder contains several test scenarios. These are roughly derived from existing MATSim scenarios, but often depict only the excerpt with relevance to MaaS of the scenario.

How to use

  1. Check out this project using your favorite git client or just download as a zip. As for the latter, you can download:

    • the development version, which is running using the latest MATSim development snapshot
    • one of the releases, which is running using the official MATSim releases Using the latest is release will give you relatively stable results, whereas using the master will provide more features, though some of them not thoroughly tested.
  2. Import the folder as a new Maven project to Eclipse (Import --> Maven --> Existing project) or intelliJ (New --> Module from existing sources --> Select the folder --> Maven)

  3. Run the example classes and start editing them according to your taste. You can also run RunMaasGui to launch a simple GUI application for running MaaS simulations.

matsim-maas's People

Contributors

dependabot[bot] avatar haowuintub avatar janekdererste avatar jfbischoff avatar kainagel avatar luchengqi7 avatar michalmac avatar michaz avatar mrieser avatar tschlenther avatar vsp-gleich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matsim-maas's Issues

Implement charging points for electric autonomous vehicles

Hello. Can you please help me to find out how I can Implement charging points for electric autonomous vehicles(also number of charging plugs in each station) and also schedule fleet vehicles according to their remaining charge status?

how differentiate driverless and human-driven door-to-door scenario?

Hello. I have a question about the basic concepts and configuration parameters for the effect of human-driven and driverless vehicle in door-to-door scenario, would you please help to figure that out? (in fact if I want to run the same scenario once driverless and one with human-driven vehicle, how should I modify the config file and which parameters affect these?)
Thank you in advance.
@michalmac @jfbischoff

Is DVRP executed in synchronous way with the simulation?

Hi

I am beginning with the DVRP extension, and i want to know whether the methods of VrpOptimizer like requestSunmitted are executed synchronously with the simulation i.e. the simulation is stopped when these methods are called.

I appreciate any help and thanks a lot.

drt for multi-modal scenario

I am trying to extend my base scenario (routed car and pt, teleported walk and bike) to incorporate drt. So far I am working from the RunDoor2DoorDrtExample, but I am crashing on:

Supported for only 1 DRT mode in the config. Number of DRT modes: 0

As far as I can tell this might be related to the DvrpConfigGroup class for createControlerWithSingleModeDrt which does not seem compatible for multiple modes. I have also seen the MultiModeDrtConfigGroup, but this class does not have it's own controller creator.

Could you point me in the right direction in regarding to incorporating the drt extension into my model, considering all other modes should be able to switch to drt using their ChangeTripMode strategy?

Thanks in advance

Log.txt

DRT Service Area

Are there options/approaches available to implement a DRT service area, wherein only trips beginning and ending within the service area are accepted?

illogical result of the total kilometers driven by the vehicles

Hello. I have done multiple simulations for my scenario. At my base scenario I had 20000 persons using private cars and in total they drove 350,000 kilometers. Then I replaced the private cars with a DRT fleet of 1250 vehicles and tried different scenarios and as example I got the following results:

First simulation:
maxTravelTimeAlpha=1.25
maxTravelTimeBeta=1200
maxWaitTime=600
TimeAllocationMutator strategy with weight of 0.1
relocation of idle vehicles is on
and my total driven kilometers became 500,00km(km per vehicle 400km) and rejection rate of 1.61%
total travel times 23136 hours
total waiting times 4612 hours

Second simulation:
maxTravelTimeAlpha=1.5
maxTravelTimeBeta=1200
maxWaitTime=600
TimeAllocationMutator strategy with weight of 0.1
relocation of idle vehicles is on
and my total driven kilometers became 540,00km(km per vehicle 440km) and rejection rate of 0.93%
total travel times 24881 hours
total waiting times 4763 hours

Now my doubt is about the total kilometers driven by the vehicles, in general should it increase after substituting private car with DRT system?
And also why after increasing maxTravelTimeAlpha total kilometers is increased?(what is the logic behind that)
Are my results true or maybe I did some mistakes?

DRT extension only allows 1 thread for the qsim module?

I'm getting an exception when I'm trying to increase the number of threads for qsim in my simulations. My question is that if DRT only allows 1 thread or there is any config parameter that enables to increase number of threads for qsim?
(increasing number of threads for the other modules is working).

exception:

Exception in thread "main" java.lang.RuntimeException: Only a single-threaded QSim allowed
	at org.matsim.contrib.drt.run.DrtConfigConsistencyChecker.checkConsistency(DrtConfigConsistencyChecker.java:54)
	at org.matsim.core.config.Config.checkConsistency(Config.java:228)
	at org.matsim.contrib.drt.run.DrtControlerCreator.createControlerWithSingleModeDrt(DrtControlerCreator.java:92)
	at org.matsim.contrib.drt.run.DrtControlerCreator.createControlerWithSingleModeDrt(DrtControlerCreator.java:72)
	at org.matsim.maas.drt.RunDRT.run(RunDRT.java:59)
	at org.matsim.maas.drt.RunDRT.main(RunDRT.java:74)

Question about multi modal simulation

Hello,
Can you please instruct me how to run a multimodal scenario consisting of car,bike, pt and drt(either stop based or door to door)?
Thank you in advance!

org.matsim.run.gui does not exist

Hi, when I was trying to run the massgui, it shows an error pointing to the line:
import org.matsim.run.gui.Gui;
Could I know where the problem is? Thank you!

How to make sav cruising

I want to move my SAV to an area with high demand when there are no requests.
How do I change the configuration file?

Error in running MATSim-MAAS example

Hello,
I am trying to replicate the MATSim-MAAS example as you have shared using COTTBUS and MIELEC data. I am using the matsim-maas-12.0-SNAPSHOT-jar-with-dependencies.jar file which is part of the example to run the scenario. However, except the MIELEC_drt other scenarios are not running. Below is the exception I receive

`

> 2020-07-20T08:40:00,444  WARN PlanCalcScoreConfigGroup:193 activityType_0 is deprecated config syntax; please use the more modern hierarchical format; your output_config.xml will be in the correct version; the old version will fail eventually, since we want to reduce the workload on this backwards compatibility (look into PlanCalcScoreConfigGroup or PlanCalcRouteConfigGroup if you want to know what we mean).
> 2020-07-20T08:40:00,447  WARN PlanCalcScoreConfigGroup:207 activityTypicalDuration_0 is deprecated config syntax; please use the more modern hierarchical format; your output_config.xml will be in the correct version; the old version will fail eventually, since we want to reduce the workload on this backwards compatibility (look into PlanCalcScoreConfigGroup or PlanCalcRouteConfigGroup if you want to know what we mean).
> 2020-07-20T08:40:00,449  WARN PlanCalcScoreConfigGroup:242 traveling_taxi is deprecated config syntax; please use the more modern hierarchical format; your output_config.xml will be in the correct version; the old version will fail eventually, since we want to reduce the workload on this backwards compatibility (look into PlanCalcScoreConfigGroup or PlanCalcRouteConfigGroup if you want to know what we mean).
> Exception in thread "main" java.lang.IllegalArgumentException: Supported for only 1 DRT mode in the config. Number of DRT modes: 0
> 	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:190)
> 	at org.matsim.contrib.drt.run.DrtConfigGroup.getSingleModeDrtConfig(DrtConfigGroup.java:56)
> 	at org.matsim.contrib.drt.run.DrtControlerCreator.createControlerWithSingleModeDrt(DrtControlerCreator.java:63)
> 	at org.matsim.maas.drt.RunDRTClass.run(RunDRTClass.java:40)
> 	at org.matsim.maas.drt.RunDRTClass.main(RunDRTClass.java:55)
> 
> The simulation did not run properly. Error/Exit code: 1

`

I do not understand what changes is needed on the config file to make it run. Any help would be appreciated.

Interpreting drt_walk

In my current simulation I have successfully established a DRT service area and implemented a max drt walk to stop unrealistic trips that do not start/end in the service area.

However, I still have a very high number of drt_walk trips that seem to be essentially replacing what would otherwise be normal walk trips outside of the drt service area.

I'm wondering how to interpret these: are these agents who made a request for drt, but that request was rejected because they were outside the service area (by at least max drt walk distance), so they made a walk trip but it is called drt_walk?

This creates a problem for the way my event handling functions as I can't easily separate times when drt_walk was access/egress from a drt trip, and a purely "walk" trip.

Should I try setting the mode specific constant for drt_walk slightly more negative than normal walk (which it looks to inherit by default), or is there another way to essentially force these pure "walk" trips that are being labeled drt_walk out?

Error in DvrpModeRoutingModule

Hi,
I am trying to adjust the cottbus/robotaxi scenario for my own studies. To start with, I want to try to run 10 robotaxies on the "roundabout" network.

I have uploaded my modified files RunRoboRoundabout.java, inputNetworkFile, inputPlansFile, taxisFile and config.xml.
See also the complete error log.
All files on GoogleDrive.

Both the original roundabout and robotaxi scenarios run without errors.
However, when I try to combine them, i get the following error:

2023-04-28T12:02:48,611  INFO SpeedyALTData:51 find dead ends...
2023-04-28T12:02:48,612  INFO SpeedyALTData:132 calculate landmarks...
2023-04-28T12:02:48,618 ERROR MatsimRuntimeModifications:75 Getting uncaught Exception in Thread main
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/ErrorInCustomProvider]: ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 8
  at AbstractModalModule.bindModal(AbstractModalModule.java:59)
      \_ installed by: Modules$CombinedModule -> Modules$CombinedModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> MultiModeTaxiModule -> TaxiModeModule -> DvrpModeRoutingModule
  while locating DefaultMainLegRouter$RouteCreator annotated with @DvrpMode(value=taxi)
  at DvrpModeRoutingModule.install(DvrpModeRoutingModule.java:51)
      \_ installed by: Modules$CombinedModule -> Modules$CombinedModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> MultiModeTaxiModule -> TaxiModeModule -> DvrpModeRoutingModule
  while locating RoutingModule annotated with @Element(setName=@DvrpMode(value=taxi),uniqueId=158, type=MAPBINDER, keyType=DvrpRoutingModuleProvider$Stage)
  while locating Map<DvrpRoutingModuleProvider$Stage, RoutingModule> annotated with @DvrpMode(value=taxi)
  at DvrpModeRoutingModule.install(DvrpModeRoutingModule.java:49)
      \_ installed by: Modules$CombinedModule -> Modules$CombinedModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> AbstractModule$4 -> Modules$OverrideModule -> MultiModeTaxiModule -> TaxiModeModule -> DvrpModeRoutingModule
  while locating RoutingModule annotated with @Named("taxi")
  while locating RoutingModule annotated with @Element(setName=,uniqueId=178, type=MAPBINDER, keyType=String)
  at TripRouter.<init>(TripRouter.java:104)
  while locating TripRouter

I tried

  • different java versions (11 and 17),
  • different matsim-maas versions (the current codebase from github and the MATSim-MaaS 12.0 release from Oct.14, 2020),
  • Double checked plans, network and vehicle definition files for structural mismatch,
  • tried to give a different routing algorithm to the controler (Dijkstra instead of A*Landmarks, but I do not think this is forwarded to dvrp?),
  • finding similar issues on github.

Any hints what I am doing wrong, or how I can further debug this problem?

event handling for drt wait times

My current event handler was designed around a scenario prior to added drt. It of course captures drt-relevant information through the various Activity-Person-Vehicle event handlers it implements.

But there is one metric I am looking for which I currently to not get: wait time.

I get pt wait times through the AgentWaitingForPtEventHandler, but I'm wondering if there something similar for drt? My goal is to get wait times on an agent-level so more detailed than what is provided in the drt_customer_stats_drt.csv output.

Thanks in advance!

Implementing private cars and compare with drt scenario

Hello. I have built my drt scenario and now I want to run the same simulation but considering private cars instead of drt, which matsim project/scenario should I use for this purpose? (is it possible to use "matsim-maas" to run the simulation only with private cars or I should use e.g. "matsim-example-project"?)

Trying to understand walk-legs within taxi and drtdoor2door trips

Hi,

first off, thank you for sharing your work on this maas extension.

While running your demo scenarios (taxi/drtdoor2door/drtstopbased) I found that both taxi and drtdoor2door trips have walk legs which don't really makes sense to me since start and end link are exactly the same and waiting time for the vehicles is included in the taxi/drt leg.

While I do understand that agents still have to get outside their home to get to the street to be able to be picked-up and have to get to their facility once dropped of by the taxi, these walking times seem oddly large (see screenshot of sample agent)

Screenshot 2021-11-17 115718

Is there any explanation for this?

Error trying to build and run examples in mass/drt

Hi all.
I've downloaded the 'matsim-maas' librariy and have tried to run it, but I can't seems to manage to compile it.
With maven's command line tool, I can build this library (with mvn install clean), but running one of the examples (mvn exec:java -Dexec.mainClass="org.matsim.maas.drt.RunStopbasedDrtExample"
fails with a build error.
When trying to run from IntelliJ, I get the following compilation errors:

Information:11/10/19 4:10 PM - Compilation completed with 18 errors and 0 warnings in 1 s 96 ms

/*MY_COMPUTER_PATH*/matsim-maas-master/src/main/java/org/matsim/maas/taxi/RunTaxiExample.java
Error:(27, 35) java: package org.matsim.contrib.taxi.run does not exist
Error:(28, 35) java: package org.matsim.contrib.taxi.run does not exist
Error:(29, 35) java: package org.matsim.contrib.taxi.run does not exist

/*MY_COMPUTER_PATH*/matsim-maas/matsim-maas-master/src/main/java/org/matsim/maas/utils/CreateFleetVehicles.java
Error:(27, 37) java: cannot find symbol
  symbol:   class FleetWriter
  location: package org.matsim.contrib.dvrp.fleet
Error:(28, 37) java: cannot find symbol
  symbol:   class ImmutableDvrpVehicleSpecification
  location: package org.matsim.contrib.dvrp.fleet

/*MY_COMPUTER_PATH*/matsim-maas-master/src/main/java/org/matsim/maas/drt/RunDoorToDoorDrtExample.java
Error:(22, 48) java: package org.matsim.contrib.av.robotaxi.fares.drt does not exist
Error:(23, 48) java: package org.matsim.contrib.av.robotaxi.fares.drt does not exist
Error:(24, 34) java: package org.matsim.contrib.drt.run does not exist
Error:(25, 34) java: package org.matsim.contrib.drt.run does not exist

/*MY_COMPUTER_PATH*/matsim-maas/matsim-maas-master/src/main/java/org/matsim/maas/taxi/RunRobotaxiExample.java
Error:(23, 49) java: package org.matsim.contrib.av.robotaxi.fares.taxi does not exist
Error:(24, 49) java: package org.matsim.contrib.av.robotaxi.fares.taxi does not exist
Error:(29, 35) java: package org.matsim.contrib.taxi.run does not exist
Error:(30, 35) java: package org.matsim.contrib.taxi.run does not exist
Error:(31, 35) java: package org.matsim.contrib.taxi.run does not exist

/*MY_COMPUTER_PATH*/matsim-maas-master/src/main/java/org/matsim/maas/drt/RunStopbasedDrtExample.java
Error:(22, 48) java: package org.matsim.contrib.av.robotaxi.fares.drt does not exist
Error:(23, 48) java: package org.matsim.contrib.av.robotaxi.fares.drt does not exist
Error:(24, 34) java: package org.matsim.contrib.drt.run does not exist
Error:(25, 34) java: package org.matsim.contrib.drt.run does not exist

Any ideas how to solve this?
Thanks,
Ruty

Getting "No Zone found for linkId" error message

I'm running the simulation with drt zonal analysis and got the following error messages:No zone found for linkId. This error message is originally generated from matsim\contribs\drt\src\main\java\org\matsim\contrib\drt\analysis\zonal\ZonalDemandAggregator.java

After some investigations, there are two main reasons cause this issue:

  • I think there is a bug in matsim\contribs\drt\src\main\java\org\matsim\contrib\drt\analysis\zonal\DrtGridUtils.java. There is no zones defined for some nodes in the network.
public class DrtGridUtils {

	public static Map<String,Geometry> createGridFromNetwork(Network network, double cellsize){
		
		double[] boundingbox = NetworkUtils.getBoundingBox(network.getNodes().values());
		double minX = (Math.floor(boundingbox[0] / cellsize)*cellsize);
		double maxX = (Math.floor(boundingbox[2] / cellsize)*cellsize);
		double minY = (Math.floor(boundingbox[1] / cellsize)*cellsize);
		double maxY = (Math.floor(boundingbox[3] / cellsize)*cellsize);
		GeometryFactory gf = new GeometryFactory();
		Map<String,Geometry> grid = new HashMap<>();
		int cell = 0;
		for (double lx = minX;lx<maxX;lx +=cellsize ){
				
			for (double by = minY;by<maxY;by+=cellsize){
				cell++;
				Coordinate p1 = new Coordinate(lx, by);
				Coordinate p2 = new Coordinate(lx+cellsize, by);
				Coordinate p3 = new Coordinate(lx+cellsize, by+cellsize);
				Coordinate p4 = new Coordinate(lx, by+cellsize);
				Coordinate [] ca = {p1, p2, p3, p4, p1};
				Polygon p = new Polygon(gf.createLinearRing(ca), null, gf); 
				grid.put(cell+"", p);
			}
		}
		
		return grid;

In the code above, maxX and maxY are calculated by math.floor which returns the largest integer less than or equal to a given number. This means the nodes with the X,Y axis values greater than maxX, maxY will not fall inside of any zones created by this script. The solution here is either change math.floor to math.ceil for maxX and maxY (double maxX = (Math.ceil(boundingbox[2] / cellsize)*cellsize); double maxY = (Math.ceil(boundingbox[3] / cellsize)*cellsize);), or change conditions in for loop to double lx = minX;lx<=maxX;lx +=cellsize and double by = minY;by<=maxY;by+=cellsize.

  • The second one. See the following code in getZoneForLinkId in matsim\contribs\drt\src\main\java\org\matsim\contrib\drt\analysis\zonal\DrtZonalSystem.java :
		Point linkCoord = MGC.coord2Point(network.getLinks().get(linkId).getCoord());
		for (Entry<String, Geometry> e : zones.entrySet()) {
			if (e.getValue().contains(linkCoord)) {			    
				link2zone.put(linkId, e.getKey());
				return e.getKey();
			}
		}

Here, when checking if the linkCoord is inside of a zone, if the linkCoord is exactly on the edge of a zone, it will also generate this error message. For now, I can avoid this problem by changing some settings like cellsize when I run the simulation with a simple network. Thinking it would be nice if there is a method can handle this by assigning the linkId to one of the zones when the linkCoord falls on the edge of a zone.

AbstractDvrpModeModule.bindModal error

Hi everyone,

I am trying to implement a DRT mode into an existing scenario (Sao Paulo) and also got it to run at one point. However, I someone managed to crash the project, ending up with the following error message:

grafik

From my understanding, I followed the instructions from the matsim-maas drt implementation ...

I have tried to re-configure the project to the old status quo but wasnt successful. Could anyone help me out here?

Cheers,

Alex

Config and Run.class are as follows

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.eqasim.sao_paulo;

import java.util.Iterator;
import java.util.Random;
import org.eqasim.core.components.config.EqasimConfigGroup;
import org.eqasim.core.simulation.EqasimConfigurator;
import org.eqasim.core.simulation.analysis.EqasimAnalysisModule;
import org.eqasim.core.simulation.mode_choice.EqasimModeChoiceModule;
import org.eqasim.sao_paulo.mode_choice.SaoPauloModeChoiceModule;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Leg;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Plan;
import org.matsim.api.core.v01.population.Route;
import org.matsim.contrib.drt.run.DrtControlerCreator;
import org.matsim.contrib.drt.run.MultiModeDrtModule;
import org.matsim.contrib.dvrp.run.DvrpModule;
import org.matsim.contrib.dvrp.run.DvrpQSimComponents;
import org.matsim.core.config.CommandLine;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.CommandLine.Builder;
import org.matsim.core.config.CommandLine.ConfigurationException;
import org.matsim.core.controler.Controler;
import org.matsim.core.router.TripStructureUtils;
import org.matsim.core.router.TripStructureUtils.Trip;
import org.matsim.core.scenario.ScenarioUtils;

public class RunSimulation {
public RunSimulation() {
}

public static void main(String[] args) throws ConfigurationException {
    CommandLine cmd = (new Builder(args)).requireOptions(new String[]{"config-path"}).build();
    Config config = ConfigUtils.loadConfig(cmd.getOptionStrict("config-path"), EqasimConfigurator.getConfigGroups());
    EqasimConfigGroup.get(config).setTripAnalysisInterval(1);
    cmd.applyConfiguration(config);
    Scenario scenario = DrtControlerCreator.createScenarioWithDrtRouteFactory(config);
    //Scenario scenario = ScenarioUtils.createScenario(config);
    EqasimConfigurator.configureScenario(scenario);
    ScenarioUtils.loadScenario(scenario);
    EqasimConfigurator.adjustScenario(scenario);


    EqasimConfigGroup eqasimConfig = (EqasimConfigGroup)config.getModules().get("eqasim");
    eqasimConfig.setEstimator("walk", "spWalkEstimator");
    eqasimConfig.setEstimator("pt", "spPTEstimator");
    eqasimConfig.setEstimator("car", "spCarEstimator");
    eqasimConfig.setEstimator("taxi", "spTaxiEstimator");
    Controler controller = new Controler(scenario);
    EqasimConfigurator.configureController(controller);
    controller.configureQSimComponents(DvrpQSimComponents.activateModes(new String[] { "drt" }));


    controller.addOverridingModule(new EqasimAnalysisModule());
    controller.addOverridingModule(new EqasimModeChoiceModule());
    controller.addOverridingModule(new SaoPauloModeChoiceModule(cmd));
    controller.addOverridingModule(new EqasimAnalysisModule());
    controller.run();
}

}

public class EqasimConfigurator {
public EqasimConfigurator() {
}

public static ConfigGroup[] getConfigGroups() {
    return new ConfigGroup[]{new SwissRailRaptorConfigGroup(), new EqasimConfigGroup(), new DiscreteModeChoiceConfigGroup(), new CalibrationConfigGroup(),
    new DvrpConfigGroup(), new MultiModeDrtConfigGroup()};
}

public static List<AbstractModule> getModules() {
    return Arrays.asList(new SwissRailRaptorModule(), new EqasimTransitModule(), new DiscreteModeChoiceModule(), new EqasimComponentsModule(),
            new DvrpModule(), new MultiModeDrtModule());
}


public static List<AbstractQSimModule> getQSimModules() {
    return Arrays.asList(new AbstractQSimModule[] { (AbstractQSimModule)new EqasimTransitQSimModule(), (AbstractQSimModule)new EqasimTrafficQSimModule() });
}



public static void configureController(Controler controller) {
    Iterator var1 = getModules().iterator();

    while(var1.hasNext()) {
        AbstractModule module = (AbstractModule)var1.next();
        controller.addOverridingModule(module);
    }

    var1 = getQSimModules().iterator();

    while(var1.hasNext()) {
        AbstractQSimModule module = (AbstractQSimModule)var1.next();
        controller.addOverridingQSimModule(module);
    }

    controller.configureQSimComponents((configurator) -> {
        EqasimTransitQSimModule.configure(configurator, controller.getConfig());
    });
}

public static void configureScenario(Scenario scenario) {
}

public static void adjustScenario(Scenario scenario) {
    Iterator var1 = scenario.getHouseholds().getHouseholds().values().iterator();

    while(var1.hasNext()) {
        Household household = (Household)var1.next();
        Iterator var3 = household.getMemberIds().iterator();

        while(var3.hasNext()) {
            Id<Person> memberId = (Id)var3.next();
            Person person = (Person)scenario.getPopulation().getPersons().get(memberId);
            if (person != null) {
                copyAttribute(household, person, "bikeAvailability");
                copyAttribute(household, person, "spRegion");
            }
        }
    }

}

protected static void copyAttribute(Household household, Person person, String attribute) {
    if (household.getAttributes().getAsMap().containsKey(attribute)) {
        person.getAttributes().putAttribute(attribute, household.getAttributes().getAttribute(attribute));
    }

}

}

sao_paulo_config_drt.txt

Via aggregation analysis of drt wait time

Hello,

I'm trying to use Via to do spatial aggregation analysis of drt wait and in vehicle times. While I can produce this for other metrics like duration, I have yet to find wait or in vehicle tt as an attribute through the standard aggregation analysis approach.

Is something extra required to bring dvrp-specific outputs into Via for analysis there? Is this possible?

image

Sharaeble av fleet with congestion pricing network

Hi all.
My research focus is the combination between shareable av taxis (=multiple passengers in a single ride) and a network with dynamic congestion pricing.
In the past couple of weeks I've played with the example scenarios in the DRT contrib library, read Matsim's manual and looked at the implementation code. Before I continue, I have few questions I hope you could help me with:

  1. Adding dynamic congestion to the DRT mode:
    I'm interested in adding a dynamic congestion toll to links, similar to what is done in the 'decongestion' contrib library. My main concern is that the 'decongestion' contribution updates the prices on links between each iteration, but the shareable av fleet DRT contribution uses only a single iteration (due to using dynamic agents). Is there another way to include congestion pricing on the links, that is not fixed? (i.e., I do not want to set up fixed tolls on the links in the 'network' configuration file.)

  2. Dispatching algorithm:
    I'm interested in checking a few different dispatching algorithms for the fleet. Horl el al. have done something similar using AMod(Fleet operational policies for automated mobility: A simulation
    assessment for Zurich
    ), and I was wondering if I can implement this in Matsim.
    I've seen the correspondence in the 'Taxi Contribution: alternative taxi assignment algorithms available?', and am wondering:

  • Will it be possible to test some of these dispatching algorithm solely by updating the cost function?
  • What are the complications in writing my own DrtOptimizer? What should I be careful of? I'm proficient in Java and have worked with the 'Guice' framework before, so I'm not afraid of getting my hands dirty.
  1. Recommended case study:
    Is there a recommended case study to work with? I see that the 'Berlin' case study is highly researched, but I'm wondering if maybe it has too many details, as I primarily want to focus on only av cars. On the other hand, the Sioux Falls case study looks too small.

Thanks,
Ruty

Taxi Contribution: alternative taxi assignment algorithms available?

Dear all,

In it is noted in Bischcoff et al., 2017 (City-wide shared taxi Berlin case study) that "shared taxis are dynamically routed using an insertion heuristic that aims at minimizing the total taxi workload measured as the total time spent on handling requests".

In Leisch & Bischoff, 2018 (Should SAVs Replace Buses), this taxi assignment algorithm is noted as a limitation on the ability to meaningfully reduce wait and travel times, including with the introduction of larger fleet sizes (e.g. only 250 veh of fleet of 1000 used).

I'm wondering if there are presently alternative taxi assignment algorithms available that allow for the optimization of different objectives besides minimizing the total taxi workload? For example, I would be interested in the objective function minimize average travel and wait times irregardless of occupancy rates or VKT, allowing to test the tradeoffs between these variables under different fleet structures and demand rates.

Deepening Understanding of dvrp Assignment Algorythm

Dear maas team,

I have read about and experimented with the alpha and beta parameters and have a growing understanding of their influence, but still sometimes find myself a little doubtful on how they influence service quality characteristics (max wait, in-veh tt) and specifically how they relate to the rejection rate. This question is a direct followup to #9

The specific question I am trying to understand is:

  1. Should the rejection rate go down and approach 0 if there is an oversupply of fleet? OR, is this related to the function of the assignment algorithm as discussed in "City-wide shared taxis: A simulation study in Berlin" - that it maximizes workload and occupancy thus creating a limit to performance improvement from fleet size?

  2. What are the most optimal alpha and beta parms to get as close to maximizing service quality as possible with the current assignment algorythm? That is to say, can I (despite the alyorythms preference to put as many people in a vehicle as possible) move towards a situation that when I oversupply the fleet, I actually see the effect of the extra vehicles in better service performance and lowered rejection rates, purely by setting extreme a and b parms?

An aspect of my research question is to determine the necessary cost of a DRST system to achieve an equlivent level of service provided by an existing conventional bus system. The challenge with this is that the level of service is bounded by the alpha and beta parms, so even with a very small DRST service I don't see radically worse service performance in terms of wait and travel times, just a much higher rejection rate.

Including rejection rate as a necessary third bounding variable to my research question is then a logical approach, but I'm finding in my scenarios that even with large oversupply of vehicles, rejection rates remain very high during the innovation phase. This makes it challenging to answer the question of how much would an equivalent service cost via directly comparing service quality metrics.

Where to Start For Using DVRP Extension

Dear MAAS Team,

I currently have had built my base model in MATSim (with my network, plan, pt and other basic files). My research will be about autonomous vehicles so I would like to add SAVs into my network in the coming steps. I see most of the AV paper implemented DVRP extension but without the source codes or some examples, therefore, I can only search online, that's why I was guided here.

I see there are many different extensions available for different modules (AVs, taxis, DRT, DVRP etc.), and from what I understand they are all from the basic DVRP models. I have read through the Module introduction in the MATSim book, so I know the OneTaxiExample is a good place to get started. However, I cannot find the configUrl in the source code dvrp:13.0. Hence, my studying path gets stuck again.

I also tried to search other dvrp codes in the MATSim code example. Under the extensions.dvrp, I saw another class for RunOneTaxiExample, but this one is totally different from the one in the source code, I also cannot find the config file it refers to (like /src/main/resources/one_taxi/one_taxi_config.xml). So I really don't know what I should do next to continue.

Can you please offer me some suggestions regarding where I should start? And also, which extensions I should use for my research purposes? I will be very appreciated for any suggestions you offered.

Thanks,
Cian

How to get the occupancy of drt-maas for whole population?

I am running the matsim-maas using 10% of the population. The simulation is running fine and I get the values of different indicators such as occupancy in DRT vehicles. However, I face one issue regarding scaling up of occupancy for the population. Since the trips/ rides in sample (10%) will be less dense, so it is natural that probability of ride share or occupancy will also drop down and will not reflect the actual scenario of ride share with full population. How can I arrive at approximate occupancy using the sample population?

How to interpret scores and achieve convergence?

I am doing a study to analyse the impacts of DRT for 10% population. In the scenario without DRT Maas, Only cars are simulated, Convergence is fast and rush hour peaks are also very prominent, which is expected.
20 legHistogram_car

In the Door-2-Door DRT service with around 1000 DRT vehicles, Cars and DRT vehicles are simulated and together they make up 100,000 agents with Car: DRT demand in ratio of 3:2. I am unable to get the score graph to convergence and need some help understand it. One iteration takes around 40 minutes and as you can see, the agent scores do not converge even on 100th iteration (after around 3 days)?
scorestats (1)

Also the morning and evening peaks for Cars are not clearly differentiable in this case as compared to previous case. Do i need to run more iterations or any other suggestions to debug this?

TIA

100 legHistogram_car

100 legHistogram_drt

how to write plan for stop based drt?

I am using following format for stop based drt plan and i am getting
ERROR StopBasedDrtRoutingModule:120 Start and end stop are the same, agent will walk.
even when change home location in last activity type I am getting the same error.

<person id="1"> 
           <plan score="0.0" selected="yes">
           <activity type="home" link="3018.0" x="73.910586" y="18.566487" end_time="07:02:00"/>
           <leg mode="drt">  </leg>
           <activity type="work" link="3276.0" x="73.912336" y="18.559009"  end_time="18:42:00" />
           <leg mode="drt"> </leg>
           <activity type="home" link="3018.0" x="73.910586" y="18.566487" />
           </plan> </person>

General question about autonomous vehicles

Hello. I want to do a research on my desired city, in fact right now people are using only private cars and I want to find out by implementing a ridepooling system or an autonomous ridepooling system, to what extend the number of cars would be reduced. Would you please guide me which steps should I follow in general? (I have my network file and also agents daily plans)
Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.