Code Monkey home page Code Monkey logo

matsim-code-examples's People

Contributors

aravindsasi avatar dependabot[bot] avatar gregmacfarlane avatar jakobrehmann avatar janekdererste avatar jwjoubert avatar kainagel avatar kt86 avatar michalmac avatar mrieser avatar nkuehnel avatar rakow avatar rgraebe avatar sebhoerl avatar tschlenther avatar tthunig 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  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  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

matsim-code-examples's Issues

Exception while running MATSim

Hi everyone,

can anyone help me with this exception? Log file is attached as well

Thanks in advance
Nico

mito_assignment.logfile.log

2018-12-10 16:46:34,587 ERROR SimStepParallelEventsManagerImpl$ExceptionHandler:420 Thread class org.matsim.core.events.SimStepParallelEventsManagerImpl$ProcessEventsRunnable4 died with exception while handling events.
java.lang.RuntimeException: problem invoking EventHandler org.matsim.core.events.algorithms.Vehicle2DriverEventHandler for event-class org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent
at org.matsim.core.events.EventsManagerImpl.computeEvent(EventsManagerImpl.java:230)
at org.matsim.core.events.EventsManagerImpl.processEvent(EventsManagerImpl.java:136)
at org.matsim.core.events.SimStepParallelEventsManagerImpl$ProcessEventsRunnable.run(SimStepParallelEventsManagerImpl.java:330)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassCastException: java.util.HashMap$Node cannot be cast to java.util.HashMap$TreeNode
at java.util.HashMap$TreeNode.removeTreeNode(HashMap.java:2029)
at java.util.HashMap.removeNode(HashMap.java:839)
at java.util.HashMap.remove(HashMap.java:798)
at org.matsim.core.events.algorithms.Vehicle2DriverEventHandler.handleEvent(Vehicle2DriverEventHandler.java:57)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.matsim.core.events.EventsManagerImpl.computeEvent(EventsManagerImpl.java:226)
... 3 more

Creating vehicle ID examples

Dear all,

I'm trying to create vehicle ID matched to the Person ID in MATSim. Is there any possibility to find an example for this?
Thank you!

Car Sharing

Hi

I have a problem running car sharing model. when I run the example of 10 agents, everything works fine, and I got a result for 10 iterations. But, when I add one more agent, I got error, as in attached image. I tried a lot, its not working.

Please help

Thanks
capture
run1.logfileWarningsErrors.log
10persons.txt

Issues in running extension- DVRP, otfvis, Analysis

I am facing issues in running matsim and its extensions- DVRP, OTFVis, Analysis, etc. I come from a non-programming background and need help to understand the process to run Matsim with it's extensions. I am able to to run Matsim.jar independently but unable to use it with extensions.

java -Xmx500m -cp matsim-0.10.1.jar:dvrp-0.10.1/dvrp-0.10.1.jar org.matsim.contrib.dvrp
I am using this command to run DVRP extension and getting an error-
Error: Could not find or load main class org.matsim.run

What should I do?

Using MATSim in Eclipse as a beginner

I am working on a project related to MATSim. I chose a small network of a city to test. I created the basic input file: config, network, and population file. I can run the simulation through the executable jar file (here it is matsim-0.10.1.jar). Right now, I want to run the simulation in Eclipse through Javascript. I have no coding background.
Can anyone help me create my first MATSim java project?

There exists already a node with id = 1.

Hello ,

I tried to make my manual networks by typing a config file instead of any code. A basic netwok file with 7 nodes and 4 Public Transport stops to get started with mode choice strategy of MATSim.

However, I get this error after running MATSim 0.10 :

Error in custom provider, java.lang.IllegalArgumentException: There exists already a node with id = 1.

There is just one node in my network file. I have attached my files here so you could have an idea.
config.zip
network.zip
population.zip
transitschedule.zip
transitVehicles.zip

Thanks a lot in advance!

Error : There exists already a node with id = 0.

Hello,
i've already run my simulation without Public Transport and it works fine, but when i tryed to add Transport Public I got this error below.

Existing node: [id=0][coord=[x=176431.458652][y=8246433.09168]][type=2][nof_inlinks=3][nof_outlinks=1]
Node to be added: [id=0][coord=[x=176431.458652][y=8246433.09168]][type=null][nof_inlinks=0][nof_outlinks=0].
Node is not added to the network.

However, the node id has already been assigned and added to the network.
Anyone can help-me to fix this error?

Thank you for any help!

Issues with cadyts contrib

I'm trying to automatically calibrate my simulation with the cadyts extension, using maven as recommended, because the result of the counts I had with the simulation was quite different from the real counts.
I believe I did everything correctly, but when I run the matsim via maven appears this error:

java.lang.NullPointerException
at org.matsim.contrib.cadyts.car.PlansTranslatorBasedOnEvents.handleEvent (PlansTranslatorBasedOnEvents.java:131)

I am attaching my log file.
Thanks in advance for any help.

Logfile.txt

CadytsIntegration

I have a question regarding the “CadytsCarIT.java” example from org.matsim.contrib.cadyts package. Without any changes in the counts5.xml or the plans5.xml (two plans per agent) file the calibration delivers the correct link volumes. If I just add one plan to each agent (three plans per agent) with a route consisting of an arbitrary link sequence, the test fails. Shouldn`t it be possible to get the correct plan from each agent based on the counts5.xml file.

Thank you in advance for your answers!!!

Calibrating MatSim based on counting points

We would like to calibrate our MatSim simulation based on several counting points which are irregularly distributed in our study area. The counting points related files include the number of vehicles which are passing a corresponding link. The measurements have a temporal resolution of 1 hour.

What is the best way to calibrate the simulation in that way, that the simulated hourly link volumes correspond to the measurements? Should we use the network capacity and speed as calibration parameters? Is there any existing tool to perform such sensitivity tests?

Thank you very much!

Issues with PT schedule for Amsterdam

Hello,
I am working with a scenario for the network of Amsterdam with 140000 agents and modes: Car, walk, bike, PT, and drt(taxi). The pt mode comprise of train, tram,subway, and ferry. The transit schedule and vehicles file have been obtained from GTFS data.
I am looking into the impact of replacing pt lines with drt, for which I removed all the stops, routes, and lines of bus from the schedule file and ran the simulation with the updated schedule file. The initial plan input file has clean pt plans without any routes. But I encounter an error in the first iteration (2018-10-12 14:07:37,060 ERROR AbstractMultithreadedModule$ExceptionHandler:210 Thread ChooseRandomLegMode.3 died with exception. Will stop after all threads finished.)
I thought maybe this happened because of the agents who had a bus route initially, are not able to find an alternate pt route. So I changed all the pt legs in the initial plan file to taxi/drt so that the initial plan file doesn't have any pt legs. But I still get this error. Any help with this would be deeply appreciated. The detailed log file of error is attached.

@mrieser
logfileWarningsErrors.log

The error in using MATSim0.10.1

Dear MATSim,
When I run the project example siouxfalls-2014 in my computer using MATSim0.10.1, the system throw a problem. The message is under follow.

2018-08-29 10:02:31,352 ERROR MatsimRuntimeModifications:54 Getting uncaught Exception in Thread main
java.lang.IncompatibleClassChangeError: Found interface org.matsim.core.config.ConfigWriterHandler, but class was expected
at org.matsim.core.config.ConfigWriter.writeStream(ConfigWriter.java:73)
at org.matsim.core.controler.ControlerUtils.checkConfigConsistencyAndWriteToLog(ControlerUtils.java:61)
at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:82)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:48)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31)
at org.matsim.core.controler.AbstractController.run(AbstractController.java:92)
at org.matsim.core.controler.NewControler.run(NewControler.java:75)
at org.matsim.core.controler.Controler.run(Controler.java:202)
at org.matsim.run.Controler.run(Controler.java:56)
at org.matsim.run.Controler.main(Controler.java:60)
2018-08-29 10:02:31,356 ERROR MatsimRuntimeModifications:60 ERROR --- This is an unexpected shutdown!
2018-08-29 10:02:31,356 ERROR MatsimRuntimeModifications:63 Shutdown possibly caused by the following Exception:
java.lang.IncompatibleClassChangeError: Found interface org.matsim.core.config.ConfigWriterHandler, but class was expected
at org.matsim.core.config.ConfigWriter.writeStream(ConfigWriter.java:73)
at org.matsim.core.controler.ControlerUtils.checkConfigConsistencyAndWriteToLog(ControlerUtils.java:61)
at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:82)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:48)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31)
at org.matsim.core.controler.AbstractController.run(AbstractController.java:92)
at org.matsim.core.controler.NewControler.run(NewControler.java:75)
at org.matsim.core.controler.Controler.run(Controler.java:202)
at org.matsim.run.Controler.run(Controler.java:56)
at org.matsim.run.Controler.main(Controler.java:60)
2018-08-29 10:02:31,363 ERROR MatsimRuntimeModifications:78 ERROR --- MATSim unexpectedly terminated. Please check the output or the logfile with warnings and errors for hints.
2018-08-29 10:02:31,372 ERROR MatsimRuntimeModifications:79 ERROR --- results should not be used for further analysis.
2018-08-29 10:02:31,378 ERROR MatsimRuntimeModifications:83 ERROR --- This was an unexpected shutdown! See the log file for a possible reason.

Do anyone know the reason? Thank you!

Specifications for running in a cluster

Hello all,
I am working with a scenario for the city of Amsterdam with about 140000 agents. The modes available are pt, car, taxis/avs, walk, and bike. Due to the size of the scenario, I am running it in a HPCC in Netherlands. I have exhausted my allocated budget (core-hours) and I am applying for more. I have to fill in an application form for this which describes the project and my simulation specifications. I would appreciate some help with some of the questions in the application form(mentioned below) from people who have already used such a facility.

Describe the implementation details of your numerical approach for the preferred system (MPI, OpenMP, hybrid, CUDA, OpenCL, OpenACC, ….);
Which standard package(s) (application software, if any) and which libraries will be used ?
Indicate the parallel performance of the code(s) you plan to use;
Indicate how much memory and how much I/O (volume and bandwidth) will be needed.

Regards,
Jishnu

using subpopulations

Hello, two related questions about using sub-populations:

  1. Is it possible to reference multiple plans inputs at setup and declare sub-population in setup? I came across such an issue marked as resolved but can find no docs. Upon more careful reading this is effectively confirmed as not possible here
  2. I see that the planning module can make use of sub-populations, can the scoring module do similarly?

Appologies if i am overlooking some obvious resource, I have read carefully around the subject but still wondering/hopeful. Happy to be pointed at some docs. Many thanks.

How to set activity as primary or secondary in config?

From reading the matsim book it mentions primary and secondary activities, primary activities are fixed while secondaries can get dropped from the plan, and with another module can have a choice between facilities.

What is not clear is how in the config do you set an named activity to be primary or secondary:

Sioux Falls has an example of a secondary activity:

		<param name="activityType_2"            value="secondary" /> 
		<param name="activityPriority_2"        value="1" />
		<param name="activityTypicalDuration_2" value="01:00:00" />
		<param name="activityMinimalDuration_2" value="00:30:00" />
		<param name="activityOpeningTime_2"     value="08:00:00" />
		<param name="activityClosingTime_2" value="20:00:00" />

however with the exception of the activity name, doesn't have any difference from a primary activity, unless activityType takes a set of predefined defaults so that h, home w, work e, edu, education are automatically made primary?

Problems in running MATSim

When I was running the equil example, I got the following error: javax.xml.bind.JAXB Class Not Found Exception. I am wondering if I should use java 8/9 rather than latest java

2018-10-01 22:33:30,652 ERROR MatsimRuntimeModifications$1:41 Getting uncaught Exception in Thread main
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at org.matsim.core.controler.corelisteners.DumpDataAtEndImpl.dumpLanes(DumpDataAtEndImpl.java:199) at org.matsim.core.controler.corelisteners.DumpDataAtEndImpl.notifyShutdown(DumpDataAtEndImpl.java:130)
at org.matsim.core.controler.ControlerListenerManagerImpl.fireControlerShutdownEvent(ControlerListenerManagerImpl.java:122)
at org.matsim.core.controler.AbstractController$1.shutdown(AbstractController.java:89)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:66)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31)
at org.matsim.core.controler.AbstractController.run(AbstractController.java:92)
at org.matsim.core.controler.NewControler.run(NewControler.java:75)
at org.matsim.core.controler.Controler.run(Controler.java:202)
at org.matsim.run.Controler.run(Controler.java:56)
at org.matsim.run.Controler.main(Controler.java:60)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 11 more

about inputFacilityAttributeFile to load weight attribute

hi all,

I am trying to load weight attribute into my facilities data and use them into computing accessibility with MATSim.

and I just come across a problem that weight attribute is not allowed in facilities_v1.dtd, which means that i can not prepare weight for each facility in facility.xml. So I am wondering if inputFacilityAttributeFile in FacilitiesConfig could serve me or not. If so, could anyone please share me the format of the "FacilityAttributeFile"? and if not, what is the proper way to load weight attribute for each facility?

Thanks in advance!

Lichen Luo

GenericRouteImpl cannot be cast to ExperimentalTransitRoute

I am running a scenario with public transit using the RAPTOR router. I get the following error for random individuals or at random replanning steps:

2018-08-23 14:55:11,771 ERROR ParallelPersonAlgorithmUtils$ExceptionHandler:164 Thread PersonPrepareForSim.4 died with exception while handling events.
java.lang.ClassCastException: org.matsim.core.population.routes.GenericRouteImpl cannot be cast to org.matsim.pt.routes.ExperimentalTransitRoute
	at org.matsim.core.router.TransitRouterWrapper.fillWithActivities(TransitRouterWrapper.java:113)
	at org.matsim.core.router.TransitRouterWrapper.calcRoute(TransitRouterWrapper.java:93)
	at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:217)
	at org.matsim.core.router.PlanRouter.run(PlanRouter.java:87)
	at org.matsim.core.population.algorithms.PersonPrepareForSim.run(PersonPrepareForSim.java:141)
	at org.matsim.core.population.algorithms.ParallelPersonAlgorithmUtils$PersonAlgoThread.run(ParallelPersonAlgorithmUtils.java:145)

This error traces back to this line of code in TransitRouterWrapper.fillWithActivities():

Facility firstToFacility;
if (baseTrip.size() > 1) { // at least one pt leg available
  ExperimentalTransitRoute tRoute = (ExperimentalTransitRoute) baseTrip.get(1).getRoute();
  firstToFacility = this.transitSchedule.getFacilities().get(tRoute.getAccessStopId());
} else {
  firstToFacility = toFacility;
}
// (*)
Route route = createWalkRoute(fromFacility, departureTime, person, leg.getTravelTime(), firstToFacility);
leg.setRoute(route);

In one case I've been able to isolate, the error gets thrown on a baseTrip with 4 legs:

  1. [mode=transit_walk][depTime=undefined][travTime=00:13:52][arrTime=undefined][route= startLinkId=null endLinkId=pt_f-dqc-wmata_7082 travTime=832.9396361992092 dist=1166.115490678893]
  2. [mode=transit_walk][depTime=undefined][travTime=00:01:17][arrTime=undefined][route= startLinkId=pt_f-dqc-wmata_6219 endLinkId=50758_B travTime=77.24313499229577 dist=108.14038898921407]
  3. [mode=pt][depTime=undefined][travTime=00:08:32][arrTime=undefined][route=[ExpTransitRoute: access=f-dqc-wmata_36826.link:50758_B egress=f-dqc-wmata_27810.link:36262_A line=f-dqc-wmata_182_0 route=f-dqc-wmata_182_0 ]]
  4. [mode=transit_walk][depTime=undefined][travTime=00:01:16][arrTime=undefined][route= startLinkId=36262_A endLinkId=null travTime=76.13281330697025 dist=106.58593862975836]

The class of leg 1 is in fact a GenericRouteImpl rather than the ExperimentalTransitRoute the method expects. It seems odd that there would be 2 transit_walk legs before the pt leg in the route RAPTOR generates.

I suppose that my overall question is, is this likely to be caused by a poorly formed highway network / transit schedule, or an improperly configured router, or a legitimate bug? I'm using 10.0

Deactivating built-in TripRouter when using QueueSimulationListeners to provide dynamic re-routing

Hello!

Using MATSim 0.10.1. I have implemented a Provider<Mobsim> which re-routes vehicles in a BeforeSimStepEventHandler. This over-writes the route provided by the built-in router, in my case set as FastDijkstras in my config.xml file. The dynamic re-routing works correctly.

However, I am noticing that starting MATSim still takes a very long time. When I inspected the simulation using jvisualvm, I found that MATSim was still running it's own FastDijkstras at the beginning of the day, which I believe is not necessary for my implementation. As I attempt to run simulations with populations 10k and above, this becomes a big time sink. I tried building a DummyRoutingProvider which might simply return an empty Leg, but I didn't find how I could wire that in, as everything in the TripRouter class hierarchy seems private.

Perhaps these need to be calculated for the simulator to run correctly? But if not, it would be great to bypass them. I am only running a single iteration of MATSim, so no behavioral learning going on here, just queue simulation of agents with fixed plans.

Thank you for any help!

Rob
Denver, CO

Congestion Pricing Help

Hello,

I've been having trouble getting the congestion pricing module to work.
I executed the config file using eclipse, MATSIM 9.0, running configurations on RunRoadPricingUsingTollFactorExample.java using the config file as the input.

I got all the input to the point where it will run, but the second that the congestion pricing goes into affect, the below error is thrown and the simulation stops.

java.lang.NullPointerException
at org.matsim.roadpricing.run.RunRoadPricingUsingTollFactorExample$1.getTollFactor(RunRoadPricingUsingTollFactorExample.java:61)
at org.matsim.roadpricing.RoadPricingSchemeUsingTollFactor.getLinkCostInfo(RoadPricingSchemeUsingTollFactor.java:73)
at org.matsim.roadpricing.CalcPaidToll$CordonTollBehaviour.handleEvent(CalcPaidToll.java:292)
at org.matsim.roadpricing.CalcPaidToll.handleEvent(CalcPaidToll.java:100)
at org.matsim.core.events.EventsManagerImpl.callHandlerFast(EventsManagerImpl.java:291)
at org.matsim.core.events.EventsManagerImpl.computeEvent(EventsManagerImpl.java:222)
at org.matsim.core.events.EventsManagerImpl.processEvent(EventsManagerImpl.java:136)
at org.matsim.core.events.SimStepParallelEventsManagerImpl$ProcessEventsRunnable.run(SimStepParallelEventsManagerImpl.java:329)
at java.lang.Thread.run(Thread.java:745)
2018-10-21 04:30:02,816 ERROR AbstractController:210 Mobsim did not complete normally! afterMobsimListeners will be called anyway.
java.lang.RuntimeException: Exception while processing events. Cannot guarantee that all events have been fully processed.
at org.matsim.core.events.SimStepParallelEventsManagerImpl.finishProcessing(SimStepParallelEventsManagerImpl.java:211)
at org.matsim.core.mobsim.qsim.QSim.cleanupSim(QSim.java:319)
at org.matsim.core.mobsim.qsim.QSim.run(QSim.java:243)
at org.matsim.core.controler.NewControler.runMobSim(NewControler.java:120)
at org.matsim.core.controler.AbstractController$8.run(AbstractController.java:199)
at org.matsim.core.controler.AbstractController.iterationStep(AbstractController.java:231)
at org.matsim.core.controler.AbstractController.mobsim(AbstractController.java:195)
at org.matsim.core.controler.AbstractController.iteration(AbstractController.java:154)
at org.matsim.core.controler.AbstractController.doIterations(AbstractController.java:121)
at org.matsim.core.controler.AbstractController.access$0(AbstractController.java:119)
at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:91)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:48)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31)
at org.matsim.core.controler.AbstractController.run(AbstractController.java:99)
at org.matsim.core.controler.NewControler.run(NewControler.java:79)
at org.matsim.core.controler.Controler.run(Controler.java:205)
at org.matsim.roadpricing.run.RunRoadPricingUsingTollFactorExample.main(RunRoadPricingUsingTollFactorExample.java:79)
Caused by: java.lang.NullPointerException
at org.matsim.roadpricing.run.RunRoadPricingUsingTollFactorExample$1.getTollFactor(RunRoadPricingUsingTollFactorExample.java:61)
at org.matsim.roadpricing.RoadPricingSchemeUsingTollFactor.getLinkCostInfo(RoadPricingSchemeUsingTollFactor.java:73)
at org.matsim.roadpricing.CalcPaidToll$CordonTollBehaviour.handleEvent(CalcPaidToll.java:292)
at org.matsim.roadpricing.CalcPaidToll.handleEvent(CalcPaidToll.java:100)
at org.matsim.core.events.EventsManagerImpl.callHandlerFast(EventsManagerImpl.java:291)
at org.matsim.core.events.EventsManagerImpl.computeEvent(EventsManagerImpl.java:222)
at org.matsim.core.events.EventsManagerImpl.processEvent(EventsManagerImpl.java:136)
at org.matsim.core.events.SimStepParallelEventsManagerImpl$ProcessEventsRunnable.run(SimStepParallelEventsManagerImpl.java:329)

One of the possible reasons is that when I try tried to run the config file including the scenario module, but it would error out right away.

Any suggestions on how to get it it working?

Any Alternative to fixed number of interations?

Thanks for all your quick answers on previous questions.

I've been running through all the documentation I can find trying to get an overview of what Matsim can do. Having run some example models, I've noticed these all these have a set number of iterations:

Is it possible to set alternative stopping criteria? Similar to the convergence criteria required by UK standards WebTAG Table 4

Looking at the API for the controller it suggests there is not. If there is a fixed number of iterations then what does the config option firstIteration do?

Question on cold emission calculation

In the case of Cold Pollutant calculation in the emissions contrib, why is the emission for kilometer 0-1 subtracted from the kilometer 1-2 emission when distance is greater than 1? In the HBEFA table it looks like the emission is specfically for kilometer 1-2 or am I wrong?

Sample from the HBEFA lookup table sample in contrib/emissions/test/input:
2005ColdDetailed[3.1];pass. car;2010;;FC;;T�,7-8h,1-2km;121130;PC diesel <1,4L Euro-3;diesel;<1,4L;PC-D-Euro-3;50000.00;1.00;20.82;;;

 for (ColdPollutant coldPollutant : ColdPollutant.values()) {
            double generatedEmissions;
            if (distance_km == 1) {
               generatedEmissions = getTableEmissions(vehicleId, vehicleInformationTuple, 1, key, coldPollutant);
            } else {
               generatedEmissions = getTableEmissions(vehicleId, vehicleInformationTuple, 2, key, coldPollutant) - getTableEmissions(vehicleId, vehicleInformationTuple, 1, key, coldPollutant);
            }
            coldEmissionsOfEvent.put(coldPollutant, generatedEmissions);
        }
        return coldEmissionsOfEvent;

Thanks in advance
Eunby

Flexible-route transit

I know that MATSim is capable of running flexible route transit services based on papers like this one by @jishnuns and others, but I don't see any examples on how to specify the route areas or make them available to agents in the sim.

Issues with calibration.

Dear all,

When i runned my first scenário (Without calibrate with Cadyts),I was getting results as if there were almost no one cars passing by (Atached my countscompare). I was using a population of 5%, storagecapacityfactor of 0.2%, flowcapaityfactor of 0.3% and CountScaleFactor of 20. (I visualized the simulation with OTFVIS and there was vehicles passing, including some traffic jams)
After I runned with cadyts extension, my countscompare still the same, and the others outputs doesn't seems to change much (Or maybe i was not able to interpret the results very wel, if you have some userguide to help-me it would be usefull).

Follow attached my countscompares , my calibration stats and my config, maybe someine could give-me some help.

Thanks
calibration-stats.txt
config_defaultDFv2.txt

15.countscompare.txt

Using MATSim as a beginner.

I was working on a project related to MATSim where I had to do convert the OSM data that i created on JOSM to MATSim files for further processing. The problem is that i have no Idea about MATSim, I downloaded MATSim then followed all the procedures on TU Berlin website for beginning MATSim but it didn't work. I am confused that how i have to write the java codes for config file network file plan file etc. I am using MAC and have eclipse installed where i have also tried the cloning of MATSim project from Github but it also didn't work so now i am not sure what to do. I would highly appreciate if you can kindly help me with this.

Can't run osm.pbf with java to create "Network Generation" for MATsim

When I run command
java -cp osmosis.jar --read-pbf file =antarctica-latest.osm.pbf --bounding -box top =47.701 left =8.346 bottom =47.146 right =9.019 \completeWays = true --used - node --wb allroads .osm.pbf
to generate a MATSim network is from OSM data but I receive some following errors:
Unrecognized option: --read-pbf
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I downloaded osmosis from http://wiki.openstreetmap.org/wiki/Osmosis
and osm.pbf file (antarctica-latest.osm.pbf) from http://download.geofabrik.de/
My Java version is 1.8.0_181 running on ubuntu 16.04.5 x64
Can you help me to solve that problems, thank you

error in running DRT module

i am trying to run DRT module as mentioned on site:

package com.runcottbusdrt;

import org.matsim.contrib.av.robotaxi.fares.drt.DrtFareModule;
import org.matsim.contrib.av.robotaxi.fares.drt.DrtFaresConfigGroup;
import org.matsim.contrib.drt.run.DrtConfigGroup;
import org.matsim.contrib.drt.run.DrtControlerCreator;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.controler.Controler;
import org.matsim.vis.otfvis.OTFVisConfigGroup;

public class rundoortodoordrt {

private static final String COTTBUS_DOOR2DOOR_CONFIG = "H:\\matsim-0.10.1\\dvrp-0.10.1\\cottbus\\drtconfig_door2door.xml";

@SuppressWarnings("unused")
private static final String MIELEC_CONFIG = "H:\matsim-0.10.1\dvrp-0.10.1\mielec_2014_02\mielec_drt_config.xml";

public static void run(Config config, boolean otfvis) {
//Creates a MATSim Controler and preloads all DRT related packages
Controler controler = DrtControlerCreator.createControler(config, otfvis);

  //this is optional, adds fares to DRT
  controler.addOverridingModule(new DrtFareModule());

  //starts the simulation
  controler.run();

}

i am getting this error -
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Implicit super constructor ConfigGroup() is undefined for default constructor. Must define an explicit constructor
at com.runcottbusdrt.DrtFaresConfigGroup.(DrtFaresConfigGroup.java:5)
at com.runcottbusdrt.rundoortodoordrt.main(rundoortodoordrt.java:41)

how do i solve this please help?

Missing example configuration for example13MultiStageTripRouting

I'm up-to-date on the v0.11.x branch of this repository, and am trying to run the main() method of RunTeleportationMobsimWithCustomRoutingExample, and it tries to load a configuration file in examples/pt-tutorial/.

public class RunTeleportationMobsimWithCustomRoutingExample {
	private static final String configFile = "examples/pt-tutorial/config.xml";


	public static void main(final String[] args) {
		// make sure we get all the log messages in the logfile
		OutputDirectoryLogging.catchLogEntries();


		// load the config ...
		final Config config = ConfigUtils.loadConfig( configFile );

This path is not in this repository; is the path simply out of date or has the data been moved elsewhere? Should I update the path to the configuration at scenarios/equil-mixedTraffic/ or something similar?

Executed score is not near best or average

I was running some scenarios and noticed that my average executed score was ending up near my average worst score. My understanding is that it should be near the average best after several iterations.

image

I think I had a bug where I set the strategy mode twice in the above plot, but I can't tell if that would be a problem or not. So I started to build another test.

BestScore

This is the configuration for the BestScore selector, drawn from the output_config.xml

		<parameterset type="strategysettings" >
			<!-- iteration after which strategy will be disabled.  most useful for ``innovative'' strategies (new routes, new times, ...). Normally, better use fractionOfIterationsToDisableInnovation -->
			<param name="disableAfterIteration" value="-1" />
			<!-- path to external executable (if applicable) -->
			<param name="executionPath" value="null" />
			<!-- strategyName of strategy.  Possible default names: SelectRandomBestScoreKeepLastSelectedChangeExpBetaSelectExpBetaSelectPathSizeLogit (selectors), ReRoute TimeAllocationMutator ChangeLegMode TimeAllocationMutator_ReRoute ChangeSingleLegMode ChangeSingleTripMode SubtourModeChoice ChangeTripMode TripSubtourModeChoice  (innovative strategies). -->
			<param name="strategyName" value="BestScore" />
			<!-- subpopulation to which the strategy applies. "null" refers to the default population, that is, the set of persons for which no explicit subpopulation is defined (ie no subpopulation attribute) -->
			<param name="subpopulation" value="null" />
			<!-- weight of a strategy: for each agent, a strategy will be selected with a probability proportional to its weight -->
			<param name="weight" value="0.7" />
		</parameterset>

This results in the following score pattern (diff, by the way, is the average difference between the agents best and worst scores, and the ribbon is the standard deviation of that statistic):

image

ChangeExpBeta

Again, from the output

		<parameterset type="strategysettings" >
			<!-- iteration after which strategy will be disabled.  most useful for ``innovative'' strategies (new routes, new times, ...). Normally, better use fractionOfIterationsToDisableInnovation -->
			<param name="disableAfterIteration" value="-1" />
			<!-- path to external executable (if applicable) -->
			<param name="executionPath" value="null" />
			<!-- strategyName of strategy.  Possible default names: SelectRandomBestScoreKeepLastSelectedChangeExpBetaSelectExpBetaSelectPathSizeLogit (selectors), ReRoute TimeAllocationMutator ChangeLegMode TimeAllocationMutator_ReRoute ChangeSingleLegMode ChangeSingleTripMode SubtourModeChoice ChangeTripMode TripSubtourModeChoice  (innovative strategies). -->
			<param name="strategyName" value="ChangeExpBeta" />
			<!-- subpopulation to which the strategy applies. "null" refers to the default population, that is, the set of persons for which no explicit subpopulation is defined (ie no subpopulation attribute) -->
			<param name="subpopulation" value="null" />
			<!-- weight of a strategy: for each agent, a strategy will be selected with a probability proportional to its weight -->
			<param name="weight" value="0.7" />
		</parameterset>

image

In both cases, the average executed is gradually closing the gap with the average best, which makes sense. What doesn't make sense to me is how the average average can catch up to, and then pass, the average executed, particularly in the bestScore selection regimen. Is there something I'm not setting appropriately?

Also, is there any explanation for what I could have seen in the first scenario? It's almost as if the agents were selecting the worst plan.

DRT

I am trying to run the DRT contribution within a scenario with public transport and cars.
I have some doubts that I would like to heal.

  • In module besides car and PT, do I have to put as "main mode" the drt too?
  • In the module, which are mandatory to the DRT?
  • Is it mandatory to especify the DVRP and OTFVIS module in the config file??
  • In the plans file, should I also put the drt mode to the activitys of the agents?
  • I'm using the door2door DRT model, so in the vehiclesdrt.xml file how to choose which links should i put in the <start_link?>? it can be a random link??

Thanks

AbstractQsim in SBB Transit

I am trying to put the PTIntermodalRouting example into a scenario where I already have the SBB Raptor transit router involved. This creates some kind of conflict in the QSim. From the example:

        Controler controler = new Controler(scenario);

        // Use Swiss Rail RAPTOR transit router
        controler.addOverridingModule(new AbstractModule() {
            @Override
            public void install() {
                install(new SBBQSimModule());
                install(new SwissRailRaptorModule());
            }
        });

        controler.addQSimModule(new TaxiQSimModule());
        controler.addOverridingModule(DvrpModule.createModule(mode,
                Collections.<Class<? extends MobsimListener>>singleton(TaxiOptimizer.class)));

        controler.addOverridingModule(new TaxiModule());

Running this throws an error,

Nov 16, 2018 10:44:09 AM com.google.inject.internal.MessageProcessor visit
INFO: An exception was caught and reported. Message: java.lang.ClassNotFoundException: org.matsim.core.mobsim.qsim.AbstractQSimPlugin
java.lang.TypeNotPresentException: Type org.matsim.core.mobsim.qsim.AbstractQSimPlugin not present
	at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117)
	at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
	at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
	at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
	at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
	at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
	at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68)
	at java.lang.reflect.Method.getGenericReturnType(Method.java:255)
	at com.google.inject.TypeLiteral.getReturnType(TypeLiteral.java:339)
	at com.google.inject.internal.ProviderMethodsModule.createProviderMethod(ProviderMethodsModule.java:263)
	at com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:144)
	at com.google.inject.internal.ProviderMethodsModule.configure(ProviderMethodsModule.java:123)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:349)
	at org.matsim.core.controler.AbstractModule.install(AbstractModule.java:129)
	at org.matsim.codeexamples.router.intermodalTaxi.RunTaxiPTIntermodalExample$1.install(RunTaxiPTIntermodalExample.java:107)

Is there something else I need to do in order to implement these two extensions together? Are they not compatible?

Edit: copying @josiekre

How to calculate the parameters of Utility Function using seven transport modes in MATSim

Dear everyone,
I have used the MATSim for some time.But the Utility function parameters is still not thorough understanding.Except using the default parameters,what method can been used to calculate the parameters? I tried to calculate them by Mlogit Model, but the proportion of transport modes in simulation result is very different with the travel survey data.
Could you give me some good suggestions or the reasion?Are there any cases that can be referenced?
Thank you!

JDEQSIM vs QSIM

I am running a scenario where I set some qsim parameters in the configuration, and then also load the SwissRailRaptor routing algorithm. My output configuration has both of the following sections:

<module name="JDEQSim" >
    <param name="carSize" value="7.5" />
    <param name="endTime" value="undefined" />
    <param name="flowCapacityFactor" value="1.0" />
    <param name="gapTravelSpeed" value="15.0" />
    <param name="minimumInFlowCapacity" value="1800.0" />
    <param name="squeezeTime" value="1800.0" />
    <param name="storageCapacityFactor" value="1.0" />
 </module>
<module name="qsim" >
      <!-- If set to true, creates a vehicle for each person corresponding to every network mode. Howev       er, this will be overridden if vehicle source is fromVehiclesData. -->
     <param name="creatingVehiclesForAllNetworkModes" value="true" />
     <param name="endTime" value="28:00:00" />
     <param name="flowCapacityFactor" value="0.5" />
     <!-- decides if waiting vehicles enter the network after or before the already driving vehicles w       ere moved. Default: false MANY OTHERS -->
</module>

Can someone please explain the difference between JDEQSIM and QSIM, or point me to documentation about the difference? It appears that JDEQSIM was loaded automatically with the SBBRaptor, but maybe not? If I set the flowCapacityFactor because I'm working with a smaller sample, do I have to set it in JDEQSIM also? Which flow capacity did my scenario even run with?

tools to extract pt lines from osm?

Dear MATSim pt experts,

Could you please (1) point me to tools that extract pt lines from OpenStreetMap, and (2) report experiences with those (if available)?

Thanks ...

Injection error

@kainagel can you please give some advice. The following code does not pass the config test. I am not sure if the PlanStrategy via an external file is still supported? Also, if it is supported, I don't know if the MyPlanStrategyModule needs to be in the same folder as the config file.

Config config;
if ( args.length==0 ) {
config = ConfigUtils.loadConfig( "scenarios/equil/pluggablePlanStrategy-config.xml" ) ;
} else {
config = ConfigUtils.loadConfig(args[0]);
}
final Controler controler = new Controler(config);
controler.run();

How to build the PARKing DATA to simulation,please

Dear every,
In order to optimizing the parking price, where could I find a PARKING Example used in MATSim? I just want to konw how to prepare the input files such as Config.xml,parkingFACILITier.xml...,and so on.
Thank you very much!

Issues in running two extensions in the same time

Dear all,

I have no Java background, so I'm sorry for asking something null.

I am facing issues in running matsim and its extensions- Cadyts and DRT- at the same time.
First of all, I was using MATSim GUI, but the outputs seemed to be wrong, especially the counting comparison file, since they counted no vehicles. So I tried to use the cadyts extensions to calibrate, however the counting file didn't t change much, but the scores changed, which was a not bad result.
The problem is that now I need to add another extension with my scenario calibrated by Cadyts, and I don't know how to do that.

Just to certify that I'm not making any mistakes to use the Cadyts Extension, I first added on it as a dependency in my pom.xml. Subsequently I copied the "cadyscar4example.java" into my project, added on it the path to my config.xml file and runned as java application and I got different results and because of that I think I runned cadyts properly.

I know that to use the DRT I also need to add it as dependency in my Pom.xml, however I don't know how to run the DRT with my scenario already "calibrated" by cadyts in java.

Anyone can help me?

Which java version and maven ?

Dear all,

I have clone the project and then tried to build it in terminal :
mvn verify

But I have errors : java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I have also tried this tutorial : https://www.matsim.org/docs/devguide/eclipse/
Many error building on Eclipse or directrly Maven (For example : src/main/java/org/matsim/jaxb/lanedefinitions20/XMLCoordinateType.java:[13,32] error: package javax.xml.bind.annotation does not exist)

I am using

  • Java SE 11 (LTS) (jdk-11_linux-x64_bin.tar.gz)
  • Maven : apache-maven-3.3.9

Which versions are known to work ?

Thank you

Difference between "type" and "hbefa_road_type"

AV and parking

Hi, I would like to include parking utility in my project (I wanna assume certain number of space in each link and let AV park for vacant space when it becomes idle)?

Support for merging multiple public transport schedules (with pt2matsim)?

I need to merge several GTFS feeds because we want to use GTFS data sets from neighboring regions in a single simulation.

After having a look at the pt2matsim process I think the best place to do this is in an additional step before invoking PTMapper, which handles merging the unmapped transitSchedule.xml (and the vehicleDefinitions.xml). A simplistic approach would be to merge the relevant files (e.g. via xslt). A more sophisticated approach could handle duplicate ids (e.g. vehicleDefinitions>vehicle>id can easily be the same in multiple files).

I wanted to ask if someone already did this before / if there already is an established way to achieve this?

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.