question

Saiprasad A avatar image
0 Likes"
Saiprasad A asked Kavika F commented

How to check whether a Task Executor is available (idle and empty) ?

Hi,

I have added a task executor object in my model with the name Level1Shuttle. In process flow, I am trying to make a conditional decide based on task executor availability (the task executor is empty and idle). I have created a resource in process flow and sampled the task executor in it.

In my decide block, I chose conditional decide and sampled the above resource. It gets me the following:

getstat(getactivity(processFlow, "Resource: Level1Shuttle"), "Output", STAT_CURRENT, current)

What is the meaning of above sentence and what values does it return for respective states of the task executor?

In case I want to check for the task executor availability, how do I use the above sentence in conditional decide block?

Additionally, is there a better way to check for availability (idle and empty) of a task executor in flexsim process flow so that tokens could be directed accordingly?

I would appreciate it if someone can help me with the above issue. Thanks in advance!

FlexSim 19.2.4
task executor
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Kavika F avatar image Kavika F ♦ commented ·

Hi @Saiprasad A, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

You can test this expression in a script window - it tests that it's empty, idle and has no jobs:

TaskExecuter te=Model.find("Operator1");   //change to your TE
return te.subnodes.length==0 && te.taskSequences.length==0 && te.stats.state().value==STATE_IDLE;

If you're using process flow everywhere you can also push the te's to a list of freeTEs when they complete jobs and pull from them when you need one. Using a global list allows multiple processes to know which are free.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.