question

HUNGKUAN W avatar image
0 Likes"
HUNGKUAN W asked HUNGKUAN W commented

Can I have an event-trigger source listen to two events at the same time ?

I mean , I want the token to be created only if the two events both happened .

Is it possible ?

FlexSim 18.1.1
event triggered source
· 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.

tannerp avatar image tannerp commented ·

This is possible. There's two ways that I can think of to accomplish this.

1) Use an Event-Triggered Source (or Wait for Event) and simply add a source with the button shown in the picture below:

2) Use some combination of an Event-Triggered Source to create the token and a Wait for Event to listen for multiple triggers (example below). If done this way, order of events is important.

0 Likes 0 ·
HUNGKUAN W avatar image HUNGKUAN W tannerp commented ·

Hi Tanner , thanks for your help again , but there is still some problems.

1. I am afraid that the Event-Triggered Source will create a token when either one of the two event happend, not two of them both happening ?

2. I didn't use the second way because I worried about that when the token is waiting , the condition will be change . ex: i trigger the source with an event that more than 3 sever is idle at station 1 ,and I'll wait for the event that other station has shortage , but maybe station 1 will get busy during waiting , than the token must not be created .
Is there any way to solve it ?

0 Likes 0 ·
tannerp avatar image tannerp HUNGKUAN W commented ·

You're right. They do just listen for one or the other. I should have read your question more carefully.

I'm not sure if this is possible using the event-triggered source in the current version of FlexSim, but I believe you will be able to listen to arrays beginning in FlexSim 18.2.

@phil.bobo and @jordan.johnson can correct me on this.

1 Like 1 ·
Show more comments

1 Answer

Jordan Johnson avatar image
5 Likes"
Jordan Johnson answered HUNGKUAN W commented

To wait for both events to fire, you should use two activities, and a Synchronize or Join activity:

The Synchronize waits for one token from all input connectors, and then releases those tokens. In the attached model, I made it so that the operator waits for a box in two queues before picking them up, and dropping them off:

I used "step" while making this video, to get the boxes to show up faster.

Here is the model: waitfortwoevents.fsm


· 17
5 |100000

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

HUNGKUAN W avatar image HUNGKUAN W commented ·

Hi @jordan.johnson , thanks for helping .

But actually I have used join before , and this will be a little problem.

In the model you built ,the problem is like , I have another operator , say Operator 2 that also transport the box in queue 2 and another new queue : Queue 3 .

And there will be a problem that if Queue 2 has an arrival , than two token will be generated and wait for synchronized , but if Queue 1 has an arrival first, than one token(belongs to operator one's task) will be synchronized with the new created one , and the other should be destroyed because the original box in queue has been transport .
So I think this model doesn't fit the logic .

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ HUNGKUAN W commented ·

Hi @HUNGKUAN W, this model works with two operators. You can change the count in the Resource to 2, and that will make another operator. They work together very well, and do not have a problem.

0 Likes 0 ·
HUNGKUAN W avatar image HUNGKUAN W Jordan Johnson ♦♦ commented ·

@jordan.johnson ,My question is more like this , because 2 operators belong to different station so I want to seperate them in different resource( actually the amount of them must be changable so I use List in my project) .

And the error is like

one of the operator should not be activated because the only green box has been taken.

13119-waitfortwoevents.fsm

0 Likes 0 ·
Show more comments
Show more comments
HUNGKUAN W avatar image HUNGKUAN W commented ·
@jordan.johnson

I think it is awesome!

thx for the help , I will try to understand the logic in your model .

I'm not quite understand how the Move request Listener , Enter Zone and Exit Zone work .

And, in the model I think the number of car is more than the number of customers ?
So if I have larger arrival rate and I wanna track the waiting time , shall I use another queue to creat customers ?

Last , In the figure ,2018-07-18.png , which value did it actually set .

I'm a beginner , so the question might be basic , thanks

0 Likes 0 ·
2018-07-18.png (34.9 KiB)
Jordan Johnson avatar image Jordan Johnson ♦♦ HUNGKUAN W commented ·

For Customers, I pick a station for the customer randomly, by using the RAND() function in a query:

WHERE BikeCount ORDER BY RAND()

If you remove the WHERE statement, so you only sort the queues randomly, then some customers will have to wait for a bike. The wait time is the Staytime statistic on the Get Bike pull from list activity. You can right-click that activity, and view the statistics. You can also add it to a Staytime template.

The Move Request Listener is a Zone. Basically, this model uses a variable called UpperThreshold. If the number of bikes at a station arrives at or goes about that threshold, then the station goes on a list called Move Requests. If a station is on that list, an Employee will go see if they need to move a bike. But what if a customer comes and takes the extra bike, before an employee comes? So I make a token that waits for the extra bikes to be removed, by waiting for the content of the station to fall below the threshold. If that happens, then I try to "cancel" the move request by removing the station from the list. That way, employees don't have to go to the station, if customers took the extra bikes. The Zone can be used to limit the number of tokens. If a token is already monitoring a station, then I don't need another token to do the same thing.

In the picture, I am setting the QueueStatus variable to three different values, all in zero time. That way, when the Statistics Collector asks "how long have you been set to Acceptable" the answer is "0" instead of getting an error, because it's never been set to that value.

0 Likes 0 ·
HUNGKUAN W avatar image HUNGKUAN W Jordan Johnson ♦♦ commented ·

Hi @jordan.johnson

I just wanna check I understand the model right .
When some station go above the threshold , a token created to push a station into Move Request , and once the object enter Move Request , the operator will try to move the car , while during the time if the content fell below the threshold , the Movement will be canceled .

I'm curious what will the token go if a operator is on the way and the movement is canceled. It will go back to the resource?

Others , I don't understand how Zone limits the number of tokens , and there's two connector after Enter Zone , how can I judge which one the token will go ?

Also , If today I have a lowerbound for each station , which means that the destination of movement will be the one below lowerbound and has the minimun value .

And How can I access the Statistic in each station (Staus ratio , Avg car in specific station ...etc)?

Is it possible to change the query to achieve that ? and if no one is qualified , the token will wait or be canceled by the listener , am I right?

0 Likes 0 ·
Show more comments
Show more comments
HUNGKUAN W avatar image HUNGKUAN W commented ·
@jordan.johnson

hi, I have a question while reviewing the system.

If a station has been push to move to request 3 times . (3 units above the thershold)

but only a token will monitor the station.

and , before any transportation happen , the station falls below the threshold , and only a request will be canceled , will the other two still being on the list ?

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ HUNGKUAN W commented ·

There is an Activity called Make Move Request, that will replace the move request token if necessary.

0 Likes 0 ·