question

SudheerReddy avatar image
0 Likes"
SudheerReddy asked Mischa Spelt commented

How to set load and unload time of Task Executers through code

I am trying to set Load and Unload times of Task Executers through code. How could I achieve that. I am attaching my model for refernce.

acquireresource.fsm

FlexSim 19.1.2
load and unload
acquireresource.fsm (36.0 KiB)
· 2
5 |100000

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

SudheerReddy avatar image SudheerReddy commented ·

@Mischa Spelt

Thanks for the answer it helps me.

But I have one follow on question for the following image, so if I have 20 Task Excuters then for every Task Executer I have to go to Load Time and Unlaod Time tab and should I have to write current.LoadTime and current.UnlaodTime.

0 Likes 0 ·
Mischa Spelt avatar image Mischa Spelt SudheerReddy commented ·

Yes, but if all task executers are the same, I would recommend not using a Group Resource, but having FlexSim create them:

* Remove all Task Executers except one

* In the Resource, use the Sample button to select it.

* Set the number of resources you want

* Reset the model

If the "base" task executer is in a Group, all copies created by Process Flow will also be in the group so you can still easily create charts for them.

If you want to change settings, set the Count to 1, reset the model, update the properties and set the count back to what it should be.

0 Likes 0 ·

1 Answer

·
Mischa Spelt avatar image
0 Likes"
Mischa Spelt answered

I'll assume that you want to set the load and unload times through process flow. Attached is your model with a load and unload time sampled in Process Flow.

The sampled value is written to a label on the task executer itself:

(Of course you can use any custom code you want, instead of the uniform distribution).

I then changed the properties of the 3D object to read the sampled values from the label:

The reason for doing it like this, is that the Process Flow is aware of the task executer (through the Acquire Resource), but the opposite is not true -- the task executer does not know that there is a Process Flow. So by pushing the relevant information down to the object you can access it both from the 3D model (using current.labelname) as well as the Process Flow (using token.resource.labelname).

And here is the model itself: 22932-acquireresource-ms.fsm


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.