ATTENTIONThis 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. |
flexsim.com |
#1
|
||||
|
||||
Remove a tasksequence from a tasksequencequeue?
Is there any way to remove a tasksequence from a tasksequencequeue?
The commands gettasksequencequeue() and gettasksequence() can return the reference of a tasksequence. But I did not find a command to remove the tasksequence. Thanks. Alan |
#2
|
||||
|
||||
Alan,
The short answer is yes. Care should be taken anytime you "delete" anything abnormally but with that said, all you need to do is make sure you reference the node that has the task you want to delete and do a destroyobject() on that node.
__________________
Jeff Flexsim Support |
#3
|
||||
|
||||
Quote:
Alan |
#4
|
||||
|
||||
Alan,
It's probably just a matter of how you are referencing the node. The way you can "prove" to yourself that is does work is to pause your model when your task executer has task sequences. Open a tree view of the task executer and open up the tasksequencequeue node (cued up task sequences). Right click on the node icon of the task sequence you want to delete and designate it as the so() node. Then open a Script window and type in the command: destroyobject(so()); You should see that node disappear. So I'm guessing that it's just a matter of how you are referencing that node in your code.
__________________
Jeff Flexsim Support Last edited by Jeff Nordgren; 08-09-2007 at 02:39 PM. |
#6
|
||||
|
||||
More questions...
If a dispatcher is used, there is no tasksequence nodes under tasksequencequeue treenode in either the dispatcher or connected operators. So where is the tasksequencequeue of the dispatcher? How do I know how many tasksequences is in the queue of the dispatcher? How to get the reference of these tasksequences? Thanks. Alan |
#7
|
||||
|
||||
Alan,
If you send a tasksequence to a dispatcher and the transporter/operator can execute it immidiately it will be placed in the node "activetasksequence" of the taskexecuter. That is the node where you find the tasksequences that are currently being executed. Because the dispatcher can't execute a tasksequence it doesn't has this node. If you send more than 1 tasks you will see that they are queued up, either in the tasksequencequeue of the dispatcher or if you create a custom passto that sends them on immediately, you find them in the tasksequencequeue of the transporter. Regards, Steven |
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
shafizad (10-16-2010) |
#8
|
||||
|
||||
Steven,
You are right. I made a small model to see the tasksequencequeue for dispatchers and operators. And I saw tasksequence nodes under the tasksequencequeue treenode of both dispatcher and operator. And the number of task sequences in the queue is actually drawn beside these task executors with small dots. A small secret of Flexsim! Thanks again! Alan |
#9
|
||||
|
||||
User Command to remove Tasksequences
Hi,
I tried to solve a problem which is on my list for quite a long time, using the getutilzedOperator - command from Tom. If you try to put up a modell where the processors have cycletimes exceeding the shiftmodell and you want the OPs also to work on other processes it is necessary to free the OPs before stopping the processor. This can be easily done with this very nice getutilizedoperator command. While one group of processors is down the operators move over to the second group and start to be utilzed. When the first group of processors starts to work again, they will request operators. If those Operators are not available and the processors need to go down again, there is still the tasksequence requested in the dispatcher. So I put up a user command to remove all task from the taskseuqence queue of the dispatcher for a certain object. Works well so far. (please see attached modell). But after a few cycles the processors stays in the state "Waiting for operator" while the operators get utilized... ?? Can some one explain to me what went wrong?? Thanks.. P.S. (there are some debugging message in the output console)
__________________
kind regards Nico. Last edited by Nico Zahn; 10-18-2007 at 05:48 AM. |
#10
|
||||
|
||||
Hi Nico,
Did you forgot attaching your model? Or you have uploaded to somewhere? It is a interesting discussion. A sample model would be very helpful. Alan |
#12
|
||||
|
||||
Hi Nico,
Your problem is really an interesting one. If I understand it correctly, the main problem is that the processor's state is not set correctly. The reason is that when you resume the object, the object will go into whatever previous state when it is stopped (with matched id). The requestoperators() command will create a tasksequence which will pass to an operator. In that tasksequence, the following tasks will be created (see more details in the requestoperators command help): 1. put a preempt "bookmark" in the task sequence (TASKTYPE_MILESTONE) 2. travel to the station (TASKTYPE_TRAVEL) 3. resume the station (TASKTYPE_STOPREQUESTFINISH) 4. be utilized at the station (TASKTYPE_UTILIZE) Since there is no task to set station's state, the state of station will not be changed (I guess, for a standard processor, it has its own logic to set the station's state and request operators). That's why you see the the processor is in the state of waiting_for_operator when the operator is utilized for that station. In my attached model, in the Resume Function, I simply duplicate the requestoperator logic, but insert one more task to set the processor's state. The main code in the Resume Function of your Timetable and Timetable2 is something like: Code:
....... // utilize OPs //requestoperators(disp,downobject,item,1,0,0); // instead of use requestoperators(), create our own task which will set processor state treenode statenode = state_current(downobject); stopobject(downobject, STATE_WAITING_FOR_OPERATOR, 100002); // need to go into STATE_WAITING_FOR_OPERATOR because unless operator arrives, the process cannot be really resumed treenode newts = createemptytasksequence(disp,0,0); inserttask(newts, TASKTYPE_MILESTONE,NULL,NULL,3); inserttask(newts, TASKTYPE_TRAVEL, downobject, NULL, 0, 0); inserttask(newts, TASKTYPE_STOPREQUESTFINISH, downobject, NULL, 0, 100002, 0, 0); inserttask(newts, TASKTYPE_SETNODENUM, statenode, NULL, STATE_PROCESSING, 0); // set the processor state inserttask(newts, TASKTYPE_UTILIZE, item, downobject,0); dispatchtasksequence(newts); ....... Have fun! Alan |