question

Ana Gabriela L avatar image
1 Like"
Ana Gabriela L asked Ana Gabriela L commented

How to combine two custom codes that work separately?

Hi!

I would like to create a custom code for my model to do the following:

  1. An operator will arrive to Queue1 and will have a delay time of 5 seconds.
  2. Once the delay time is over, 3 operators will arrive to Queue1.
  3. The 4 operators (at the same time) will load an item and onload it in Queue 2 (it doesnt matter if only one operator actually loads the item and the other ones just follow him).

I have created 2 separate custom codes that kind of do what I want my model to do separately. The first one is located in Queue 1, I tried to apply the code of the Coordinated Task Sequence Example 2 for 4 operator instead of 2 but couldn't do it correctly. The second code is located in Queue3 and works the way I want for it to work.

I would like to correct the logic of Queue 1 and see a way of combining these two tasks into one code.

Thankyou in advance for your help!

CUSTOM CODES.fsm

**I know this can be easly done with Process Flow, but I want to try with code.

FlexSim 20.0.0
custom codeflexsim 20.0.0coordinated task sequence
custom-codes.fsm (50.9 KiB)
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

Jeanette F avatar image
2 Likes"
Jeanette F answered Ana Gabriela L commented

Hello @Ana Gabriela L,

Great job on the coding! The code in Queue1 had an error in line 31 and 32. The code that hadn't changed the op2travelkey to op3travelkey and then op4travelkey, so it wasn't allocating Operator3 and Operator4 correctly. After I corrected this in your model it ran how you described above.


· 5
5 |100000

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