faq 240386049 - billyc/matsim-wiki-test GitHub Wiki
by wdg on 2018-03-21 06:38:35.492
Hi,all
When I use and run the "RunCarsharing" which is in the carsharingRelocation branch, the program will proceed with errors, if I change the first person's traffic mode from "car" to "oneway" (which is in the 10persons.xml). Of course, I add some oneway stations in the CarsharingStations.
The input files and errors are all shown below.
2018-03-21 14:14:18,534 ERROR AbstractController:210 Mobsim did not complete normally! afterMobsimListeners will be called anyway. java.lang.ClassCastException: org.matsim.core.population.routes.LinkNetworkRouteImpl cannot be cast to org.matsim.contrib.carsharing.router.CarsharingRoute at org.matsim.contrib.carsharing.manager.CarsharingManagerNew.reserveAndrouteCarsharingTrip(CarsharingManagerNew.java:81) at org.matsim.contrib.carsharing.qsim.CarsharingPersonDriverAgentImpl.endActivityAndComputeNextState(CarsharingPersonDriverAgentImpl.java:76) at org.matsim.core.mobsim.qsim.ActivityEngine.doSimStep(ActivityEngine.java:116) at org.matsim.core.mobsim.qsim.QSim.doSimStep(QSim.java:353) at org.matsim.core.mobsim.qsim.QSim.run(QSim.java:226) at org.matsim.core.controler.NewControler.runMobSim(NewControler.java:111) at org.matsim.core.controler.AbstractController$7.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$000(AbstractController.java:29) 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:75) at org.matsim.core.controler.Controler.run(Controler.java:202) at runCarsharing.runCarsharing.main(runCarsharing.java:78)
I really appreciate your help.
Sincerely.
by Milos Balac on 2018-03-21 09:18:00.323
Dear wdg,
You cannot just replace the name of the leg, you also need to replace the route type to carsharing. Also other parameters need to look similar to this:
<leg mode="oneway">
<route type="carsharing" start_link="93812" end_link="38417" trav_time="undefined" distance="NaN">null keepthecar=false company=null</route>
</leg>
Hope this helps. And please try to keep the questions under the same post if they are related.
Best,
Milos