question

Ghadir S avatar image
0 Likes"
Ghadir S asked Felix Möhlmann commented

How to use TimeTable along Down Behaviors in ProcessFlow

Hi,

So, I created 3 differents shift/group (each contains 4 operators and work 8h/day). I set a schedule for each shift with TimeTable & Down Behavior. I also created a group which contains all operators and added to Resource Operator.

However, when I launch the simulation, the system doesn't work properly and after a while, I get some errors.

Can anyone analysis my model and tell me what I'm doing wrong please ?

I should also mention that without any timetable or schedule, the model works perfectly.

LigneP3_V5.fsm

FlexSim 21.2.4
processflowtimetabledown behaviorresource operator
lignep3-v5.fsm (7.1 MiB)
5 |100000

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

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

The state of an object doesn't stop a token from acquiring it as a resource. As long as it is in the group it can be acquired.

One way to deal with this is to use the query field to filter for actually available operators. First, you have to define a new field in the advanced properties of the Process Flow resource. This could be a label that denotes whether the operator is currently busy or not. In the attached example I simply check if the operator has an active task sequence. If not, the IsIdle field will have a value of 1.

1681223246054.png

In the acquire activity, I use this to filter for available operators. Since a request will not automatically reevaluated when the operator finishes a task sequence, I opted to have the tokens enter a Wait for Event activity which sends them back to the Acquire activity whenever a resource is released or a group member becomes available (finishes a task sequence).

1681223298546.png

Lastly I also changed your Process Flow to use task sequences instead of individual tasks. This means the operators will not interrupt their current task for a break. If you do want partial tasks to be possible (one operator starting a manual processor and passing to another operator) you will have to use preemption activities. (Have a separate token listen for the On Stop event of the time table for the respective operator and then preempt the token away from the current flow to acquire a new operator.)

1681223570775.png

lignep3-v5-fm.fsm


1681223246054.png (10.0 KiB)
1681223298546.png (7.8 KiB)
1681223570775.png (4.4 KiB)
lignep3-v5-fm.fsm (7.1 MiB)
· 4
5 |100000

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

Ghadir S avatar image Ghadir S commented ·

I'm honstly speechless, thank you. I'm starting to understand what you did. So you're telling me that if I want to test wheter the operator is busy or not in the "state of an object" I have to write down this code ?

!objectexists(value.as(TaskExecuter).activeTaskSequence)

I assume with a code similaire to this, is how I can test if an object entered in a queue or not..
I have so much to learn despite everything I did and watched/read on internet and it's not easy. So if I may ask. Is there any book I can buy despite everything we have on internet ?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Ghadir S commented ·

The expression I used specifically checks if the task executer has an active task sequence. Another possible way would be to check the object state (idle, busy, travelling, etc...)

value.as(Object).stats.state().value == STATE_IDLE

The only book I know of is the one available on the FlexSim site.

https://www.flexsim.com/store/

The previous (4th) edition can be viewed here:

https://www.flexsim.com/wp-content/uploads/sites/2/2020/06/FlexSim-Primer_2020-Update-1.pdf

A decent starting point to understand more about the coding possibilities in FlexSim is in my opinion the online manual.

https://docs.flexsim.com/en/21.2/Reference/CodingInFlexSim/WritingLogic/WritingLogic.html


Some more information about how the used expression works:

The command objectexists() checks if the passed in parameter is a valid pointer to a treenode.

When a Process Flow resource is connected to a group it internally becomes a list which is where the feature to define the fields comes from. For lists, value is a reference to the thing that was put onto the list (so in this case the operators). This reference then gets cast as either a Task Executer class variable or an Object class variable to be able to access the class specific properties/methods. These can also be found in the manual in the FlexScript class reference section.

https://docs.flexsim.com/en/21.2/Reference/CodingInFlexSim/FlexScriptAPIReference/TaskExecuter/TaskExecuter.html

0 Likes 0 ·
Ghadir S avatar image Ghadir S Felix Möhlmann commented ·
I truly appreciate your effort and time. I don't know how else I could thank you so I gave all the point I had.



Hopefully one day I can reach your level. Have a nice day @Felix Möhlmann

0 Likes 0 ·
Show more comments

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.