question

Kari Payton avatar image
0 Likes"
Kari Payton asked Adrian Haws edited

Is there a way to display the average value of a label on a dashboard?

I have a token label that I want to track throughout the simulation run. How can I display and track this label on a dashboard? The label is generated as a random distribution (see photo)

FlexSim 16.1.2
labelsdashboardstracked variables
display-label.png (23.1 KiB)
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

·
Sam Stubbs avatar image
6 Likes"
Sam Stubbs answered

You can accomplish this by using a Tracked Variable. The following steps will show you how to do it.

1) First go to your Tool Box and hit the green "+" sign. In the drop down menu select Statistics > Tracked Variable.

2) You can set the name to what you want, and the type. (In your case you probably want it as Content type)

3) Then somewhere in your logic, you assign the label value to the Tracked Variable. In my example I added a Custom Code activity in Process Flow with the following line of code (where "MyVar" is your Tracked Variable name, and "labelName" is the name of the label you want to track):

set(trackedvariable("MyVar"),getlabel(token,"labelName"));

4) Then to set a Dashboard widget to track the variable, go to your Dashboard and drag out a Custom Chart.

5) In the Associations tab, you'll want to add the tracked variable. Hit the green "+" sign and select "Browse Tree." In the tree view find your Tracked Variable. (It should be under model > Tools > TrackedVariables)

6) Finally in the Data tab you can assign a Series Title for the data you're collecting. And then under the Data Point Value, if you want the average, enter the following command:

getstat(current,"",STAT_AVERAGE)

Hit Okay, and then you should be good to go.

I'm including my simple example model below.

trackedvarexample.fsm


5 |100000

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

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.