Ralf Gruber avatar image
Ralf Gruber asked Jordan Johnson commented

Multiprocessor State Profile

Hi guys,

attached is a simple model 20201018_MultiprocessorStates.fsm with a Multiprocessor including three processes, the first one requiring an operator. The dashboard shows a state bar for both, the default state profile and the multiprocessor state profile. I just let one item pass and while the Default state profile considers the waiting time for the operator in process 1as a dedicated state, the MP profile is accounting for the waiting time with the "Process 1" State. Is there a reason why this is not included with "None"? I think this could be potentially very misleading.

In relation to this, I believe the manual section about Multiprocessor States needs to be explained better. From reading one could get the impression, that user defined states can be mixed with default states.



FlexSim 20.2.3
flexsim 20.2.3multiprocessorstate profiles
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
1 Like"
Jordan Johnson answered Jordan Johnson commented

I agree the manual could be more clear. I'll add that issue to the dev list.

As far as how the states are being recorded, the behavior matches the documentation:

At the beginning of each process, the multiprocessor calls the process time field, sets its state to the name of the process, and calls operators if the number of operators value is greater than 0. When the process is finished, the multiprocessor releases all operators called for that process, and calls the process finish trigger.

Statistically, though, you may want to know more granular information. I would recommend using a Categorical Combo tracked variable. Its purpose is to observe two (or more) state profiles, and record the time spent in each combination of both states. Here is a script to add one to the multiprocessor:

treenode target = Model.find("MultiProcessor1");
treenode profiles = state_profiles(target);
treenode combo = profiles.subnodes.add(); = "state_process_profile";
var tv = TrackedVariable.init(combo, STAT_TYPE_CATEGORICAL_COMBO);

Running this code adds a combined profile to the list of profiles in the multiprocessor. You don't have to do anything else; the combo profile listens to the state changes in the other two profiles, and sets itself to the correct state automatically. If you make a chart using this profile, you get something like the following:

Note that there is a section for how long Process1 waits for an operator. In more complex models, there may be other combinations of states.


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

Arun avatar image Arun commented ·

Hi Jordan,

Is there any way to add the same function to "Item gantt" and "State Gantt".
1716834241173.pngThanks in advance!


0 Likes 0 ·
1716834241173.png (40.6 KiB)
test.fsm (57.3 KiB)
Felix Möhlmann avatar image Felix Möhlmann Arun commented ·

Getting this to work with a state gantt should in theory be easy. All that's required is to set the Statistics Collector to listen for changes in the respective combo state profile and link to a state table that contains the correct state name information. (Running the model once and then filling a new state table based on the combo profile is a quick way to generate this. Use the sampling tool of the state table on the multiprocessor to get this option.)

To get the different states to show up on the item trace gantt chart requires to edit the Process Flow that tracks the item (install the chart components to access the flow). Instead of just waiting until the item exits its current object, the token needs to also listen for any state changes of the object and make the Statistics Collector generate a new row with updated state information.

This does mostly work as shown in the attached model. However, some changes in the combo state are not registered by either the State Gantt collector nor the Wait for Event activity in the Item Trace Flow. (The "Wait for operator" states and "C3" do not show up in the charts, despite the combo profile definitely entering these)

Maybe @Jordan Johnson can investigate further when he gets around to it.


0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Arun commented ·

Updating the Item Trace Gantt to include combined multiprocessor states would be tricky. You'd have to change quite a few things, since the item trace gantt assumes you are listening to a single profile. As the item flows through various objects, you'd have to switch which profile you were listening to somehow. So I don't know how to get that to work. Honestly, I'm not sure I see the value in such a chart.

As @Felix Möhlmann says, modifying the state gantt should be easy. In fact, you should just be able to add a normal state gantt chart and choose the correct profile, assuming you already created the combo profile. You shouldn't even need to install the chart. I tried it in Felix's model, and it seemed to work, although it required two resets (seems fishy, but not too big a deal).

0 Likes 0 ·