Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
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.
 Parameters (std::vector< std::unique_ptr< BasicVector< T > > > &&numeric, std::vector< std::unique_ptr< AbstractValue > > &&abstract)
 Constructs Parameters both numeric and abstract.
 Parameters (std::vector< std::unique_ptr< BasicVector< T > > > &&numeric)
 Constructs Parameters that are purely numeric.
 Parameters (std::vector< std::unique_ptr< AbstractValue > > &&abstract)
 Constructs Parameters that are purely abstract.
 Parameters (std::unique_ptr< BasicVector< T > > vec)
 Constructs Parameters in the common case where the parameters consist of exactly one numeric vector.
 Parameters (std::unique_ptr< AbstractValue > value)
 Constructs Parameters in the common case where the parameters consist of exactly one abstract value.
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.
BasicVector< T > & get_mutable_numeric_parameter (int index)
 Returns the vector-valued parameter at index.
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.
AbstractValueget_mutable_abstract_parameter (int index)
 Returns the abstract-valued parameter at index.
template<typename V>
const V & get_abstract_parameter (int index) const
 Returns the abstract-valued parameter at index.
template<typename V>
V & get_mutable_abstract_parameter (int index)
 Returns the abstract-valued parameter at index.
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.
template<typename U>
void SetFrom (const Parameters< U > &other)
 Initializes this object from other.
Does not allow copy, move, or assignment
 Parameters (const Parameters &)=delete
Parametersoperator= (const Parameters &)=delete
 Parameters (Parameters &&)=delete
Parametersoperator= (Parameters &&)=delete

System compatibility

See System Compatibility.

internal::SystemId get_system_id () const
 (Internal use only) Gets the id of the subsystem that created this object.
void set_system_id (internal::SystemId id)
 (Internal use only) Records the id of the subsystem that created this object.

Constructor & Destructor Documentation

◆ Parameters() [1/8]

template<typename T>
Parameters ( const Parameters< T > & )
delete

◆ Parameters() [2/8]

template<typename T>
Parameters ( Parameters< T > && )
delete

◆ Parameters() [3/8]

template<typename T>
Parameters ( )

Constructs an empty Parameters.

◆ Parameters() [4/8]

template<typename T>
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]

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

Constructs Parameters that are purely numeric.

◆ Parameters() [6/8]

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

Constructs Parameters that are purely abstract.

◆ Parameters() [7/8]

template<typename T>
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]

template<typename T>
Parameters ( std::unique_ptr< AbstractValue > value)
explicit

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

◆ ~Parameters()

template<typename T>
virtual ~Parameters ( )
virtual

Member Function Documentation

◆ Clone()

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

Returns a deep copy of the Parameters.

◆ get_abstract_parameter() [1/2]

template<typename T>
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]

template<typename T>
template<typename V>
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()

template<typename T>
const AbstractValues & get_abstract_parameters ( ) const

◆ get_mutable_abstract_parameter() [1/2]

template<typename T>
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]

template<typename T>
template<typename V>
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()

template<typename T>
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()

template<typename T>
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()

template<typename T>
const DiscreteValues< T > & get_numeric_parameters ( ) const

◆ get_system_id()

template<typename T>
internal::SystemId get_system_id ( ) const

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

◆ num_abstract_parameters()

template<typename T>
int num_abstract_parameters ( ) const

◆ num_numeric_parameter_groups()

template<typename T>
int num_numeric_parameter_groups ( ) const

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ set_abstract_parameters()

template<typename T>
void set_abstract_parameters ( std::unique_ptr< AbstractValues > abstract_params)

◆ set_numeric_parameters()

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

◆ set_system_id()

template<typename T>
void set_system_id ( internal::SystemId id)

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

◆ SetFrom()

template<typename T>
template<typename U>
void SetFrom ( const Parameters< U > & other)

Initializes this object from other.


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