Turning label value into usable PerformanceMeasure

Turning label value into usable PerformanceMeasure

margot_ruts
Community Visitor Community Visitor
95 Views
1 Reply
Message 1 of 2

Turning label value into usable PerformanceMeasure

margot_ruts
Community Visitor
Community Visitor

Hi,

 

I would like to convert the value of one of my robots' labels to a usable PerformanceMeasure. More specifically, it involves a label that constantly switches between binary values 0 and 1, depending on whether the robot is performing certain actions. Hence, I want my PerformanceMeasure to be a percentage representing what percentage of the simulation run time the label value was equal to 0.

For example (although in the model the value changes will happen every few seconds):
0-1000 [s]: label value = 0
1000-1500 [s]: label value = 1
1500-2500 [s]: label value = 0
2500-3600 [s]: label value = 1
=> PerformanceMeasure value = 2000/3600 = 55.56%

 

Does anyone know how to create such a PerformanceMeasure?

 

Many thanks in advance!

0 Likes
96 Views
1 Reply
Reply (1)
Message 2 of 2

moehlmann_fe
Observer
Observer

Use a tracked variable label. Those track their minimum, maximum and average values. The latter would be what you want for your performance measure. Assuming you linked the object to the performance measure in the reference field, you would read the average as follows.

 

reference.labels["labelName"].as(TrackedVariable).average

 

0 Likes