Chloe
Chloe

Reputation: 83

Did any one work with Branch using anylogic?

I'm modeling a consumer's behaviour using statechart. I used "branch" to model two options which are :

1) buy a product if it does exist
2) leave the retailer if it doesn't exist.

However, when I simulate, It tells me NullPointException Java.lang.NullPointerException. When I click on it, I find that the problem is into the branch (described in pictures below), Has anyone gone through this, or does any one have some solutions ? Pictures below show in detail what I 've written and what I got as a result Thanks ^^

My statechart that represents the behaviour of consumer

what I got when I click on Consumer.java:321 in the console

What I got when I click on Consumer.java:408 in the console

Upvotes: 0

Views: 129

Answers (1)

Felipe
Felipe

Reputation: 9421

it means that retailer is null... which means that at that point in time, you variable retailer has no value in it

Debug your model with the objective of being sure that you are assigning a value to the retailer variable.

Upvotes: 1

Related Questions