ATTENTION

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.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Flexsim Student Forum
Downloads

Flexsim Student Forum Forum for discussion for Flexsim Students using the Flexsim Textbook.

  #1  
Old 07-21-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default How to return a pointer to a task executer

Here is what I am trying to do. I want the Multiprocessor to randomly pick an operator (a nurse) and the operator should come to the multiprocessor (a bed) and decide the process time. Someone told me that it is not possible to do in Flexsim with the way it is structured, since the operator an only be called only after once everything else about that process has been decided... So I thought of a work around..
Now I am going to insert a small 1 minute process before the main process. Call an operator for it..Identify it and store it in a label.. Retain operator for the next process and then use the label to decide the process time.. The problem is I am not sure how to identify and then retain the operator..
Can anyone help ??
  #2  
Old 07-21-2012
syseo's Avatar
syseo syseo is offline
Flexsim User
 
Join Date: Aug 2007
Location: Korea
Posts: 290
Downloads: 439
Uploads: 0
Thanks: 249
Thanked 63 Times in 41 Posts
Rep Power: 211
syseo has a spectacular aura aboutsyseo has a spectacular aura about
Default You can do it using Task Sequence...

If you can usethe label of the multiprocessor, you can do it using task sequence.
You can find how to use task sequence when doing task sequence tutorial in help user manual file (Help>user manual>Task Sequence Tutorial).

Before the operator(or the multiprocessor) use the process time, you should set the value of it to the label.

Best regards.
  #3  
Old 07-21-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

there is not just one multiprocessor using these operators there are 25 of them each representing a Bed.. the multiprocessor calls an operator (nurse) from a dispatcher which deals with 9 different kinds of nurses.. Each nurse has to take her own time to complete a process.. This is what I am looking to model... I cannot fix the type of nurse which will attend to the patient (item)... it has to be random..
I appreciate the fact that u replied but can u be a little more elaborate in what u r trying to say..
  #4  
Old 07-21-2012
syseo's Avatar
syseo syseo is offline
Flexsim User
 
Join Date: Aug 2007
Location: Korea
Posts: 290
Downloads: 439
Uploads: 0
Thanks: 249
Thanked 63 Times in 41 Posts
Rep Power: 211
syseo has a spectacular aura aboutsyseo has a spectacular aura about
Default if the process time is not fix but random value, you can define the randon distribution function in flexsim

You can define or set the statistical function of the flexsim like normal or exponential to the label.
When you call the nurse, you can do it right before.

You upload the exercise model.
  #5  
Old 07-21-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

Thats a smart idea.. But the multiprocessor can only choose nurses on the basis of availability.. If I use a random number to choose the value of the label it will not take this into account.. I want to use a smarter way to do it.. I have not built the full scale model yet as I wanted to figure this out first.. Will upload a sample model soon..
Till then I ll re-phrase my question... I want to determine the process time of process 2 based on the operator called for process 1.. And I want to retain that operator for process 2 as well..
  #6  
Old 07-22-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

you are at the same point as at my last post. You have to build your own tasksequence. A start is the picklist template "pick operator with animation".
Important commands are requestoperators, freeoperators, TASKTYPE_UTILZE, TASKTYPE_STOPREQUESTFINISH, TASKTYPE_SENDMESSAGE. Look at the manual for these commands.
If you put a sendmessage task in your own tasksequence, you receive a message in the OnMessage trigger of the multiprocessor. With the command msgsendingobject() you get a reference to the operator which is arriving at your processor.
If you don't free the operators at the processfinish (Trigger: pick operator) the operator stays at the multiprocessor. you execute this command only at the last process.

Jörg
  #7  
Old 07-23-2012
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default Tagged Resource

You can do this much easier in version 6 by using the "Tagged Resource" picklist options.

The "Pick Operator" and "Request Transport From" fields now have pick options called "Tagged Resource". These options write a label to the flowitem so that it knows which operator is working on the task.

An example of when this would be useful:
If you want the operator who carried a flowitem to a processor to stay at that processor for the processing time.

To do this, you just tag the resource in the Request Transport From, and then use this tagged resource again in the Pick Operator. Because you don't want that operator to be called away to do something else between these two operations, you set the "Hold" option to 1 on the transport and to 0 on the pick operation.

You can use this same mechanism to solve this problem easily. To do that, I added some custom code to the Process Time field to read a label off the tagged operator.

Attached is a sample that shows both operations (done almost entirely with pick lists).
Attached Files
File Type: fsm tagged_resource.fsm (68.1 KB, 844 views)

Last edited by Phil BoBo; 11-18-2015 at 09:56 AM. Reason: reattaching file
The Following User Says Thank You to Phil BoBo For This Useful Post:
Sebastian Hemmann (07-24-2012)
  #8  
Old 07-25-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

Can you explain me what do I do after writing this much code at the pick operator field to retain the operator for the next process...

treenode callnurse = createemptytasksequence(centerobject(current,1),0, 0);
inserttask(callnurse,TASKTYPE_TRAVEL,current,NULL) ;
inserttask(callnurse,TASKTYPE_SENDMESSAGE,current, NULL,0,0,0,0);
inserttask(callnurse,TASKTYPE_UTILIZE,item,NULL,ST ATE_UTILIZE);



Quote:
Originally Posted by Jörg Vogel View Post
you are at the same point as at my last post. You have to build your own tasksequence. A start is the picklist template "pick operator with animation".
Important commands are requestoperators, freeoperators, TASKTYPE_UTILZE, TASKTYPE_STOPREQUESTFINISH, TASKTYPE_SENDMESSAGE. Look at the manual for these commands.
If you put a sendmessage task in your own tasksequence, you receive a message in the OnMessage trigger of the multiprocessor. With the command msgsendingobject() you get a reference to the operator which is arriving at your processor.
If you don't free the operators at the processfinish (Trigger: pick operator) the operator stays at the multiprocessor. you execute this command only at the last process.

Jörg

Last edited by mearjun; 07-25-2012 at 01:55 PM.
  #9  
Old 07-25-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

Thanks Phil for replying, but at this stage I am afraid of upgrading to the next version and learn it again.. Moreover I am not even sure if I can upgrade as this is a University license that I am working with..
Quote:
Originally Posted by Phil BoBo View Post
You can do this much easier in version 6 by using the "Tagged Resource" picklist options.

The "Pick Operator" and "Request Transport From" fields now have pick options called "Tagged Resource". These options write a label to the flowitem so that it knows which operator is working on the task.

An example of when this would be useful:
If you want the operator who carried a flowitem to a processor to stay at that processor for the processing time.

To do this, you just tag the resource in the Request Transport From, and then use this tagged resource again in the Pick Operator. Because you don't want that operator to be called away to do something else between these two operations, you set the "Hold" option to 1 on the transport and to 0 on the pick operation.

You can use this same mechanism to solve this problem easily. To do that, I added some custom code to the Process Time field to read a label off the tagged operator.

Attached is a sample that shows both operations (done almost entirely with pick lists).
  #10  
Old 08-11-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default help

Hello everyone.. I have attached the model I was trying to run.. (exp) Please look at the multiprocessors.. what I have observed so far is that although the Multiprocessor does call an operator as I want it to.. It starts the process before the operator has even reached it..
I also tried to build a fresh model and write a very small task sequence.. In that model, the multiprocessor calls both the operators even when I havent asked it to do so.. I had asked it free the operators on process finish trigger but to no avail.. Please also find this model attached (by the name of "1")
Attached Files
File Type: fsm exp.fsm (84.7 KB, 146 views)
File Type: fsm 1.fsm (47.9 KB, 139 views)
  #11  
Old 08-13-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Arjun,

if you want to start the process at arrival of the taskexecuter (nurse) you stop the object and resume the object with the tasktype STOPREQUESTFINISH in your task sequence.

If you don't change the nurse for different processes, you don't have to dispatch new tasksequences to the nurse. But you free the operator only at your last process. The utilze task stops with the command freeoperators.
As i observed, you have a reference to the active nurse. you can use this reference to free the nurse.

A freed operator does nothing. So it seems that she still stands next to processor and work. If you you want the operator move to some place, you have to dispatch a new tasksequence to that operator or you add a task after the utilze task in which you let travel the operator.

Jörg
  #12  
Old 08-13-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

So there are two things i interpret from this.. I do not need to write a new task- sequence for the main process as the operator is in the utilize state.. Once i free the operator, shouldn't he be assigned the next task sequence automatically by the dispatcher.. In th sample model that i had posted i use 2 nurses to cater to 4 multiprocessors.. S if the nurse is freed by the first multiprocessor should she not be automatically be available for the next multiprocessor..


I m still unable to understand how the stoprequestfinish task works..
Also i am unable to understand that when i write a simple task sequence as well.. The multiprocessor starts processing the item b4 the operator even reaches it..Although it does call the operator but does not wait for it to start the process..
I know it might be too much but can u write me a sample task- sequence.. All i want to do is call an operator for a dummy process.. Identify it and decide the process time for the main process on its basis while also retaining it for the main process..
  #13  
Old 08-14-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Tasksequence Dummy process:
Sendmessage // you know the Nurse OnMessage trigger
// OnMessage set Label Pointer to the Nurse
// OnMessage stopobject dependent to the current processing item
travel //to the Processor
stoprequestfinish // the Processor and the Processing item
utilize //

please Look into the command help and Manual on stoprequestfinish, stopobject, resumeobject, freeoperators,
  #14  
Old 08-14-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

As per your suggestions I tried using the stopobject command after the first process. This is what I wrote:

On processfinish Trigger:
if (opnum == 1) stopobject(current,STATE_WAITING_FOR_OPERATOR);
if (opnum == 3) freeoperators(centerobject(current,1),item);

As u can see I have freed the operator after the third and the main process only (2nd is the dummy process),

On the pick operator picklist option I wrote the following code:

treenode callnurse = createemptytasksequence(centerobject(current,1),0, 0);
inserttask(callnurse,TASKTYPE_TRAVEL,current,NULL) ;
inserttask(callnurse,TASKTYPE_SENDMESSAGE,current, NULL,0,0,0,0);
inserttask(callnurse,TASKTYPE_STOPREQUESTFINISH,cu rrent);
inserttask(callnurse,TASKTYPE_UTILIZE,item,NULL,ST ATE_UTILIZE);
dispatchtasksequence(callnurse);

Still I am facing the same problem, the multiprocessor does not stop after the first process.. instead it goes on without waiting for the operator and then gets blocked at the end.
I tried to use the stopobject command on another multiprocessor, asked it to go into state 9 (Waiting_for_operator) state... yet it shows in the blocked state instead..

As per your suggestions I have read the command manual for the suggested commands thoroughly again. Yet I am still stuck.. Please rescue..
  #15  
Old 08-14-2012
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

When I use the stopobject(current,9) command on entry trigger.. it works as intended.. however when I do so at the Process finish Trigger using if opnum == 1 condition, it does not seem to fire then.. however it does block the output of the multiprocessor.. Why does this happen ??
  #16  
Old 05-02-2013
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Phil,

this is on the model you posted earlier in this thread:
Tagging a resource seems to work as long as you start with a transport to tag. I changed the behavior of the model assuming no transport is required from the queue to the processor.
Now the first task tagging the operator has to be the process itself.
What happens is, that the processor is not waiting for the operator to arrive, but starts processing by itself. Once the operator reaches the processor it restarts the process time...is this a bug or did I make a mistake?

Thanks in advance

Ralf
FlexSim Germany
Attached Files
File Type: fsm tagged_resource_RG.fsm (68.3 KB, 109 views)
  #17  
Old 05-02-2013
Matt Long Matt Long is offline
FlexSim Development
 
Join Date: Apr 2012
Posts: 66
Downloads: 37
Uploads: 29
Thanks: 2
Thanked 150 Times in 40 Posts
Rep Power: 192
Matt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of light
Default

Ralf,
It looks like there is a bug in the Tagged Resource option of the Pick Operator picklist on the processor. Line 28 should read:

stopobject(current, STATE_WAITING_FOR_OPERATOR, OPERATOR_STOP_ID);

This error has now been fixed for the next release of FlexSim.
The Following User Says Thank You to Matt Long For This Useful Post:
RalfGruber (05-02-2013)
  #18  
Old 05-04-2013
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Matt,

first thanks for your reply. That works well and the processor is waiting for the operator to arrive now. But it seems to me that there is another bug, which isn't really visible in that configuration:
When you have a process as the first task to tag an operator, the operators reference is not stored in the label and the dispatcher will be used to choose another one for the following task. I didn't investigate that further so far.
Can you make sure this feature works properly for the next release since this is one really being high valued from customers? Let me know, if you want me to build a model to explain the bug further.

Thanks and have a great weekend.

Ralf
FlexSim Germany
  #19  
Old 05-06-2013
Matt Long Matt Long is offline
FlexSim Development
 
Join Date: Apr 2012
Posts: 66
Downloads: 37
Uploads: 29
Thanks: 2
Thanked 150 Times in 40 Posts
Rep Power: 192
Matt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of lightMatt Long is a glorious beacon of light
Default

A demonstration model would be useful. I played around with it, but I can't really find the issue.

Tags
operator, pointer, task executor


Thread Thread Starter Forum Replies Last Post
A Task Executer should receive two tasksequence from dispatcher... syseo Q&A 10 07-14-2012 01:03 PM
Transporter Problem (Invalet Pointer) Peppino Q&A 3 05-05-2012 12:36 AM
Storing a C++ class pointer in a flexsim object Steven Hamoen Q&A 2 04-15-2010 09:19 AM
task executer juan alberto Pre-sales Questions 1 06-01-2009 07:06 PM
I think an easy question... - how to pointer to objects david_white Q&A 21 08-18-2008 12:20 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.