This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.
This model is an example for taskexecuters which using a network but they are not able to use a specific path because this path is occupied by another taskexecuter.
In the model the taskexecuters are operators.
At the object QueueIn at the Flow Tab | Use Transport | Request Transport you can easily change if the operator is using an alternative route or not. There is code for both situtations so you can just flip the code by making one of the lines a comment.
4 products with itemtype 1 to 4 arrive at the QueueIn. The first three products need a process at a specific processor.
The items use for the transport to a processor a specific operator.
If an operator is at a processor working this way/path is blocked.
This is done by controlling the nodeedges (closing the nodeedges). If the process is finished the nodeedges will be open again.
The code for this is in on the Network Nodes.
The way/path is only blocked if the operator is working on the processor. In other words this way/path can be used if both operator travel.
The fourth item type needs no process and will directly transport to the Sink (which is a processor). After staying in this processor for a short time the item will arrive again in the QueueIn. A processor is used to not immediately create a new tasksequence for this item/operator.
The operator (orange) for the fourth item type gets the standard tasksequence to use the shortest way which will use the path at Processor 1 (green).
But because this path is blocked, the operator will get a new tasksequence on Network Node 2 (NN2). So the operator will redirect to NN6.
If this path to NN6 is also blocked the operator gets redirect to NN9, if this one is also blocked he gets redirect to NN12 from where he will go to the Sink.
The redirection of the operator is done by creating an additional tasksequence. Depending on the situation the active tasksequence is kept and put into the tasksequencequeue or deleted (already alternative route).
It is not possible to create the tasksequence directly in the On Arrival trigger therefore the On Message trigger is used.
So the general idea is, as long as paths are blocked by a working operator the travel operator has to use another route which will given to him by a tasksequence on the Network Nodes.
There is a Tree Node Array defined for the Network Nodes under Global Variables to easily reference to them.
For the transport is a dispatcher used to assign the operator but it is done by item type to get the specific operator.
For the process no dispatcher is used to always get the right, specific operator.
Attention:
Do not delete or rename the object Logo_FlexsimD, because otherwise the model will not work correct. Also do not rename, delete or rerank other objects.