Class Actuator

Defined in Program listing for file control/src/Controller/Actuator.hpp

class Actuator

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.

Parameters

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

General Constructor with dynamics affine in control.

Parameters

virtual ~Actuator()

destructor

virtual void actuate() = 0

capture data when the ActuatorEvent is processed

void addSensorPtr(SP::ControlSensor newSensor)

add a Sensor in the actuator.

Parameters

virtual void display() const

display the data of the Actuator on the standard output

const std::string getId() const

get id of the Actuator

Return
a std::string

virtual SP::NonSmoothDynamicalSystem getInternalNSDS() const

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

Return
”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)

Return
an integer

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

initialize actuator data.

Parameters
  • nsds: the NonSmoothDynamicalSystem
  • s: the simulation

void setB(SP::SimpleMatrix B)

Set the B matrix.

Parameters
  • B: the new B matrix

void setg(const std::string &g)

Set the name of the plugin for computing g.

Parameters
  • g: the name of the plugin to compute g

void setId(const std::string &newId)

set id of the Actuator

Parameters
  • newId: the new id.

void setSizeu(unsigned size)

Set the control size.

Parameters
  • 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.

Parameters
  • td: the TimeDiscretisation for this Actuator

const SiconosVector &u() const

Get the control value.

Return
current control value u