Drake
Drake C++ Documentation
Parameters< T > Class Template Reference

Detailed Description

template<typename T>
class drake::systems::Parameters< T >

Parameters is a container for variables that parameterize a System so that it can represent a family of related models.

Parameters are members of the Context. Parameters are not Inputs because they do not flow from upstream Systems, and they are not State because the System does not define update functions for them. If Parameters are modified, they are modified by application-specific logic, extrinsic to the System framework and to the flow of simulation time.

The Parameters include both vector-valued and abstract-valued elements.

Template Parameters
TThe scalar type, which must be one of the default scalars.

#include <drake/systems/framework/parameters.h>

Public Member Functions

 Parameters ()
 Constructs an empty Parameters. More...
 
 Parameters (std::vector< std::unique_ptr< BasicVector< T >>> &&numeric, std::vector< std::unique_ptr< AbstractValue >> &&abstract)
 Constructs Parameters both numeric and abstract. More...
 
 Parameters (std::vector< std::unique_ptr< BasicVector< T >>> &&numeric)
 Constructs Parameters that are purely numeric. More...
 
 Parameters (std::vector< std::unique_ptr< AbstractValue >> &&abstract)
 Constructs Parameters that are purely abstract. More...
 
 Parameters (std::unique_ptr< BasicVector< T >> vec)
 Constructs Parameters in the common case where the parameters consist of exactly one numeric vector. More...
 
 Parameters (std::unique_ptr< AbstractValue > value)
 Constructs Parameters in the common case where the parameters consist of exactly one abstract value. More...
 
virtual ~Parameters ()
 
int num_numeric_parameter_groups () const
 
int num_abstract_parameters () const
 
const BasicVector< T > & get_numeric_parameter (int index) const
 Returns the vector-valued parameter at index. More...
 
BasicVector< T > & get_mutable_numeric_parameter (int index)
 Returns the vector-valued parameter at index. More...
 
const DiscreteValues< T > & get_numeric_parameters () const
 
void set_numeric_parameters (std::unique_ptr< DiscreteValues< T >> numeric_params)
 
const AbstractValueget_abstract_parameter (int index) const
 Returns the abstract-valued parameter at index. More...
 
AbstractValueget_mutable_abstract_parameter (int index)
 Returns the abstract-valued parameter at index. More...
 
template<typename V >
const V & get_abstract_parameter (int index) const
 Returns the abstract-valued parameter at index. More...
 
template<typename V >
V & get_mutable_abstract_parameter (int index)
 Returns the abstract-valued parameter at index. More...
 
const AbstractValuesget_abstract_parameters () const
 
void set_abstract_parameters (std::unique_ptr< AbstractValues > abstract_params)
 
std::unique_ptr< Parameters< T > > Clone () const
 Returns a deep copy of the Parameters. More...
 
template<typename U >
void SetFrom (const Parameters< U > &other)
 Initializes this object from other. More...
 
Does not allow copy, move, or assignment
 Parameters (const Parameters &)=delete
 
Parametersoperator= (const Parameters &)=delete
 
 Parameters (Parameters &&)=delete
 
Parametersoperator= (Parameters &&)=delete
 
System compatibility
internal::SystemId get_system_id () const
 (Internal use only) Gets the id of the subsystem that created this object. More...
 
void set_system_id (internal::SystemId id)
 (Internal use only) Records the id of the subsystem that created this object. More...
 

Constructor & Destructor Documentation

◆ Parameters() [1/8]

Parameters ( const Parameters< T > &  )
delete

◆ Parameters() [2/8]

Parameters ( Parameters< T > &&  )
delete

◆ Parameters() [3/8]

Constructs an empty Parameters.

◆ Parameters() [4/8]

Parameters ( std::vector< std::unique_ptr< BasicVector< T >>> &&  numeric,
std::vector< std::unique_ptr< AbstractValue >> &&  abstract 
)

Constructs Parameters both numeric and abstract.

◆ Parameters() [5/8]

Parameters ( std::vector< std::unique_ptr< BasicVector< T >>> &&  numeric)
explicit

Constructs Parameters that are purely numeric.

◆ Parameters() [6/8]

Parameters ( std::vector< std::unique_ptr< AbstractValue >> &&  abstract)
explicit

Constructs Parameters that are purely abstract.

◆ Parameters() [7/8]

Parameters ( std::unique_ptr< BasicVector< T >>  vec)
explicit

Constructs Parameters in the common case where the parameters consist of exactly one numeric vector.

◆ Parameters() [8/8]

Parameters ( std::unique_ptr< AbstractValue value)
explicit

Constructs Parameters in the common case where the parameters consist of exactly one abstract value.

◆ ~Parameters()

virtual ~Parameters ( )
virtual

Member Function Documentation

◆ Clone()

std::unique_ptr<Parameters<T> > Clone ( ) const

Returns a deep copy of the Parameters.

◆ get_abstract_parameter() [1/2]

const AbstractValue& get_abstract_parameter ( int  index) const

Returns the abstract-valued parameter at index.

Asserts if the index is out of bounds.

◆ get_abstract_parameter() [2/2]

const V& get_abstract_parameter ( int  index) const

Returns the abstract-valued parameter at index.

Asserts if the index is out of bounds, and throws if the parameter is not of type V.

◆ get_abstract_parameters()

const AbstractValues& get_abstract_parameters ( ) const

◆ get_mutable_abstract_parameter() [1/2]

AbstractValue& get_mutable_abstract_parameter ( int  index)

Returns the abstract-valued parameter at index.

Asserts if the index is out of bounds.

◆ get_mutable_abstract_parameter() [2/2]

V& get_mutable_abstract_parameter ( int  index)

Returns the abstract-valued parameter at index.

Asserts if the index is out of bounds, and throws if the parameter is not of type V.

◆ get_mutable_numeric_parameter()

BasicVector<T>& get_mutable_numeric_parameter ( int  index)

Returns the vector-valued parameter at index.

Asserts if the index is out of bounds.

◆ get_numeric_parameter()

const BasicVector<T>& get_numeric_parameter ( int  index) const

Returns the vector-valued parameter at index.

Asserts if the index is out of bounds.

◆ get_numeric_parameters()

const DiscreteValues<T>& get_numeric_parameters ( ) const

◆ get_system_id()

internal::SystemId get_system_id ( ) const

(Internal use only) Gets the id of the subsystem that created this object.

◆ num_abstract_parameters()

int num_abstract_parameters ( ) const

◆ num_numeric_parameter_groups()

int num_numeric_parameter_groups ( ) const

◆ operator=() [1/2]

Parameters& operator= ( Parameters< T > &&  )
delete

◆ operator=() [2/2]

Parameters& operator= ( const Parameters< T > &  )
delete

◆ set_abstract_parameters()

void set_abstract_parameters ( std::unique_ptr< AbstractValues abstract_params)

◆ set_numeric_parameters()

void set_numeric_parameters ( std::unique_ptr< DiscreteValues< T >>  numeric_params)

◆ set_system_id()

void set_system_id ( internal::SystemId  id)

(Internal use only) Records the id of the subsystem that created this object.

◆ SetFrom()

void SetFrom ( const Parameters< U > &  other)

Initializes this object from other.


The documentation for this class was generated from the following file: