File control/src/Controller/Actuator.hpp

Go to the source code of this file

General interface to define an actuator.

class Actuator
#include <Actuator.hpp>

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

Subclassed by CommonSMC, PID

Public Functions

Actuator(unsigned int type, SP::ControlSensor sensor)

General Constructor.


Actuator(unsigned int type, SP::ControlSensor sensor, SP::SimpleMatrix B)

General Constructor with dynamics affine in control.


virtual ~Actuator()


virtual void actuate() = 0

capture data when the ActuatorEvent is processed

void addSensorPtr(SP::ControlSensor newSensor)

add a Sensor in the actuator.


virtual void display() const

display the data of the Actuator on the standard output

const std::string getId() const

get id of the Actuator


a std::string

virtual SP::NonSmoothDynamicalSystem getInternalNSDS() const

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


”NULL” shared_ptr if there is no internal simulation, otherwise it return the Model hoding the simulation

int getType() const

get the type of the Actuator (ie class name)


an integer

virtual void initialize(const NonSmoothDynamicalSystem &nsds, const Simulation &s)

initialize actuator data.

  • nsds: the NonSmoothDynamicalSystem

  • s: the simulation

void setB(SP::SimpleMatrix B)

Set the B matrix.

  • B: the new B matrix

void setg(const std::string &g)

Set the name of the plugin for computing g.

  • g: the name of the plugin to compute g

void setId(const std::string &newId)

set id of the Actuator

  • newId: the new id.

void setSizeu(unsigned size)

Set the control size.

  • size: dimension of the control input u

virtual void setTimeDiscretisation(const TimeDiscretisation &td)

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

  • td: the TimeDiscretisation for this Actuator

const SiconosVector &u() const

Get the control value.


current control value u

Protected Functions


default constructor

Protected Attributes

SP::SimpleMatrix _B

B Matrix.

std::string _id

id of the Actuator

std::string _plugingName

name of the plugin for g (nonlinear affine in control system)

std::string _pluginJacgxName

name of the plugin to compute \(\nabla_x g\) for the nonlinear case

SP::ControlSensor _sensor

ControlSensor feeding the Controller.

unsigned int _type

type of the Actuator

SP::SiconosVector _u

Control variable.

Private Functions


serialization hooks