Package net.simplace.sim.wrapper.util
Class JuliaWorkarounds
java.lang.Object
net.simplace.sim.wrapper.util.JuliaWorkarounds
Some workarounds needed by the Julia language scripts to access SimplaceWrapper
- Author:
- Gunther Krauss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FWSimSimulationcallCreateSimulation(SimplaceWrapper aWrapper, String[] aNames, Object[] aValues) Calls the wrapper's createSimulation with parameterMap constructed from names and values array.static FWSimSessioncallPrepareSession(SimplaceWrapper aWrapper, String aProject, String aSolution, String[] aNames, Object[] aValues) Calls the wrapper's createSimulation with parameterMap constructed from names and values array.static voidcallSetSimulationValues(SimplaceWrapper aWrapper, int aSimulationQueueIndex, String[] aNames, Object[] aValues) Calls the wrapper's setSimulationValues with parameterMap constructed from names and values array.static DataContainer[]callStepAll(SimplaceWrapper aWrapper, int aStepCount, boolean aParallelized) Calls the wrapper's stepAll with parameterMap constructed from names and values array.static DataContainer[]callStepAll(SimplaceWrapper aWrapper, String[] aOutputFilterArray, int aStepCount, boolean aParallelized) Calls the wrapper's stepAll with parameterMap constructed from names and values array.static DataContainercallStepSpecific(SimplaceWrapper aWrapper, int aSimulationQueueIndex, String[] aNames, Object[] aValues, int aStepCount) Calls the wrapper's stepSpecific with parameterMap constructed from names and values array.static DataContainercallStepSpecific(SimplaceWrapper aWrapper, int aSimulationQueueIndex, String[] aNames, Object[] aValues, String[] aOutputFilterArray, int aStepCount) Calls the wrapper's stepSpecific with parameterMap constructed from names and values array.static ObjectcastArrayToObject(Object[] array) Helper function when wrappers in other languages can't typecast arrays to objects.static Object[][]combineNamesValues(String[] aNames, Object[] aValues) Creates a two dimensional object array from an array of strings and array of values The resulting object n entries of lenght two (sub)objects - first entry has the name, second the value.
-
Constructor Details
-
JuliaWorkarounds
public JuliaWorkarounds()
-
-
Method Details
-
castArrayToObject
Helper function when wrappers in other languages can't typecast arrays to objects.- Parameters:
array- an Array- Returns:
- the Array as Object
-
combineNamesValues
Creates a two dimensional object array from an array of strings and array of values The resulting object n entries of lenght two (sub)objects - first entry has the name, second the value.- Parameters:
aNames- Array with namesaValues- Array with values- Returns:
- two dimensional object array
-
callCreateSimulation
public static FWSimSimulation callCreateSimulation(SimplaceWrapper aWrapper, String[] aNames, Object[] aValues) throws Exception Calls the wrapper's createSimulation with parameterMap constructed from names and values array.- Parameters:
aWrapper- - instance of SimplaceWrapperaNames- - array of variable namesaValues- - array of values- Returns:
- simulation
- Throws:
Exception
-
callPrepareSession
public static FWSimSession callPrepareSession(SimplaceWrapper aWrapper, String aProject, String aSolution, String[] aNames, Object[] aValues) Calls the wrapper's createSimulation with parameterMap constructed from names and values array.- Parameters:
aWrapper- - instance of SimplaceWrapperaProject- - path to proj.xmlaSolution- - path to sol.xmlaNames- - array of variable namesaValues- - array of values- Returns:
- session
-
callSetSimulationValues
public static void callSetSimulationValues(SimplaceWrapper aWrapper, int aSimulationQueueIndex, String[] aNames, Object[] aValues) Calls the wrapper's setSimulationValues with parameterMap constructed from names and values array.- Parameters:
aWrapper- - instance of SimplaceWrapperaSimulationQueueIndex- - index of the simulation in the queueaNames- - array of variable namesaValues- - array of values
-
callStepSpecific
public static DataContainer callStepSpecific(SimplaceWrapper aWrapper, int aSimulationQueueIndex, String[] aNames, Object[] aValues, int aStepCount) throws Exception Calls the wrapper's stepSpecific with parameterMap constructed from names and values array.- Parameters:
aWrapper- - instance of SimplaceWrapperaSimulationQueueIndex- - index of the simulation in the queueaNames- - array of variable namesaValues- - array of valuesaStepCount- - number of simulation steps to perform- Returns:
- varMap with simulated values of last step
- Throws:
Exception
-
callStepSpecific
public static DataContainer callStepSpecific(SimplaceWrapper aWrapper, int aSimulationQueueIndex, String[] aNames, Object[] aValues, String[] aOutputFilterArray, int aStepCount) throws Exception Calls the wrapper's stepSpecific with parameterMap constructed from names and values array.- Parameters:
aWrapper- - instance of SimplaceWrapperaSimulationQueueIndex- - index of the simulation in the queueaNames- - array of variable namesaValues- - array of valuesaOutputFilterArray- - array of variable names that should be included into the resultaStepCount- - number of simulation steps to perform- Returns:
- varMap with simulated values of last step
- Throws:
Exception
-
callStepAll
public static DataContainer[] callStepAll(SimplaceWrapper aWrapper, int aStepCount, boolean aParallelized) throws Exception Calls the wrapper's stepAll with parameterMap constructed from names and values array.- Parameters:
aWrapper- - instance of SimplaceWrapperaStepCount- - number of simulation steps to performaParallelized- - if true it uses parallel Streams - experimental!- Returns:
- array of varMaps with simulated values of last step
- Throws:
Exception
-
callStepAll
public static DataContainer[] callStepAll(SimplaceWrapper aWrapper, String[] aOutputFilterArray, int aStepCount, boolean aParallelized) throws Exception Calls the wrapper's stepAll with parameterMap constructed from names and values array.- Parameters:
aWrapper- - instance of SimplaceWrapperaOutputFilterArray- - array of variable names that should be included into the resultaStepCount- - number of simulation steps to performaParallelized- - if true it uses parallel Streams - experimental!- Returns:
- array of varMaps with simulated values of last step
- Throws:
Exception
-