Package net.maswag.falcaun
Class SimulinkSUL
java.lang.Object
net.maswag.falcaun.SimulinkSUL
- All Implemented Interfaces:
de.learnlib.sul.SUL<List<Double>,,IOSignalPiece<List<Double>>> Closeable,AutoCloseable,ContinuousNumericSUL,NumericSUL
The System Under Learning implemented by a Simulink. We use the fixed step execution of Simulink to make sampling easier.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanFork()voidclear()Clear the counter and the time measure.voidclose()Close the MATLAB engine.Execute the Simulink model by feeding inputSignalexecuteRaw(net.automatalib.word.Word<List<Double>> inputSignal) Execute the Simulink model by feeding inputSignalde.learnlib.sul.SUL<List<Double>, IOSignalPiece<List<Double>>> fork()intReturns the number of SUL executionsdoubleReturns the execution time for the simulationsvoidpost()voidpre()voidsetSimulationStep(double simulinkSimulationStep) Setter of simulinkSimulationStepExecute the SUL by feeding single step input.
-
Field Details
-
model
The simulation step of Simulink.If this value is too large, Simulink can abort due to an computation error. In that case, you should make this value larger.
-
-
Constructor Details
-
SimulinkSUL
public SimulinkSUL(String initScript, List<String> paramNames, Double signalStep, Double simulinkSimulationStep) throws InterruptedException, ExecutionException
-
-
Method Details
-
setSimulationStep
public void setSimulationStep(double simulinkSimulationStep) Setter of simulinkSimulationStep- Parameters:
simulinkSimulationStep- The fixed simulation step of Simulink. If this value is too large, Simulink can abort due to an computation error.
-
canFork
public boolean canFork()- Specified by:
canForkin interfacede.learnlib.sul.SUL<List<Double>,IOSignalPiece<List<Double>>>
-
pre
public void pre()- Specified by:
prein interfaceNumericSUL- Specified by:
prein interfacede.learnlib.sul.SUL<List<Double>,IOSignalPiece<List<Double>>>
-
post
public void post()- Specified by:
postin interfaceNumericSUL- Specified by:
postin interfacede.learnlib.sul.SUL<List<Double>,IOSignalPiece<List<Double>>>
-
step
@Nullable public ExtendedIOSignalPiece<List<Double>> step(@Nullable List<Double> inputSignal) throws de.learnlib.exception.SULException Execute the SUL by feeding single step input.- Specified by:
stepin interfaceContinuousNumericSUL- Specified by:
stepin interfacede.learnlib.sul.SUL<List<Double>,IOSignalPiece<List<Double>>> - Parameters:
inputSignal- the input signal at one time step- Returns:
- the output signal at one time step with the previous output signals
- Throws:
de.learnlib.exception.SULException
-
execute
public IOContinuousSignal<List<Double>> execute(net.automatalib.word.Word<List<Double>> inputSignal) throws InterruptedException, ExecutionException Execute the Simulink model by feeding inputSignalFor inputSignal = a1, a2, ..., an, we construct a timed word w = (a1, 0), (a2, T), (a3, 2 * T), ... (an, (n - 1) * T) and execute the Simulink model by feeding the piecewise-linear interpolation of w.
- Specified by:
executein interfaceContinuousNumericSUL- Specified by:
executein interfaceNumericSUL- Parameters:
inputSignal- The input signal- Returns:
- The output signal. The size is same as the input.
- Throws:
InterruptedExceptionExecutionException
-
executeRaw
public ValueWithTime<List<Double>> executeRaw(net.automatalib.word.Word<List<Double>> inputSignal) throws ExecutionException, InterruptedException Execute the Simulink model by feeding inputSignal -
fork
@Nonnull public de.learnlib.sul.SUL<List<Double>,IOSignalPiece<List<Double>>> fork() throws UnsupportedOperationException- Specified by:
forkin interfacede.learnlib.sul.SUL<List<Double>,IOSignalPiece<List<Double>>> - Throws:
UnsupportedOperationException
-
close
public void close()Close the MATLAB engine. This method must be called when the object is no longer used.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getSimulationTimeSecond
public double getSimulationTimeSecond()Returns the execution time for the simulations- Specified by:
getSimulationTimeSecondin interfaceNumericSUL
-
getCounter
public int getCounter()Returns the number of SUL executions- Specified by:
getCounterin interfaceNumericSUL
-
clear
public void clear()Description copied from interface:NumericSULClear the counter and the time measure.- Specified by:
clearin interfaceNumericSUL
-