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.
Sample Example for an Operator who travels through a network and picks specific items. Items arrive in the source and put randomly into the queues (QueueOut). There an order is generated to pick this items. An Operator travels through the network and checks, if there are items he has to pick depending on his order list. After he checked at all modules he unloads all the items at the Sink.
Global Variable NumberOfPickOrders is the number of Orders which have to be in the tree node PickOrderQueue under Tools (content of this node) before an operator is send to pick orders.
In the UserEventInit the tree node PickOrderQueue is emptied on reset.
The source creates flowitems and put them randomly into the queues of the different modules. If an item arrives in a queue a PickOrder is generated and put into the PickOrderQueue (tree node under Tools). If the NumberOfPickOrders is reached an Operator gets a tasksequence to travel to the first network node. This is done in OnMessage of the DispatcherOperator.
The operator gets also the information from the PickOrderQueue under Tools into his own tree under PickOrderQueue at OnRessourceAvailable on object DispatcherOperators (command transfernodes()). This information is used to check if he needs to pick something from a specific module. OnReset this node is cleared.
If the Operator arrives at a network node of a Module (Visual Tool with a Queue) it is checked (OnArrival), if the operator has to pick an item from this module (compare the name of the Module (written in a label on the NetworkNode at OnReset of the Module RelatedModuleName and RelatedModulePointer) and the name of the modules in his PickOrders where he is supposed to collect something.
If it is the case that he needs to collect something he loads the flow item and travels further through the network. If he does not need to pick anything he just travels further down the network. This is done with next(current) which means that the next network node needs to be the next one in the tree.
Attention:
It is really important, that the NetworkNodes of the Modules are next to each other. There is also a NetworkNode NN_BeforeModules and NN_AfterModules which have special functionality and "frame" the NetworkNodes of the Modules.
The first NetworkNode before the Module NetworkNodes is the target for the first travel tasksequence and the operator is than just send to the first Module NetworkNode.
The first NetworkNode after the Module NetworkNodes OnArrival generates a tasksequence, that the operator travels to the Sink and unload all his items.
Attention:
Do not delete or rename the object Logo_FlexsimD, because otherwise the model will not work correctly. Also do not rename, delete or rerank other objects.