The context is a container for all data necessary to uniquely determine the results of computations performed by a System.
More...
|
| Context3 () |
|
| ~Context3 () override |
|
const T & | get_time () const |
| Returns the current time in seconds. More...
|
|
void | set_time (const T &time_sec) |
| Set the current time in seconds. More...
|
|
std::unique_ptr< Context3< T > > | Clone () const |
| Returns writable access to the State. More...
|
|
| Context3 (const Context3 &source) |
| Copy constructor makes a deep copy of the source Context3, and also copies the current values of time and any connected input and parameter ports into standalone internal values so that the entire computation context is preserved. More...
|
|
virtual | ~AbstractContext3 () |
|
std::unique_ptr< AbstractContext3 > | Clone () const |
| Returns a deep copy of this Context3. More...
|
|
void | SetNumInputPorts (int num_ports) |
| Allocate input port entries corresponding to a System3's InputPort3 objects. More...
|
|
void | SetNumOutputPorts (int num_ports) |
| Allocate output port entries corresponding to a System3's OutputPort3 objects. More...
|
|
DRAKESYSTEMFRAMEWORK_EXPORT void | SetInputPort (const AbstractSystem3 &system, int port_num) |
| Set the input entry for this port number appropriately, given the corresponding InputPort3 in system . More...
|
|
DRAKESYSTEMFRAMEWORK_EXPORT void | SetOutputPort (const AbstractSystem3 &system, int port_num) |
| Set the output entry for this port number appropriately, given the corresponding OutputPort3 in system . More...
|
|
int | get_num_input_ports () const |
|
int | get_num_output_ports () const |
|
int | get_num_cache_entries () const |
|
const CacheEntry * | get_input_entry (int port_num) const |
| Return a const pointer to the cache entry that is providing the value for the given input port, if this port is connected. More...
|
|
CacheEntry * | get_mutable_input_entry (int port_num) const |
| Return a mutable pointer to the cache entry that is providing the value for the given input port, if this port is connected. More...
|
|
const CacheEntry & | get_output_entry (int port_num) const |
|
CacheEntry * | get_mutable_output_entry (int port_num) const |
|
int | AddSubcontext (std::unique_ptr< AbstractContext3 > subcontext) |
| Add a subcontext as a child of this context. More...
|
|
int | get_num_subcontexts () const |
| Returns the current number of subcontexts contained in this context. More...
|
|
const AbstractContext3 & | get_subcontext (int index) const |
| Returns a const reference to one of the contained subcontexts, using the index reflecting the order in which it was added. More...
|
|
AbstractContext3 * | get_mutable_subcontext (int index) |
| Returns a mutable pointer to one of the contained subcontexts, using the index reflecting the order in which it was added. More...
|
|
const AbstractContext3 * | get_parent_context () const |
| Returns a const pointer to the parent context that owns this one, or nullptr if this is a root context. More...
|
|
AbstractContext3 * | get_mutable_parent_context () |
| Returns a mutable pointer to the parent context that owns this one, or nullptr if this is a root context. More...
|
|
int | get_subcontext_num () const |
| If this context is a subcontext of a parent context, return the subcontext number by which that parent knows us. More...
|
|
const AbstractSystem3 & | find_my_subsystem (const AbstractSystem3 &some_subsystem) const |
| Get const access to this subcontext's subsystem given const access to any other subcontext's subsystem in the same system diagram. More...
|
|
AbstractSystem3 * | find_my_mutable_subsystem (AbstractSystem3 *some_subsystem) const |
| Get mutable access to this subcontext's subsystem given mutable access to any other subcontext's subsystem in the same system diagram. More...
|
|
const AbstractContext3 & | get_root_context () const |
| Find the root context of the tree of which this subcontext is a member. More...
|
|
AbstractContext3 * | get_mutable_root_context () |
| Get a mutable pointer to the root context of the tree of which this subcontext is a member. More...
|
|
template<typename T>
class drake::systems::Context3< T >
The context is a container for all data necessary to uniquely determine the results of computations performed by a System.
Specifically, a Context3 contains
- the current value of time
- pointers to values for a set of InputPorts (and ParameterPorts)
- values for the state variables
- cache entries for computed OutputPort values
- cache entries for time derivatives of continuous states
- a cache entry for update values of discrete states
A Context3 is compatible with a particular System3, but is otherwise independent of any actual System object. That is, if you had two identical System3 objects you could use the same Context3 object for both; there are no pointers from Context3 to non-static System3 data or methods.
- Template Parameters
-
T | The mathematical type of the context, which must be a valid Eigen scalar. |