# stl-control-imitation
stl-control-imitation is a framework based on Breach Matlab toolbox to teach a neural network to imitate a given controller.
## Interfacing a new case study
### Define params, states, controls
This determines the fundamental caracteristics of the problem.
States have nominal values and initial ranges. They are declared in a structured form as follows:
```matlab
% state named x
pb.states.x.nominal= 0;
pb.states.x.range_init = [-1 1];
% state named y
pb.states.y.nominal= 3;
pb.states.y.range_init = [2 4];
```
### Define a control function
Control function are expected to have the following form:
```matlab!
[u, cost] = mpc_control(x,opt)
```
### Define a simulation function
### Define a requirement
### Putting it together in a imitation_pb class
## Initial testing
- test nominal will run a simulation with nominal values for initial states and parameters and stuff.
## Misc
### Result structure
Call to `pb.algo2` returns a `all_results` cell array of structures of the form:
```matlab!
res.nn % neural network
res.Btrain % Samples used for training of nn
res.Btrain_grid % grid samples covered by Btrain
res.Bcex_traces % (optional) counter examples found for nn
```