In my model, I acquired an operator, and next I want to set his/her state to busy. I tried using a custom code block but when I run the program the operator's state stays busy. I have tried changing the object reference but no luck.
In my model, I acquired an operator, and next I want to set his/her state to busy. I tried using a custom code block but when I run the program the operator's state stays busy. I have tried changing the object reference but no luck.
@Kari Payton, you may need to clarify what is going on. It sounds like the code is doing what you want it to do - changing the state of the Operator to busy. Is the issue that the state stays as busy when you want it to change to something else?
@Logan Gold I want it to say busy, but when i click on the operator it says idle.
In one of my models I used Custom Task =>TaskType Utilize and FreeOperator because I wasn't sure for how much time my operator is going to be busy. Maybe this could help.
Thanks David. That works. As a reference to others having this problem, I attached a snapshot of the "custom task" box. Also it is important to un-check "wait until complete" or the token will not be released.
A list of state numbers can be found here.
@Dawid Dabal How did you get your operator to do other things after you did the custom task to utilize? My token gets stuck when I tell it to travel after i set the custom task. Are all of your tasks custom? @Logan Gold
If you have problem with Involved/Station fields you can free operator with Custom Code. You can manually destroy the Utilize task with a code:
destroyobject(first(node("{your operator adress}>variables/activetasksequence", model())));
@Dawid Dabal I'm new to FlexSim how do I find the operator address?
Assuming your reference to the operator is correct, operator's state is being set to busy, but then he's being set back to idle most likely by his own internal mechanics. Objects do a lot of state changing on their own and setting an object's state only overrides their current state until the object changes it again. For instance, giving an operator any task will change its state.
This means you can either do what was suggested in the answer by @Dawid Dabal or you'll need to place Set Object State activities everywhere that the state gets changed in order to keep it in a busy state.
I have struggled with this also and tried exactly the same solution. I think that Brenton pointed me to a solution with using he TSDelay activity where you can set the state. Maybe this could be a solution for you as well.
7 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved