AnyLogic
Expand
Font size
All Known Implementing Classes:
Agent, Experiment, ExperimentCompareRuns, ExperimentMultipleRuns, ExperimentOptimization, ExperimentParamVariation, ExperimentRunFast, ExperimentSimulation, FlowchartBlock, Utilities

@AnyLogicInternalAPI
public interface CodeValueExecutor
This class is internal and shouldn't be called by user.
it may be removed/renamed in future.
Class containing some executable action / evaluatable expression code inside.
Author:
AnyLogic North America, LLC https://anylogic.com

Method Summary

Modifier and TypeMethodDescription
<T> TexecuteExpression(Class<T> returnType, String code, Object... argDescriptors)
Executes/evaluates the given code, e.g.

Method Details

executeExpression

<T> T executeExpression(Class<T> returnType,
 String code,
 Object... argDescriptors)
Executes/evaluates the given code, e.g. executeExpression( "exponential( 10 )" ).
If provided, uses the given arguments, specified in the form of pair: name, value. In the following example:
executeExpression( String.class, "agent.getName() + index", "agent", agent, "index", i - 1 )
the code will operate with variables agent and index of types Agent and Integer
Parameters:
returnType - return-type of expression, may be void.class - for actions
code - java code of expression / action
argDescriptors - array of pairs: argName1, argValue1, argName2, argValue2, ...
Returns:
evaluated expression result