How to distribute items to each rack of cell

How to distribute items to each rack of cell

cocacoffe
Not applicable
18 Views
1 Reply
Message 1 of 2

How to distribute items to each rack of cell

cocacoffe
Not applicable

[ FlexSim 17.0.0 ]

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.

4841-bbb.png

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

4842-ab.png

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);

0 Likes
Accepted solutions (1)
19 Views
1 Reply
Reply (1)
Message 2 of 2

sam_stubbsYXX86
Community Manager
Community Manager
Accepted solution

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.

4847-picklistrack.png

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.