question

Victor Alejandro HT avatar image
0 Likes"
Victor Alejandro HT asked Victor Alejandro HT commented

Converting pieces per minute into minute per pieces

Hi all,

I want to convert the figure that appers in this Dash template into minute per pieces, so it is a simple division 1/(Pieces per Minute).

I used a statistic colector in order to modify the output value formula but I can not find the proper one, because I can not get the pieces per minute number in order to to the division. Perhaps there is another way.

pieces-per-minute-into-minute-per-piece.fsm

Thanks in advance for your support.

Alejandro

FlexSim 18.2.0
dashboardsstatistics
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

Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered Victor Alejandro HT commented

Here is a modified version of the model, that I believe does what you want:

minute-per-piece.fsm

The part that is hard to get is the code for the second column:

// *** code header above ***
double throughput = data.rowValue.as(Object).stats.output.value;
double minutes = (Model.dateTime - Model.startDateTime).totalMinutes;

if (throughput == 0)
	return 0;	
return minutes / throughput;

This code does a few things: it gets the throughput of the row value (the combiner), and it gets the number of minutes the model has run. Finally, it guards against a division by zero, and then returns the number you were after.


· 1
5 |100000

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

Victor Alejandro HT avatar image Victor Alejandro HT commented ·

Hi Jordan,

It works perfectly, in my model I need to set a warmup time so I just changed the formula with Model.warmupDateTime. Thank you very much.

// *** code header above ***
double throughput = data.rowValue.as(Object).stats.output.value;
double minutes = (Model.dateTime - Model.warmupDateTime).totalMinutes;

if (throughput == 0)
	return 0;	
return minutes / throughput;
0 Likes 0 ·