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).
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:
// Get the registry ActuatorFactory::Registry& regActuator(ActuatorFactory::Registry::get()) ; // Build an Actuator of type "myType" with t as a TimeDiscretisation. regActuator.instantiate(myType, t);
The best way is to use the controlManager:
// cm a ControlManager cm->addActuator(myType,t); // or if cm has already been initialized: cm->addAndRecordActuator(myType,t)
Public Functions
-
Actuator(unsigned int type, SP::ControlSensor sensor)¶
General Constructor.
- Parameters
type – the type of the Actuator, which corresponds to the class type
sensor – the ControlSensor feeding the Actuator
-
Actuator(unsigned int type, SP::ControlSensor sensor, SP::SimpleMatrix 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
-
virtual ~Actuator()¶
destructor
-
inline unsigned int getType() const¶
get the type of the Actuator (ie class name)
- Returns
an integer
-
inline const SiconosVector &u() const¶
Get the control value.
- Returns
current control value u
-
void setSizeu(unsigned size)¶
Set the control size.
- Parameters
size – dimension of the control input u
-
inline 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
-
inline 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
-
virtual void initialize(const NonSmoothDynamicalSystem &nsds, const Simulation &s)¶
initialize actuator data.
- Parameters
nsds – the NonSmoothDynamicalSystem
s – the simulation
-
virtual void actuate() = 0¶
capture data when the ActuatorEvent is processed
-
Actuator(unsigned int type, SP::ControlSensor sensor)¶