question

창현 박 avatar image
0 Likes"
창현 박 asked Sam Stubbs answered

How to distribute items to each rack of cell

HI, Everyone

I am studying Flexsim to make a simulation.

I want to distribute items to each rack of cell following the types of item with using globaltable.

There are 2 object Sorce1,Rack1

Sorce1 makes 12 items each item number, and Rack1 has 12 LocaID

LocaId is maked up BayI and LevelI

I want to distribute Items to each rack of set following the types of item with using global table

Forexemple, item type 5 is put on LocaId 5 (Bay : 2,Level : 2)

I made the source to load the item, but it does not work.

I dont know what is the problem. So someone pleae tell me about how can I solve this problem

The source is as follows

Object item = param(1);
Object current = ownerobject(c);
/***popup:ByExpression*/
/**By Expression*/
int t = getitemtype(item);

int baynum;


for(int a=0; a==100; a++){
		if(t = gettablenum("LocaTable",1,a)){
		baynum = gettablenum("LocaTable",3,a);
		return baynum;
		break;
		}
}
return rackgetbayloc(current,baynum);
/**Custom Code*/
Object item = param(1);
Object current = ownerobject(c);
double baynumber = param(2);
int t = getitemtype(item);
int levelnum;
for(int a=1; a==100; a++){
		if(t = gettablenum("LocaTable",1,a)){
		
		levelnum = gettablenum("LocaTable",4,a);	
		return levelnum;
	    break;	
		}
}
return rackgetlevelloc(current,baynumber,levelnum);

FlexSim 17.0.0
racktablesbaylevel
bbb.png (100.2 KiB)
ab.png (14.2 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

Sam Stubbs avatar image
1 Like"
Sam Stubbs answered

Rather than using code to sort these you can just use the picklist options. Since you already have a table with the bay and level per itemtype, and your items have an item type between 1 and 12, just use the "By Expression" option from the picklist when choosing the Bay or Level.

This expression will return the number from "GlobalTable1" at the row number equal to the item's itemtype, in column 4. (In your table column 4 represents the level.) Just do the same thing for bays too.


picklistrack.png (23.8 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.