# siconos.control.simulation.ControlManager (Python class)¶

class siconos.control.simulation.ControlManager(*args)[source]

Bases: object

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:

• a list of Sensor
• a list of Actuator
• a link to an existing Simulation

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.

Generated class (swig), based on C++ header Program listing for file control/src/utils/ControlManager.hpp.

Constructors

ControlManager(Simulation sim)

Constructor with a Simulation, to which control will be applied.

Parameters: sim – the Simulation
addActuator(int name, TimeDiscretisation td, ControlSensor sensor) → Actuator[source]

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 the added Actuator
addActuatorPtr(Actuator act, TimeDiscretisation td) → None[source]

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
addAndRecordActuator(int name, TimeDiscretisation t, ControlSensor sensor, NonSmoothDynamicalSystem nsds) → Actuator[source]

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 a SP::Actuator to the added Actuator
addAndRecordActuatorPtr(Actuator act, TimeDiscretisation td, NonSmoothDynamicalSystem nsds) → None[source]

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
addAndRecordObserver(int name, TimeDiscretisation td, ControlSensor sensor, array_like (np.float64, 1D) xHat0, NonSmoothDynamicalSystem nsds) → Observer[source]

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 the added Observer
addAndRecordObserverPtr(Observer obs, TimeDiscretisation td, NonSmoothDynamicalSystem nsds) → None[source]

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
addAndRecordSensor(int name, TimeDiscretisation td, DynamicalSystem ds, NonSmoothDynamicalSystem nsds) → Sensor[source]

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()

Parameters: name – the type (int) of the Sensor td – the SP::TimeDiscretisation of the Sensor ds – the DynamicalSystem used in the Sensor nsds – the NonSmoothDynamicalSystem a SP::Sensor to the added Sensor
addAndRecordSensorPtr(Sensor s, TimeDiscretisation td, NonSmoothDynamicalSystem nsds) → None[source]

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
addObserver(int name, TimeDiscretisation td, ControlSensor sensor, array_like (np.float64, 1D) xHat0) → Observer[source]

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 a SP::ACtuator to the added Observer
addObserverPtr(Observer obs, TimeDiscretisation td) → None[source]

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
addSensor(int name, TimeDiscretisation td, DynamicalSystem ds) → Sensor[source]

To build and add a new Sensor in the Manager.

Parameters: name – the type of the Sensor td – the SP::TimeDiscretisation of the Sensor ds – the DynamicalSystem used in the Sensor a SP::Sensor to the added Sensor
addSensorPtr(Sensor s, TimeDiscretisation td) → None[source]

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
display() → None[source]

display the data of the ControlManager on the standard output

getActuators() → Actuators[source]

get the list of Actuators associated to this manager.

Returns: a Actuators object.
getObservers() → Observers[source]

get the list of Observers associated to this manager.

Returns: a Observers object.
getSensors() → Sensors[source]

get the list of Sensors associated to this manager.

Returns: a Sensors object.
initialize(NonSmoothDynamicalSystem nsds) → None[source]

initialize all Sensors, Observers and Actuators.

Parameters: nsds – current nonsmooth dynamical system
simulation() → Simulation[source]

get the Simulation linked to this ControlManager

Returns: a SP::Simulation