question

Terra K. avatar image
0 Likes"
Terra K. asked Joerg Vogel commented

Operators carry 3 columns of boxes

By default, operators carry the items no matter how many of it, it goes up in one stack. However, when i want it to be on the task executor which is to be pushed by the operator, i want it to be stacked in 3 columns, for example if the bottom is filled with 3 boxes already, it moves to a higher level and so on. I've tried setloc() but it still only contains one column.

FlexSim 17.1.2
operatoroperatorstaskexecutor
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

Joerg Vogel avatar image
4 Likes"
Joerg Vogel answered Joerg Vogel commented

Here an example that may show you, how to do it:

/**Custom Code - change Location of loaded items to three in a row*/
Object item = param(1);
Object current = ownerobject(c);
Object station = param(2);
//*** New Code ***
int loadedItems = current.subnodes.length;
if(loadedItems> 1){
int level = (loadedItems-1)/3;
// integer division to get the level in z direction
int place = ((2+loadedItems)%3);
// I need the series 0, 1, 2 dependency of the amount of loaded items // (1+2)%3 = 0; (2+2)%3 = 1; (3+2)%3 = 2; (4+2)%3 = 0;... treenode loaded1st = current.subnodes[1];
// root item to place the other
double locX = loaded1st.as(Object).location.x + loaded1st.as(Object).size.x*place;
// I assume the size is constant
double locY = item.location.y; // y location does not change
double locZ = loaded1st.as(Object).location.z +(item.size.z*level);
item.setLocation(locX, locY, locZ);}
· 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.

Terra K. avatar image Terra K. commented ·

Hi, thank you @Jörg Vogel !
So I edited a bit, added a taskexecutor as a "trolley", the output is as the file. Is there a way to make in seem nicely stacked in the trolley? The distance between the stacks seems to be measured according to the dimension of the trolley.

trolleyexample2.fsm

0 Likes 0 ·
trolleyexample2.fsm (16.4 KiB)
Joerg Vogel avatar image Joerg Vogel Terra K. commented ·

Since the trolley shape is missing in the file, I selected the trolley object. Further on I guessed the offset in x direction.
The main action is to place the first loaded item, too. Therefore the loading position in x is stored inside a variable and the z position is set in dependency to the trolley.

0 Likes 0 ·
Terra K. avatar image Terra K. Joerg Vogel commented ·

Hi @Jörg Vogel thank you!

So if I want to have a space between each level, do I use the same concept as the x offset?

0 Likes 0 ·
Show more comments