question

Maryam H2 avatar image
0 Likes"
Maryam H2 asked Felix Möhlmann commented

Billboard to show aggregating value of a group of objects

Is it feasible to create a billboard for a group of objects, for instance, displaying the aggregate value of the content within that group of objects?

FlexSim 24.0.0
visual toolbillboard
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

That is certainly possible.

I'd start with the "Display Object Statistics" option of the text/billboard object and then more or less just loop through the code multiple times and add up the total.

The default code will have to be altered in one regard. Instead of directly converting the statistic into a string, the numeric value should be assigned to a variable to later add it to the total.

All other changes are just adding more code around the existing one.

aggregate-billboard-fm.fsm


· 5
5 |100000

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

Maryam H2 avatar image Maryam H2 commented ·
Got it, thank you!
0 Likes 0 ·
Maryam H2 avatar image Maryam H2 commented ·

Hi @Felix Möhlmann,

I've observed that the time horizon for minimum, maximum, and likely average statistics resets, meaning it recalculates these values starting from zero. I've configured this in my model, which has a running time of a month. For instance, if I check the maximum value during the second week, it shows as 16, but by the end of the month, it changes to 13. How can I adjust the time frame so that it provides me with statistics spanning the entire month?


0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Maryam H2 commented ·

The example I provided tracks the total/average/minimum/maximum of the 'current' contents of the queue. For example, the 'Minimum' stat would be the number of items in the emptiest queue at that time.

To track the content stats of all queues as if they were one, you can add a Tracked Variable that gets incremented whenever an item enters one of the queues and decremented when an item exits.

The composite statistics can then be read from that Tracked Variable.

aggregate-billboard-fm2.fsm

0 Likes 0 ·
Maryam H2 avatar image Maryam H2 Felix Möhlmann commented ·

Thanks for the response @Felix Möhlmann.

I see it works in your model, but what if I want this aggreagted count for the group of multi-processors which they alaredy have a custome code regarding the packing method on their On Entry and On Exit as below:

On Entry Custome Code:

Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
Object lastitem = item.prev;
/***popup:SimplePacking*/
/**Simple Packing Method*/

/**Combine flowitems into any container.  Choose a buffer for the X, Y, and Z 
directions so the flowitems will not overlap with the container's edges.*/


double xBuffer = /** \nX Buffer: *//***tag:nx*//**/0.5/**/;
double yBuffer = -/** \nY Buffer: *//***tag:ny*//**/6/**/;
double zBuffer = /** \nZ Buffer: *//***tag:nz*//**/3.25/**/;


double containerSX = current.size.x - xBuffer;
double containerSY = current.size.y + yBuffer;


if(current.subnodes.length == 1) {
    item.setLocation(xBuffer, yBuffer, zBuffer);
} else if (containerSX - (lastitem.location.x + lastitem.size.x + xBuffer) >= item.size.x) {
    item.setLocation(lastitem.location.x + lastitem.size.x + xBuffer, lastitem.location.y, lastitem.location.z);
} else if (containerSY - (lastitem.size.y + lastitem.location.y + yBuffer) >= item.size.y) {
    item.setLocation(xBuffer,(lastitem.size.y + lastitem.location.y + yBuffer + 2), lastitem.location.z);
} else {
    item.setLocation(xBuffer, yBuffer, lastitem.location.z);
}

On Exit Custome Code:

/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);


Object currentItem = item.next;


double moveCurrentToX = item.location.x;
double moveCurrentToY = item.location.y;
double moveCurrentToZ = item.location.z;


double tempX = 0;
double tempY = 0;
double tempZ = 0;


while (currentItem != NULL) {
     tempX = currentItem.location.x;
     tempY = currentItem.location.y;
     tempZ = currentItem.location.z;


     currentItem.setLocation(moveCurrentToX, moveCurrentToY, moveCurrentToZ);


     moveCurrentToX = tempX;
     moveCurrentToY = tempY;
     moveCurrentToZ = tempZ;


     currentItem = currentItem.next;
}


0 Likes 0 ·
Show more comments

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.