Package com.nomagic.magicdraw.simulation
Class SimulationHelper
java.lang.Object
com.nomagic.magicdraw.simulation.SimulationHelper
The helper class of the cameo simulation toolkit.
- Since:
- CST 2021x
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<fUML.Semantics.Classes.Kernel.FeatureValue>
findFeatureValue
(fUML.Semantics.Classes.Kernel.CompoundValue runtimeContext, List<Property> propertyPath, Property target) Collect all featureValue objects which are matching with the given nested property path in the given runtime object.getAvailableSignals
(fUML.Semantics.Classes.Kernel.StructuredValue target, ExecutionEngine engine) Get availableSignals from the specified StructuredValue.static Element
getConfigElement
(SimulationExecution execution) Gets simulation config element from simulation execution.static Object
getSimulationOptionValue
(String name, Element context) Get the simulation option value In case there is no execution, will try to return the option value from project or environment options of the toolstatic Boolean
isFeatureValueInvalid
(fUML.Semantics.Classes.Kernel.FeatureValue featureValue, int index) Check the specified FeautureValue is invalid value or not.
-
Constructor Details
-
SimulationHelper
public SimulationHelper()
-
-
Method Details
-
findFeatureValue
public static List<fUML.Semantics.Classes.Kernel.FeatureValue> findFeatureValue(fUML.Semantics.Classes.Kernel.CompoundValue runtimeContext, List<Property> propertyPath, Property target) Collect all featureValue objects which are matching with the given nested property path in the given runtime object.- Parameters:
runtimeContext
- is the runtime object which is the owner of the returned runtime values, specified by propertyPath.propertyPath
- is the property path to the requires runtime values. The first property in the propertyPath must be owned by the classifier that type the owner. to be found.target
- target Property- Returns:
- list of runtime values which are reside in the given 'owner' and matching to the given nested propertyPath.
-
getConfigElement
Gets simulation config element from simulation execution.- Parameters:
execution
- SimulationExecution- Returns:
- Simulation config element or null.
-
isFeatureValueInvalid
@CheckForNull public static Boolean isFeatureValueInvalid(@CheckForNull fUML.Semantics.Classes.Kernel.FeatureValue featureValue, int index) Check the specified FeautureValue is invalid value or not.- Parameters:
featureValue
- the specified FeautureValueindex
- index of the value- Returns:
- Boolean.TRUE if featureValue is invalid. Boolean.FALSE if featureValue is valid. null if featureValue is not evaluated.
-
getAvailableSignals
public static Set<Signal> getAvailableSignals(@CheckForNull fUML.Semantics.Classes.Kernel.StructuredValue target, @CheckForNull ExecutionEngine engine) Get availableSignals from the specified StructuredValue.- Parameters:
target
- the specified StructuredValueengine
- ExecutionEngine- Returns:
- Set
-
getSimulationOptionValue
@CheckForNull public static Object getSimulationOptionValue(String name, @CheckForNull Element context) Get the simulation option value In case there is no execution, will try to return the option value from project or environment options of the tool- Parameters:
name
- the simulation option name constant (usually fromSimulationOptions
)- Returns:
- the simulation option value, if exists
-