Class IndirectionSimulationUtil
- java.lang.Object
-
- org.palladiosimulator.indirections.scheduler.util.IndirectionSimulationUtil
-
public final class IndirectionSimulationUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndirectionSimulationUtil.Pair<A,B>
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addParameterToStackFrameWithCopying(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> contextStackFrame, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter, String parameterName, de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> targetStackFrame)
Same asSimulatedStackHelper.addParameterToStackFrame(SimulatedStackframe, EList, SimulatedStackframe)
but defaults for the parameters.static IndirectionDate
claimDataFromStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String id)
static IndirectionDate
createData(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> contextStack, Iterable<org.palladiosimulator.pcm.parameter.VariableUsage> variableUsages, Collection<Double> time)
static Map<String,Object>
createDataEntries(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> contextStack, Iterable<org.palladiosimulator.pcm.parameter.VariableUsage> variableUsages)
static void
createNewDataOnStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String id, IndirectionDate date)
static void
flatResolveTimes(Object timeDependency, List<Double> times)
static List<Double>
flatResolveTimes(List<Object> timeDependencies)
static void
flattenDataOnStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String baseName, IndirectionDate date)
static String
forceGetParameter(String parameterName, JavaClassDataChannel dataChannel)
static boolean
getBooleanParameter(JavaClassDataChannel dataChannel, String parameterName)
static double
getDoubleParameter(JavaClassDataChannel dataChannel, String parameterName)
static int
getIntegerParameter(JavaClassDataChannel dataChannel, String parameterName)
static org.palladiosimulator.pcm.repository.Parameter
getOneParameter(org.palladiosimulator.pcm.repository.EventGroup eventGroup)
static String
getStringParameter(JavaClassDataChannel dataChannel, String parameterName)
static de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object>
indirectionDateToStackframe(String baseName, IndirectionDate date)
static <T extends org.palladiosimulator.pcm.core.entity.Entity>
TinitName(T entity, String name)
static void
makeDateInformationAvailableOnStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String referenceName)
static void
requireExactNumberOfSinkSourceRoles(DataChannel dataChannel, int sinkRoleNumber, int sourceRoleNumber)
static void
requireNumberOfSinkSourceRoles(DataChannel dataChannel, Predicate<Integer> sinkRoleCheck, String sinkRoleCheckDescription, Predicate<Integer> sourceRoleCheck, String sourceRoleCheckDescription)
static String
rewriteVariableNamePrefix(String variableName, String incomingParameterName, String outgoingParameterName)
Changes the prefix in the given variable name from the parameter name of the incoming event type to the one of the outgoing event type.static Map<String,String>
toConfigMap(Collection<String> entries)
static de.uka.ipd.sdq.simucomframework.entities.SimuComEntity
triggerOnce(de.uka.ipd.sdq.simucomframework.model.SimuComModel model, double delay, Runnable taskToRun)
static org.palladiosimulator.simulizar.simulationevents.PeriodicallyTriggeredSimulationEntity
triggerPeriodically(de.uka.ipd.sdq.simucomframework.model.SimuComModel model, double firstOccurrence, double delay, Runnable taskToRun)
static void
validateIndirectionDateStructure(IndirectionDate date, DataInterface dataInterface)
static void
validateStackframeStructure(Map<String,Object> dataMap, String parameterName)
-
-
-
Method Detail
-
addParameterToStackFrameWithCopying
public static final void addParameterToStackFrameWithCopying(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> contextStackFrame, EList<org.palladiosimulator.pcm.parameter.VariableUsage> parameter, String parameterName, de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> targetStackFrame)
Same asSimulatedStackHelper.addParameterToStackFrame(SimulatedStackframe, EList, SimulatedStackframe)
but defaults for the parameters. Additionally, it can copy all characterizations for a type by specifying a reference name of: input->output- Parameters:
parameterName
-
-
claimDataFromStack
public static IndirectionDate claimDataFromStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String id)
-
createData
public static IndirectionDate createData(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> contextStack, Iterable<org.palladiosimulator.pcm.parameter.VariableUsage> variableUsages, Collection<Double> time)
-
createDataEntries
public static Map<String,Object> createDataEntries(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> contextStack, Iterable<org.palladiosimulator.pcm.parameter.VariableUsage> variableUsages)
-
createNewDataOnStack
public static void createNewDataOnStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String id, IndirectionDate date)
-
indirectionDateToStackframe
public static de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> indirectionDateToStackframe(String baseName, IndirectionDate date)
-
flattenDataOnStack
public static void flattenDataOnStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String baseName, IndirectionDate date)
-
getOneParameter
public static org.palladiosimulator.pcm.repository.Parameter getOneParameter(org.palladiosimulator.pcm.repository.EventGroup eventGroup)
-
initName
public static <T extends org.palladiosimulator.pcm.core.entity.Entity> T initName(T entity, String name)
-
initName
public static <T extends de.uka.ipd.sdq.identifier.Identifier> T initName(T identifier, String name)
-
makeDateInformationAvailableOnStack
public static void makeDateInformationAvailableOnStack(de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStack<Object> stack, String referenceName)
-
rewriteVariableNamePrefix
public static String rewriteVariableNamePrefix(String variableName, String incomingParameterName, String outgoingParameterName)
Changes the prefix in the given variable name from the parameter name of the incoming event type to the one of the outgoing event type.
-
triggerPeriodically
public static org.palladiosimulator.simulizar.simulationevents.PeriodicallyTriggeredSimulationEntity triggerPeriodically(de.uka.ipd.sdq.simucomframework.model.SimuComModel model, double firstOccurrence, double delay, Runnable taskToRun)
-
triggerOnce
public static de.uka.ipd.sdq.simucomframework.entities.SimuComEntity triggerOnce(de.uka.ipd.sdq.simucomframework.model.SimuComModel model, double delay, Runnable taskToRun)
-
validateIndirectionDateStructure
public static void validateIndirectionDateStructure(IndirectionDate date, DataInterface dataInterface)
-
validateStackframeStructure
public static void validateStackframeStructure(Map<String,Object> dataMap, String parameterName)
-
requireNumberOfSinkSourceRoles
public static void requireNumberOfSinkSourceRoles(DataChannel dataChannel, Predicate<Integer> sinkRoleCheck, String sinkRoleCheckDescription, Predicate<Integer> sourceRoleCheck, String sourceRoleCheckDescription)
-
requireExactNumberOfSinkSourceRoles
public static void requireExactNumberOfSinkSourceRoles(DataChannel dataChannel, int sinkRoleNumber, int sourceRoleNumber)
-
getDoubleParameter
public static double getDoubleParameter(JavaClassDataChannel dataChannel, String parameterName)
-
getIntegerParameter
public static int getIntegerParameter(JavaClassDataChannel dataChannel, String parameterName)
-
getBooleanParameter
public static boolean getBooleanParameter(JavaClassDataChannel dataChannel, String parameterName)
-
getStringParameter
public static String getStringParameter(JavaClassDataChannel dataChannel, String parameterName)
-
forceGetParameter
public static String forceGetParameter(String parameterName, JavaClassDataChannel dataChannel)
-
toConfigMap
public static Map<String,String> toConfigMap(Collection<String> entries)
-
-