question

Conner F avatar image
1 Like"
Conner F asked tannerp commented

Only want tokens to run during the weekdays?

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

FlexSim 19.0.4
process flowtokens
proj19e.fsm (53.5 KiB)
· 6
5 |100000

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

tannerp avatar image tannerp commented ·

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 0 ·
Conner F avatar image Conner F tannerp commented ·

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 0 ·
Conner F avatar image Conner F commented ·

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 0 ·
SudheerReddy avatar image SudheerReddy commented ·

@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[i]; 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 0 ·
tannerp avatar image tannerp SudheerReddy commented ·
@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.

0 Likes 0 ·
not-empty-list.png (59.7 KiB)
SudheerReddy avatar image SudheerReddy commented ·

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

0 Likes 0 ·
doubt.png (39.5 KiB)

1 Answer

·
tannerp avatar image
1 Like"
tannerp answered tannerp commented

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.

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.

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.

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


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

Conner F avatar image Conner F commented ·

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

0 Likes 0 ·
tannerp avatar image tannerp Conner F commented ·

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

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.