1
votes

I have a model in which an agent (Person) flows through a flowchart (Process modeling library). I want to update the transition probability of a statechart in Person according to Person's position in the flowchart. How do I do that?

I believe I have to use OnChange() to let the engine recalculate the transition probabilities, but otherwise I do not know how to implement this.

As illustration, two screenshots from an example model:Flowchart and Statechart.

So what I want is that Person's transition probability in the statechart is different according to which branch of the flowchart it is. That is to say, all instances of Person start with the same transition probabilities, but once they reach a specific point in the flowchart, the transition probabilities should be updated.

1

1 Answers

2
votes

There are 2 options:

You can send the agent to a different state depending on the block, each state has a different rate towards the new state. (on enter block you do send("message",agent) to move from one state to the other)

option 1

The second option is to create a variable called rate and assign it to the transition. Every time you move to a new block, in the on enter action you do rate=whateverRateYouWant; send("message",agent);

The message will make the transition to the same block you are in and it will update the rate. option 2

Remember: once the rate is defined, you can't change it unless you reenter the state in which the transition rate is defined.