siconos.control.controller.Actuator (Python class)

class siconos.control.controller.Actuator(*args, **kwargs)[source]

Bases: object

Actuators Base Class.

Abstract class, interface to user-defined actuators.

An Actuator is dedicated to act on parameters of the Model (especially z param. in DynamicalSystem) according to some specific values recorded thanks to sensors. It gives an interface for User who can implement its own Actuator. clearly define which data he needs to save.

An Actuator handles a TimeDiscretisation, which defines the set of all instants where the Actuator must operate

(i.e. each times where actuate() function will be called). An Event, inserted

into the EventsManager of the Simulation, is linked to this TimeDiscretisation.

Moreover, an Actuator is identified thanks to an id and a type (a number associated to the derived class type indeed). Construction To build an Actuator it is necessary to use the factory. Inputs are a number which identify the derived class type and a TimeDiscretisation:

The best way is to use the controlManager:

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

Constructors

Actuator(int type, ControlSensor sensor)

General Constructor.

Parameters:
  • type – the type of the Actuator, which corresponds to the class type
  • sensor – the ControlSensor feeding the Actuator
Actuator(int type, ControlSensor sensor, array_like (np.float64, 2D) B)

General Constructor with dynamics affine in control.

Parameters:
  • type – the type of the Actuator, which corresponds to the class type
  • sensor – the ControlSensor feeding the Actuator
actuate() → void[source]

actuate()=0 -> None

capture data when the ActuatorEvent is processed

addSensorPtr(ControlSensor newSensor) → None[source]

add a Sensor in the actuator.

Parameters:newSensor – a Sensor that will be connected to the Actuator
display() → None[source]

display the data of the Actuator on the standard output

getId() → str[source]

get id of the Actuator

Returns:a std::string
getInternalNSDS() → NonSmoothDynamicalSystem[source]

get the NSDS used in the Controller, if there is one

Returns:
  • “NULL” shared_ptr if there is no internal simulation, otherwise it return the
  • Model hoding the simulation
getType() → int[source]

get the type of the Actuator (ie class name)

Returns:an integer
initialize(NonSmoothDynamicalSystem nsds, Simulation s) → None[source]

initialize actuator data.

Parameters:
  • nsds – the NonSmoothDynamicalSystem
  • s – the simulation
setB(array_like (np.float64, 2D) B) → None[source]

Set the B matrix.

Parameters:B – the new B matrix
setId(str newId) → None[source]

set id of the Actuator

Parameters:newId – the new id.
setSizeu(size) → None[source]

Set the control size.

Parameters:size – dimension of the control input u
setTimeDiscretisation(TimeDiscretisation td) → None[source]

This is derived in child classes if they need to copy the TimeDiscretisation associated with this Actuator.

Parameters:td – the TimeDiscretisation for this Actuator
setg(str g) → None[source]

Set the name of the plugin for computing g.

Parameters:g – the name of the plugin to compute g
u() -> array_like (np.float64, 1D)[source]

Get the control value.

Returns:current control value u