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 TypeMethodDescriptionboolean
canFork()
void
clear()
Clear the counter and the time measure.void
close()
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()
int
Returns the number of SUL executionsdouble
Returns the execution time for the simulationsvoid
post()
void
pre()
void
setSimulationStep
(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:
canFork
in interfacede.learnlib.sul.SUL<List<Double>,
IOSignalPiece<List<Double>>>
-
pre
public void pre()- Specified by:
pre
in interfaceNumericSUL
- Specified by:
pre
in interfacede.learnlib.sul.SUL<List<Double>,
IOSignalPiece<List<Double>>>
-
post
public void post()- Specified by:
post
in interfaceNumericSUL
- Specified by:
post
in 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:
step
in interfaceContinuousNumericSUL
- Specified by:
step
in 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:
execute
in interfaceContinuousNumericSUL
- Specified by:
execute
in interfaceNumericSUL
- Parameters:
inputSignal
- The input signal- Returns:
- The output signal. The size is same as the input.
- Throws:
InterruptedException
ExecutionException
-
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:
fork
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getSimulationTimeSecond
public double getSimulationTimeSecond()Returns the execution time for the simulations- Specified by:
getSimulationTimeSecond
in interfaceNumericSUL
-
getCounter
public int getCounter()Returns the number of SUL executions- Specified by:
getCounter
in interfaceNumericSUL
-
clear
public void clear()Description copied from interface:NumericSUL
Clear the counter and the time measure.- Specified by:
clear
in interfaceNumericSUL
-