question

Hallie H avatar image
0 Likes"
Hallie H asked Joshua S edited

how to set bays first in first out

Hello! I'm very new to Flex sim, and trying to figure out how to add in rules for placing items within bays of multiple racks. My criteria is that new items must always be added downstream of old items (i.e. if an older item is stored in bay 2, and both bay 1 and 3 are open, the new item must go in bay 3). How might I go about doing this?

I'm guessing this will fall into the "place in bay by expression" option, but I'm not exactly sure what this expression will be so that's what I'm currently having difficulty with.

FlexSim 7.7.4
rack storagerack flowbays
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

Joshua S avatar image
0 Likes"
Joshua S answered Joshua S edited

Here's a quick example where I added custom code in the "place in bay by expression" where it checks the contents of the bay and then works backwards from the amount of bays it has.fill-backwards.fsm


fill-backwards.fsm (14.8 KiB)
· 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.

Hallie H avatar image Hallie H commented ·

Hi Joshua - thanks for your help! Unfortunately I think due to the fact that I have an older version of the software, I get the following error message when I try to open your example: "exception: Tree file format is not compatible with this version of Flexsim." Do you know if there's possibly a way for me to get around this to be able to see what that custom code to fill backwards looks like? It sounds like this is exactly what I'm looking for!

0 Likes 0 ·
Joshua S avatar image Joshua S Hallie H commented ·

What version are you using? I made the model in 7.7.4

Here's the code though that you can just insert into the "place by bay expression" costume code

treenode item = param(1);
treenode current = ownerobject(c);
for(int I=rackgetnrofbays(current);I>0;I--)
{
	if (rackgetbaycontent(current,I)==0)
	{
		return I;
	}
}
return 1;


<br>
0 Likes 0 ·