Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with cadyts contrib #27

Closed
LorenaBR opened this issue Nov 3, 2018 · 3 comments
Closed

Issues with cadyts contrib #27

LorenaBR opened this issue Nov 3, 2018 · 3 comments

Comments

@LorenaBR
Copy link

LorenaBR commented Nov 3, 2018

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

@golanbendor
Copy link

golanbendor commented Nov 3, 2018

Are you using PT in your simulation?

If so, PT doesn't have any plans (like a regular agent has) so this could explain why you are getting the java.lang.NullPointerException from line 131 in the class PlansTranslatorBasedOnEvents.java:
Plan selectedPlan = person.getSelectedPlan();

This is a known issue - more details and a possible fix here:
https://matsim.atlassian.net/browse/MATSIM-648

@LorenaBR
Copy link
Author

LorenaBR commented Nov 5, 2018

Hello again,
Yes, i'm using PT simulation and I want to use Cadyts to work with a scenario that simulates public transit vehicles as regular vehicles on links. (transit vehicles pass a count station the same way as private cars)

I believe I did what you recommended correctly,
I defined - ((person == null)? return - in the PlansTranslatorBasedonEvents, but the same error in the same place (L131) happened .. it seems the change I made did not work .

I don't know if i did something wrong or actually to put (person=null) return it will not make difference in my case.

Do you know anything else I can do?
Follow my logfile.

logfileWarningsErrors2.txt

Thanks for any help!!

@kainagel
Copy link
Contributor

kainagel commented Nov 6, 2018

I defined - ((person == null)? return - in the PlansTranslatorBasedonEvents, but the same error in the same place (L131) happened .. it seems the change I made did not work .

if ( person == null ) return ;

is probably not the same as what you tried with ? and :; see here:

https://stackoverflow.com/questions/18124745/java-ternary-operator-and-nullpointerexception

Your code is not exactly the same as that one, but since you did not give the full code I cannot really tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants