question

SudheerReddy avatar image
0 Likes"
SudheerReddy asked Joerg Vogel edited

In statistics collector, meaning of data.StateProfileNode?.rank

1)data.StateProfileNode?.rank in this code what is ? does. Could you please provide any reference to user manual. When to use and how to use "?" in code.

2)data.StateProfileNode?.rank this code is returning in Profile column 1 or 0. Could you please explain why 1 for Process1 or Process2 and 0 for all remaining states.

FlexSim 19.2.0
statistics collector
d1.jpg (80.7 KiB)
d2.jpg (102.6 KiB)
d2.jpg (102.6 KiB)
· 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.

SudheerReddy avatar image SudheerReddy commented ·
0 Likes 0 ·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Joerg Vogel edited

@Jörg Vogel is correct. The syntax

something?.label

Is used when you want to get the label's value if it exists, and null otherwise. It prevents an error from accessing a non-existant label. It isn't documented.

The reason the profile rank returns 1 or 0 is because the profile node doesn't exist for the default states. When you write down a null value as a number, it becomes a 0.

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

Joerg Vogel avatar image Joerg Vogel commented ·

It is testing parameter wether the label node exists or not to prevent an exception.

It is now documented in treenode class as ? Operator for non-existing labels in treenode.labelProperties.

0 Likes 0 ·
Ralf Gruber avatar image
0 Likes"
Ralf Gruber answered

Sudheer,

the Multiprocessor uses the "native" state profile referred to with "0" and another custom state profile referred to with "1". If you are not familiar with custom state profiles, search in this forum for "custom state 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.

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.