question

anon-user avatar image
0 Likes"
anon-user asked Joerg Vogel commented

number of times transported

How to record the number of times TaskExecuter is transported


There are two things I want to do.


Write the number of items transported by TaskExecuter to the global table.

Write the number of round trips for transportation by TaskExecuter to the global table.


The number of shipped items could be created by writing to the global table with the On UnLoad trigger.

But which trigger should I use for the number of transports?


Or is it not possible to count the number of transports with a trigger?



FlexSim 20.1.3
flexsim 20.1.3triggerstransporttaskexecutor
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi anonymous user, was Jörg Vogel's answer helpful? If so, please click the red "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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel commented

If you know, the transporter gets empty at every unload station, you can check his content by current.subnodes.length as a condition to be empty.

Or you send a delayed message to himself. OnMessage you check his current state. If he is traveling again, then the past unload counts as a trip.

· 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.

anon-user avatar image anon-user commented ·

I have tried using "current.subnodes.length".

But there was a problem.


What i want to do is,

Write the number of round trips for transportation by TaskExecuter to the global table.


However, in the "Write to Global Table" menu, Unable to enter the condition "current.subnodes.length".

There are only input fields for Row, Column, and Value.


0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel anon-user commented ·
if(current.subnodes.length == 1) // item is counted as in operator
  Table("mytable").cell(1,1).value += 1;

count_round_trip_in_table.fsm

0 Likes 0 ·
anon-user avatar image anon-user anon-user commented ·

Thank you for presenting the script.



In other words

Does that mean that the FlexSim menu doesn't have the ability to achieve this goal?


0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel anon-user commented ·

No, there is not a conditional table cell input template. FlexSim Developers tested in the past different graphical supported programming techniques. Currently their favorite is process flow.

0 Likes 0 ·