Class ControlManager#
Defined in Program listing for file control/src/utils/ControlManager.hpp
-
class ControlManager#
ControlManager Class: tools to provide control in a Simulation (Sensors, Actuators, Observers)
This class is used to handle all the sensors and actuators declared by the user and to schedule them into the simulation.
A ControlManager has:
The usual way to define control over a system is as follows:
declare a ControlManager and associate it with a Simulation
add some sensors and actuators into the ControlManager
initialize the ControlManager (which will result in the recording of all actuators and sensors into the list of events processed during the simulation)
optionally add some new sensor/actuator at any time but with a specific function: addAndRecord(…). A call to this function results in the creation of a Sensor/Actuator and in the insertion of the corresponding event into the simulation eventsManager.
Public Functions
-
ControlManager(SP::Simulation sim)#
Constructor with a Simulation, to which control will be applied.
- Parameters:
sim – the Simulation
-
virtual ~ControlManager()#
destructor
-
inline SP::Simulation simulation() const#
get the Simulation linked to this ControlManager
- Returns:
a SP::Simulation
-
inline const Sensors getSensors() const#
get the list of Sensors associated to this manager.
- Returns:
a Sensors object.
-
inline const Actuators getActuators() const#
get the list of Actuators associated to this manager.
- Returns:
a Actuators object.
-
inline const Observers getObservers() const#
get the list of Observers associated to this manager.
- Returns:
a Observers object.
-
SP::Sensor addSensor(int name, SP::TimeDiscretisation td, SP::DynamicalSystem ds)#
To build and add a new Sensor in the Manager.
-
SP::Sensor addAndRecordSensor(int name, SP::TimeDiscretisation td, SP::DynamicalSystem ds, const NonSmoothDynamicalSystem &nsds)#
To build, add, initialize a new Sensor in the Manager and record it in the simulation This function is only useful to add a new Sensor after the initialization of the manager else call addSensor()
-
void addSensorPtr(SP::Sensor s, SP::TimeDiscretisation td)#
Add an existing Sensor to the Manager.
- Parameters:
s – a SP::Sensor to the Sensor we want to add
td – the TimeDiscretisation used for the associated Event
-
void addAndRecordSensorPtr(SP::Sensor s, SP::TimeDiscretisation td, const NonSmoothDynamicalSystem &nsds)#
To add, initialize an existing Sensor in the manager and record it in the simulation This function is only useful to add a new Sensor after the initialization of the manager else call addSensor()
- Parameters:
s – a SP::Sensor to the Sensor we want to add
td – the TimeDiscretisation used for the associated Event
nsds – current nonsmooth dynamical system
-
SP::Actuator addActuator(int name, SP::TimeDiscretisation td, SP::ControlSensor sensor)#
To build and add a new Actuator in the Manager.
- Parameters:
name – the type of the Actuator
td – the SP::TimeDiscretisation of the Actuator
sensor – the ControlSensor used to feed the Actuator
- Returns:
the added Actuator
-
SP::Actuator addAndRecordActuator(int name, SP::TimeDiscretisation t, SP::ControlSensor sensor, const NonSmoothDynamicalSystem &nsds)#
To build, add, initialize a new Actuator in the manager and record it in the simulation This function is only useful to add a new Actuator after the initialization of the manager else call addActuator()
- Parameters:
name – the type of the Actuator
t – the SP::TimeDiscretisation of the Actuator
sensor – the ControlSensor used to feed the Actuator
nsds – the NonSmoothDynamicalSystem
- Returns:
a SP::Actuator to the added Actuator
-
void addActuatorPtr(SP::Actuator act, SP::TimeDiscretisation td)#
Add an existing Actuator to the manager.
- Parameters:
act – a SP::Actuator to the Actuator we want to add
td – the TimeDiscretisation used for the associated Event
-
void addAndRecordActuatorPtr(SP::Actuator act, SP::TimeDiscretisation td, const NonSmoothDynamicalSystem &nsds)#
To add, initialize an existing Actuator in the manager and record it in the simulation This function is only useful to add a new Actuator after the initialization of the manager otherwise call addActuator()
- Parameters:
act – a SP::Actuator to the Actuator we want to add
td – the TimeDiscretisation used for the associated Event
nsds – current nonsmooth dynamical system
-
SP::Observer addObserver(int name, SP::TimeDiscretisation td, SP::ControlSensor sensor, const SiconosVector &xHat0)#
To build and add a new Observer in the Manager.
- Parameters:
name – the type of the Observer
td – the SP::TimeDiscretisation of the Observer
sensor – the ControlSensor feeding the Observer
xHat0 – the initial guess for the state
- Returns:
a SP::ACtuator to the added Observer
-
SP::Observer addAndRecordObserver(int name, SP::TimeDiscretisation td, SP::ControlSensor sensor, const SiconosVector &xHat0, const NonSmoothDynamicalSystem &nsds)#
To build, add, initialize a new Observer in the manager and record it in the simulation This function is only useful to add a new Observer after the initialization of the manager else call addObserver()
- Parameters:
name – the type of the Observer
td – the SP::TimeDiscretisation of the Observer
sensor – the ControlSensor feeding the Observer
xHat0 – the initial guess for the state
nsds – current nonsmooth dynamical system
- Returns:
the added Observer
-
void addObserverPtr(SP::Observer obs, SP::TimeDiscretisation td)#
Add an existing Observer to the manager.
- Parameters:
obs – a SP::Observer to the Observer we want to add
td – the TimeDiscretisation used for the associated Event
-
void addAndRecordObserverPtr(SP::Observer obs, SP::TimeDiscretisation td, const NonSmoothDynamicalSystem &nsds)#
To add, initialize an existing Observer in the manager and record it in the simulation This function is only useful to add a new Observer after the initialization of the manager otherwise call addObserver()
- Parameters:
obs – a SP::Observer to the Observer we want to add
td – the TimeDiscretisation used for the associated Event
nsds – current nonsmooth dynamical system
-
void initialize(const NonSmoothDynamicalSystem &nsds)#
initialize all Sensors, Observers and Actuators.
- Parameters:
nsds – current nonsmooth dynamical system
-
void display() const#
display the data of the ControlManager on the standard output