Only want tokens to run during the weekdays?

Only want tokens to run during the weekdays?

conner_f
Not applicable
41 Views
9 Replies
Message 1 of 10

Only want tokens to run during the weekdays?

conner_f
Not applicable

[ FlexSim 19.0.4 ]

Hi I am making a model of the changes that happen in our process but only want the tokens to run through the PF M-F. Currently any token that is created runs through the PF no matter the day, is there a variable or some kind of work around so that the tokens would stop or pause in the PF if it were to hit a certain time in the model, somewhat liking simulating a workday where the next day they pick up the previous workdays tasks?

proj19e.fsm

Accepted solutions (1)
42 Views
9 Replies
Replies (9)
Message 2 of 10

tanner_p
Not applicable

Your question is similar to this one and we might be able to come up with a solution using a Time Table. I'm still looking into other options, but see if that other post helps get you started.

Are the tokens running 24 hrs/day M-F or do they only run for an 8 or 10 hours shift? (i.e. 8am - 4pm on weekdays)

0 Likes
Message 3 of 10

conner_f
Not applicable

Hi,

I will look into the other question to see if that is what I am looking for. They would be running 8 hour shifts M-F

0 Likes
Message 4 of 10

conner_f
Not applicable

I looked over the other solution and think that would solve my problem. I am confused on how to implement the stop and resume code, do you have any advice on where to put that or how I would implement this into my model. I understand that once you apply a label of an id for each token you can use the resume and stop commands but I'm not sure where to put them in the model/code for the PF

0 Likes
Message 5 of 10

tanner_p
Not applicable
Accepted solution

We've come up with a solution that should work for your model. I'll try to explain everything so you can go in and review/adjust it as necessary.

1) We will use a Time Table, Basic FR, Create Tokens activity, and a List.

2) To create references to the tokens in your Process Flow, we'll use the Create Tokens activity to push the value of a "parent" token (the one going through all the Process Flow activities) to a list.

22026-create-tokens-reference.png

3) The Push to List activity pushes a reference to the original token to the list that can be accessed through a function in the Time Table.

4) In the Time Table function, we can pull the tokens from the list and stop/resume them through code.

22027-time-table-down-function.png

This should work in your model. You can set up the Time Table to match your 8 hr work day, but other than that, I've updated the rest of the code to hopefully work in the way you want.

22028-m-f-8-hrs.png

Let me know if this idea works. It's not perfect yet, but it's a start. One thing that we might have to work through is what to do with the tokens left on the list after the tokens leave the model... Maybe adding a Pull from List activity before the tokens leave the model? I'm not sure.

Model: process-flow-time-table.fsm

Message 6 of 10

conner_f
Not applicable

Thank you! I will try this out and get back to if I have any further questions

0 Likes
Message 7 of 10

tanner_p
Not applicable

Sounds great. If you do have further questions, I'd recommend creating a new post and referencing this one so that it's seen quicker.

0 Likes
Message 8 of 10

sudheer_r
Not applicable

@Tanner Poulton Array Tokens = List("List1").pull("",10000,10000,downobject); //List of tokens in process flow for (int i = 1; i <= Tokens.length;i++){ Token T=Tokens; T.stop(); //Stop each of the tokens in process flow }

could you please expalin why you have written 10000,10000, downobject in the code

0 Likes
Message 9 of 10

sudheer_r
Not applicable

@Tanner PoultonCould you please explain why you have used push and pull shared assets with max timer 0. What value does this push and pull lists add.

In Review Change flow chart the tokens which fail will pass through drafters which try to pull from the list. Why it is pulling from empty list. What is the purpose of that logic.

22250-doubt.png

0 Likes
Message 10 of 10

tanner_p
Not applicable
@Sudheer R

In response to your first question, I simply put 1000 as the number of tokens to pull because there could be several hundred tokens in the Process Flow at any given time and I wanted to grab all of them. That's the only logic there. As long as the number of tokens being pulled is greater than the number of tokens in Process Flow, it will grab and stop all the tokens available.

Your other questions should be directed towards @Conner F as I did not build this model. Generally, however, max wait timers are used so that in the case there is not an item available to be pulled, the token will move on to another task or recirculate.

Additionally, the Drafters list is only empty at the beginning of the model. If you were to stop the code like in the image below, you would see that the token is being pushed to a list and then pulled again by another activity. So there is a purpose to this and it's not an empty list, but Conner would have to explain his logic. I imagine it's due to limited resource availability.

22270-not-empty-list.png

0 Likes