question

Jason Botha avatar image
3 Likes"
Jason Botha asked Felix Möhlmann commented

Add custom state to a state gantt chart

Hi there,

Is it possible to make a State Gantt chart display a custom state? I want to define a state called "WaitForManager" and then i want this to be displayed by the State Gantt.

Any assistance would be appreciated.

FlexSim 16.1.2
statesstate gantt
5 |100000

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

Sam Stubbs avatar image
11 Likes"
Sam Stubbs answered anthony.johnson commented

There is a template for custom states within the MultiProcessor object in the library. So if you drag one out into the model. You can get to the object's tree view by right clicking the object and selecting Explore Tree View. If you expand the object in the tree view, under stats>state_profiles>MultiProcessor States>profile, "profile contains a table of custom states. You can select the "state_profiles" and copy it. Then open your operator's tree view, and expand stats. Then right-click on stats, and select node>Insert Into. This will create a blank node. You can select that node, and paste the "state_profiles" into it. Change MultiProcessor States to something else like CustomOperator States. And then you can right click on the "profile" node, and select Explore > As Table. This brings up a table of your custom states. You can rename them, or add or remove as many rows/states as you want (just leave the time and active alone).

In your model you can use the "setstate()" command, with the operator object as your first parameter, the state number (the row of your state from a 0-based index) and the last number being the state profile you are setting.

So if you are using the above example your setstate command would be something like this:

setstate(current,0,1)

Where current is the operator, 0 is the first state in the list of states, and 1 is the profile your are using.

Finally to display your custom state in the Gantt Chart, open up the State Gantt chart's properties, and make sure the Object list includes your operator with the custom states. At the bottom under the state profile dropdown menu, you should be able to select your CustomOperator States or whatever you named the profile.


customstates.gif (679.1 KiB)
viewastable.png (10.7 KiB)
· 3
5 |100000

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

Jason Botha avatar image Jason Botha commented ·

Awesome answer thank you so much.

Is there a reason why the same process cannot be followed for a Processor? I tried and the State Profile drop down remained blanked out.

Thanks again!

0 Likes 0 ·
A Kamphaus avatar image A Kamphaus commented ·

Are there any plans to build the custom states into the operators in the future?

0 Likes 0 ·
anthony.johnson avatar image anthony.johnson ♦♦ A Kamphaus commented ·

We've had it on our dev list to make it easier to add custom state profiles to an object. It just hasn't yet gotten high up on the priority list, perhaps partly because there is a workaround of doing it through the tree. If you want you can post that as an idea so others can vote it up.

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

I'm using the info from this older thread to implement custom state profiles in my model (version 23.0).

I assume that "time" is the cumulative time spent in a given state that's automatically set and reset during the simulation run, but what does "active" refer to? The answer above says to leave it alone, but if this refers to the "Analysis" column of the state table (ex. blank/utilized/excluded), I definitely want to set this correctly so that I can perform the state analysis. Does anyone happen to know? Thanks!

· 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.

Felix Möhlmann avatar image Felix Möhlmann commented ·

I don't actually know what the "active" column is used for for sure. I believe it might just be used to show which states are actually used by the object.

I can however say that it does not influence the analysis in any way. Only the state table(s) control if the state is counted as "utilized" time or not.

This makes sense, because you could have two states chart that use different state tables. In one the setup time might count as utilized and not in the other. As such, this information can't be stored on the object itself, but must be independent from it.

1 Like 1 ·

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.