question

JIANYUAN, HALLEY L avatar image
0 Likes"
JIANYUAN, HALLEY L asked Braydn T commented

How to pull items using item list with port closed?

Hello all,

I need to make a model modelling after roads with a limit on vehicle for travelling. The way I did it, the queues were made to "stopoutput" after a certain number is reached (assume limit set is 10 for both queue 1 and 3 and 20 for queue 2 recorded in global table). During the period that the output is stopped, people are waiting and I would need to pull them to sink when their waiting time exceeds 300s. However, this would conflict with the previous logic which stops the output until other "vehicles" came in.

Is there a way to get around this? I am unable to use "closeinput" for the processors instead as some items goes from processor1 to processor4 (or 3 to 2) which will happen in the actual model. If processor 4 were to close input after the limit of 20 for queue 2 is reached, it would not accept items from processor 1 as well.

Right now I've tried to resumeoutput when wait>300s and closeoutput after item is pulled but it did not seem to work (sink4). The way I did it was to include the codes in the flow tab>pull strategy.

Also, would it be possible to use only 3d modelling (not using process flow activities) to resolve this problem? It is more intuitive and better for presentation of the codes in paper and more important point is that I might not be able to replicate the exact codes in the actual model....

Thanks for taking a look!

test-11.fsm

FlexSim 20.0.0
flowitem3d modeloutput port
test-11.fsm (41.5 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

Braydn T avatar image
0 Likes"
Braydn T answered Braydn T commented

@JIANYUAN, HALLEY L

The only way I could think of to do this without using 3D would be to pull conditionally using some custom code. You could either leave the port open, have some other variable that sets it in the stopped mode, and then pulls items of a certain type with wait time over 300. Of course, if you did that, at that point you should just use process flow because it would just be a source, a pull from list, and a move object, which would be much simpler.

· 9
5 |100000

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

JIANYUAN, HALLEY L avatar image JIANYUAN, HALLEY L commented ·

@Braydn T

Could you give another example of a variable that can stop the item flow? The only way I know of is to closeport.

If I were to use process flow instead, how should I go about this? Would it bypass the issue with the closeport? Ideally, I would use pull from list (since I already push to item list in the "onentry" trigger), set a max wait time and link it to the sink?

Thanks for helping!

0 Likes 0 ·
Braydn T avatar image Braydn T JIANYUAN, HALLEY L commented ·

There is no variable, it would just be code. To do it in process flow you could have a scheduled source that creates a token at time 0. You would have a pull from list that pulls based on the query we talked about before, and then a move object that moves the pulled item into the sink. Then you would have the output of that box go back to the pull from list.

I dont know which list you want, so you will have to add the reference to the list, add the query to the pull from list, and add the destination in the move object.

jian.fsm

0 Likes 0 ·
jian.fsm (44.5 KiB)
JIANYUAN, HALLEY L avatar image JIANYUAN, HALLEY L Braydn T commented ·

@Braydn T

Do you mean that the source would be independent from the source 1 created previously (I've tried linking it but I'm not sure if it worked)? Can this be done if the arrival rates are done by time of day which does not seems to be present in the codes in process flow? Also, each queue is actually connected to about 6 different sources with different labels. Would this affect the process flow?

In this case, the queue 1 disappears entirely once the wait time exceeds 300s.

test-process-flow.fsm

Would it work if I were to directly pull from the queue once the limit of 300s have been reached? I've tried it in the 2nd model but nothing happened.

test-process-flow-2.fsm

0 Likes 0 ·
Show more comments
JIANYUAN, HALLEY L avatar image JIANYUAN, HALLEY L commented ·

@Braydn T

Is it possible to pull items from global list to the processor using their respective labels?

There are a few problems with the model, after about 30,000s the model would stop functioning normally. Also, I realised that the maximum staytime have always been above 300s which should not be possible. Futhermore, this model suggested does not trigger the decrease in values in the global table.

The way the model runs, the number in row 1 column 1 of global table would not ever go beyond 10, which is the limit placed on vehicles, but the process flow activities does not follow the trigger being placed on the various processors/sink/queue (If it travels to the sink1 and/or sink 4, the number should decrease as well).

Also, each queue is connected to 6 sources due to having different labels and the inter arrival times are "by time of day" which is not present in process flow activities. Do you know to resolve the issue (I am unable to do a direct copy of codes as the distribution in the various times of the day are not present in the codes itself and I'm lost as to how it is referred)?

I'm kind of inclined to try out 3d modelling to solve the problem instead as there are 39 sources in the actual model and with 7 labels and with process flow activities, tracking the flow movement doesn't seems possible. Here's the actual model that I'm trying to do, can you help take a look and see if process flow activities can simulate this?

actual2.fsm

0 Likes 0 ·
actual2.fsm (61.6 KiB)
Braydn T avatar image Braydn T JIANYUAN, HALLEY L commented ·

@JIANYUAN, HALLEY L

It is possible to pull items from a list to a processor using labels. You just have to have that label field in the list.

It looks like the exceptions that I see after the model stops running are in on entry triggers. I get the same behavior if I run your original model without any of my modifications.

I only implemented this in Queue1, so if you look at the list that is represented in Queue1, the average staytime after the model stops running is 298. Futhermore, sink4 has an input of 5827 at time 40000, even when you remove the A port connection. That means that the processflow is working, and is triggering the decrease. You can open the list entries of waiting people1 and watch the items decrease at time 300.

I don't think you understand how process flow works. Process Flow and the 3D modeling can function independently, but Process Flow is one of the most powerful tools a flexsim user can have. You can model things easily in process flow that would take large amounts of custom code in the 3D. You also don't have to do all of your model in Process Flow. You can just do one small portion, and process flow can read everything you created in your 3D model. In fact, when models get larger and larger the consultants here use process flow more and more due to the power and flexibility you can't have without large amounts of custom code. I understand that process flow might be difficult to learn or understand initially, but there are many things you will not be able to do without it.

I hope this clarifies things some. You do not have to make a choice for which tool you want to use and stick with it. I typically use 3D for the easier modeling tasks but when things start becoming remotely difficult or complicated, I switch to process flow.

I don't know the goal of your model, so you may want to use a separate global list that represents the stay time in queue1 or other queues like it so that doesn;t mess up statistics elsewhere.

0 Likes 0 ·
JIANYUAN, HALLEY L avatar image JIANYUAN, HALLEY L Braydn T commented ·

@Braydn T

While the average staytime is below 300 seconds, the maximum staytime seems to always exceed 300s which was what I was worried about, since it might not be accurate.

The reason why I am more meticulous about the process flow is because I do not know how exactly does it work as you've mentioned. From my observation of the codes that you've sent, it seems as though each process flow is linked to the source which can be prone to errors since the actual model has 39 sources, which means I would have to create 39 source flow with 7 waiting queues of 7 different values and flow processes. Furthermore, I am unable to observe individual process if items are not being pulled/pushed to the correct ports.

Previously, many people has suggested using process flow to move items to the correct ports but they have always changed the max value set in the global table itself. The model is trying to simulate movement using vehicle, the idea is such that when people has vehicle, they can move to another location but if there isn't they will wait, and when wait times stretches, they will leave. Therefore, without the "vehicle" as represented by a value in the global table, they shouldn't be able to move. Yet, with every process flow model I was suggested with, the global table value exceeds the number of "vehicle" present, which should not be possible and it made me doubtful that the process can be done by process flow itself.

Could you give certain insights on this? Could it be due to On Entry trigger in sink 4 is not working as intended? If so, how could it be that the On Exit trigger in queue 1 did work to increase the value in global table?

Thanks for reading and I really appreciate the help that you have been giving me!

0 Likes 0 ·
Show more comments