You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recenly I started to look for ways to artificially delay agents that enter or leave PT stops which may be under/over the ground. Upon code inspection I figured that there are few relatively new methods responsible for handling access and egress times (in the core library and in raptor algorithm).
When running first simulation though (pt-tutorial with added stop attributes accessTime and egressTime), MATSim gave me an error about being unable to cast variable to another data type - it was indeed wrong, I needed to reference Double instead of Integer. This is how transitSchedule looks now:
What was weird, that the error happened after the first iteration, when replanning for the second one:
...
2024-09-04T16:29:31,355 INFO AbstractController:184 ### ITERATION 0 ENDS
2024-09-04T16:29:31,355 INFO AbstractController:185 ###################################################
2024-09-04T16:29:31,355 INFO AbstractController:136 ###################################################
2024-09-04T16:29:31,355 INFO AbstractController:137 ### ITERATION 1 BEGINS
2024-09-04T16:29:31,355 INFO ControlerListenerManagerImpl:156 calling notifyIterationStarts on org.matsim.analysis.LegHistogramListener with priority 0.0
2024-09-04T16:29:31,355 INFO ControlerListenerManagerImpl:156 calling notifyIterationStarts on org.matsim.analysis.LinkStatsControlerListener with priority 0.0
2024-09-04T16:29:31,355 INFO ControlerListenerManagerImpl:156 calling notifyIterationStarts on org.matsim.core.replanning.ReplanningContextImpl with priority 0.0
2024-09-04T16:29:31,355 INFO ControlerListenerManagerImpl:156 calling notifyIterationStarts on org.matsim.core.scoring.ScoringFunctionsForPopulation$$Lambda$262/0x00000205ba383890 with priority 0.0
2024-09-04T16:29:31,357 INFO ControlerListenerManagerImpl:156 calling notifyIterationStarts on org.matsim.core.scoring.ExperiencedPlansServiceImpl$1 with priority 0.0
2024-09-04T16:29:31,357 INFO ControlerListenerManagerImpl:159 [it.1] all ControlerIterationStartsListeners called.
2024-09-04T16:29:31,358 INFO ControlerListenerManagerImpl:221 calling notifyReplanning on org.matsim.core.controler.corelisteners.PlansReplanningImpl with priority 0.0
2024-09-04T16:29:31,358 INFO RandomizingTimeDistanceTravelDisutilityFactory:86 sigma: 3.0; resulting normalization: 0.011108996538242306
2024-09-04T16:29:31,359 INFO RandomizingTimeDistanceTravelDisutilityFactory:86 sigma: 3.0; resulting normalization: 0.011108996538242306
2024-09-04T16:29:31,368 INFO GenericPlanStrategyImpl:135 Plan-Strategy finished, 626 plans handled. Strategy: BestPlanSelector
2024-09-04T16:29:31,368 INFO AbstractMultithreadedModule:142 [PlanRouter] starting 2 threads, handling 83 plans
2024-09-04T16:29:31,372 INFO Counter:70 [PlanRouter] handled plan # 1
2024-09-04T16:29:31,372 ERROR AbstractMultithreadedModule$ExceptionHandler:211 Thread PlanRouter.0 died with exception. Will stop after all threads finished.
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Double (java.lang.Integer and java.lang.Double are in module java.base of loader 'bootstrap')
at org.matsim.pt.transitSchedule.TransitScheduleUtils.getStopAccessTime(TransitScheduleUtils.java:44) ~[matsim-2024.0.jar:?]
at ch.sbb.matsim.routing.pt.raptor.DefaultRaptorStopFinder.lambda$findAccessStops$0(DefaultRaptorStopFinder.java:109) ~[matsim-2024.0.jar:?]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
at ch.sbb.matsim.routing.pt.raptor.DefaultRaptorStopFinder.findAccessStops(DefaultRaptorStopFinder.java:113) ~[matsim-2024.0.jar:?]
at ch.sbb.matsim.routing.pt.raptor.DefaultRaptorStopFinder.findStops(DefaultRaptorStopFinder.java:91) ~[matsim-2024.0.jar:?]
at ch.sbb.matsim.routing.pt.raptor.SwissRailRaptor.findAccessStops(SwissRailRaptor.java:250) ~[matsim-2024.0.jar:?]
at ch.sbb.matsim.routing.pt.raptor.SwissRailRaptor.calcRoute(SwissRailRaptor.java:91) ~[matsim-2024.0.jar:?]
at ch.sbb.matsim.routing.pt.raptor.SwissRailRaptorRoutingModule.calcRoute(SwissRailRaptorRoutingModule.java:70) ~[matsim-2024.0.jar:?]
at org.matsim.core.router.TripRouter.calcRoute(TripRouter.java:180) ~[matsim-2024.0.jar:?]
at org.matsim.core.router.PlanRouter.run(PlanRouter.java:95) ~[matsim-2024.0.jar:?]
at org.matsim.core.replanning.modules.AbstractMultithreadedModule$PlanAlgoThread.run(AbstractMultithreadedModule.java:235) ~[matsim-2024.0.jar:?]
at java.base/java.lang.Thread.run(Thread.java:842) [?:?]
...
When running further iterations with attributes class corrected to Double errors did not pop up.
Does it mean that access and egress times are not considered for the first iteration? How do I make sure this functionality works at all, and what does it really affect? Events or trips analysis didn't reveal any apparent change, agents proceed to walk right after exiting the vehicle or start waitingForPt after arrival to a stop. The smallest wait_time in output_trips.csv.gz file was just around 10 seconds, which is way less than accessTime that was set to 75.
Thank you for explanation in advance!
The text was updated successfully, but these errors were encountered:
Hello fellow MATSim users and developers!
Recenly I started to look for ways to artificially delay agents that enter or leave PT stops which may be under/over the ground. Upon code inspection I figured that there are few relatively new methods responsible for handling access and egress times (in the core library and in raptor algorithm).
When running first simulation though (pt-tutorial with added stop attributes
accessTime
andegressTime
), MATSim gave me an error about being unable to cast variable to another data type - it was indeed wrong, I needed to reference Double instead of Integer. This is how transitSchedule looks now:What was weird, that the error happened after the first iteration, when replanning for the second one:
When running further iterations with attributes class corrected to Double errors did not pop up.
Does it mean that access and egress times are not considered for the first iteration? How do I make sure this functionality works at all, and what does it really affect? Events or trips analysis didn't reveal any apparent change, agents proceed to walk right after exiting the vehicle or start
waitingForPt
after arrival to a stop. The smallestwait_time
inoutput_trips.csv.gz
file was just around 10 seconds, which is way less thanaccessTime
that was set to 75.Thank you for explanation in advance!
The text was updated successfully, but these errors were encountered: