I am modeling distributed computation using Wolfram Physics project.
I have actors with memory, which compute their state and send messages to each other. All of this represented by a directed graph.
We can't know for sure in which order events gonna happen, and Wolfram Multiway System does perfect job simulating all possibilities, and providing states graph.
However, my distributed system uses timers. Even though messages can be lost and reordered, I assume that timers always work for each actor.
However, MultiwaySystem
tries to apply all rules, and produce all kinds of possible states, even scenarios when timer event didn't happen.
I would like to filter out such branches of state evolution, otherwise state graph gonna be too cluttered.
How do I do that?
I came to conclusion that there are two options:
- Filter out resulting graph. Look at each state. If at least one of the possible applied rules is a timer rule, then disregard all others. That would require some additional filtering of the resulting graph.
- Find a way to set priority for rules. If there is at least one priority rule that can be applied, apply only it (timer rule). Disregard others.
Second options looks cleaner. I found that there is some kind of selection function that is used in Wolfram MultiwaySystem: https://resources.wolframcloud.com/FunctionRepository/resources/MultiwayFunctionSystem/. However, it doesn't seems like available options would suit me.
Do you have any ideas how I could approach this problem?