Billboard to show aggregating value of a group of objects

Billboard to show aggregating value of a group of objects

mhosseini457NG
Advocate Advocate
22 Views
6 Replies
Message 1 of 7

Billboard to show aggregating value of a group of objects

mhosseini457NG
Advocate
Advocate

[ FlexSim 24.0.0 ]

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?

0 Likes
Accepted solutions (1)
23 Views
6 Replies
Replies (6)
Message 2 of 7

moehlmann_fe
Observer
Observer
Accepted solution

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

0 Likes
Message 3 of 7

mhosseini457NG
Advocate
Advocate
Got it, thank you!
0 Likes
Message 4 of 7

mhosseini457NG
Advocate
Advocate

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
Message 5 of 7

moehlmann_fe
Observer
Observer

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
Message 6 of 7

mhosseini457NG
Advocate
Advocate

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
Message 7 of 7

moehlmann_fe
Observer
Observer
Just add the code that updates the tracked variable below or above the other custom code.

All that's really needed is a single line:

TrackedVariable("variableName").value += 1;   // or -= 1 respectively
0 Likes