question

JoseVM avatar image
0 Likes"
JoseVM asked Matthew Gillespie commented

Decide depending on the state (full or empty) of a fixed resource.

Hi everybody,

I am working with a simulation that is giving me some problems. There is a transporter who is moving batches of boxes to a Separator1. After the separator1, there is a Processor1 and a Combiner1.

What I would like to achieve: when the first batch come, I would like the transporter to unload the batch and then, before releasing, to wait until the processor1 finishes to process all the boxes (PICTURE 1).

However, if it is the second batch the one is coming, the previous batch will be ocuppying the Combiner1, so I would like to release the Transporter, as in other PF I will order to take the first of the batches (PICTURE 2).

I attach some pictures to make it clearer and to show how I tried to do it unsuccessfully.

I was looking for a solution and I thought that setting a "Decide" Acitvity in function of the input port of the combiner would be ok. But it is not working as you can see in the .fsm file.

I wonder if someone could help me in this taks, as I have been thinking about it during a long time and I can not find a propper solution.

problema-3.fsm

Thanks in advance.

FlexSim 19.1.0
process flowtask sequencedecidebatches
case-1.png (241.8 KiB)
case-2.png (252.9 KiB)
decide-settings.png (17.4 KiB)
problema-3.fsm (66.6 KiB)
· 1
5 |100000

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

Benjamin W2 avatar image Benjamin W2 commented ·

Hi @José VM,

Was Braydn's answer helpful for you? If so, can you please click accept? If not, how else can we help?

0 Likes 0 ·

1 Answer

·
Braydn T avatar image
2 Likes"
Braydn T answered Matthew Gillespie commented

@José VM

I am a little unsure about exactly what you are trying to accomplish. Here is my understanding:

If the combiner does not have items on the pallet, the forklift should wait by the separator until it does.

If it does have items on the pallet, then it should release.

If that is what you are looking for, then open the decide, and go to the edit code window and put this in:

if(Model.find("Combiner1").subnodes[1].subnodes.length > 1){
	return 2;
}
return 1;


 
· 1
5 |100000

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

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

@Braydn T your code throws an exception if there is no pallet on the combiner. You should check that the combiner has a first sub node before going down two levels.

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.