Drake
system3.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <functional>
4 #include <string>
5 
7 #include "drake/drakeSystemFramework_export.h"
12 
13 namespace drake {
14 namespace systems {
15 
16 class AbstractContext3;
17 template <typename T>
18 class Context3;
19 
20 // TODO(sherm1) These should probably be local classes so API users don't
21 // have to look at them.
22 
31  : subsystem_num(subsystem_num), port_num(port_num), port(port) {}
32  int subsystem_num{-1};
33  int port_num{-1};
35 };
36 
40  : subsystem_num(subsystem_num), port_num(port_num), port(port) {}
41  int subsystem_num{-1};
42  int port_num{-1};
44 };
45 
69  public:
70  virtual ~AbstractSystem3() {}
71 
75  // TODO(sherm1) Consider requiring this to be unique among sibling subsystems
76  // so that we can construct a unique pathname to any subsystem.
77  std::string get_name() const {return name_;}
78 
79  //----------------------------------------------------------------------------
88  int AddInputPort(std::unique_ptr<InputPort3> port) {
89  const int my_port_num = (int)input_ports_.size();
90  port->set_owner(this, my_port_num);
91  input_ports_.emplace_back(-1, my_port_num, port.get());
92  owned_input_ports_.push_back(std::move(port));
93  return my_port_num;
94  }
95 
99  int AddOutputPort(std::unique_ptr<OutputPort3> port) {
100  const int my_port_num = (int)output_ports_.size();
101  port->set_owner(this, my_port_num);
102  output_ports_.emplace_back(-1, my_port_num, port.get());
103  owned_output_ports_.push_back(std::move(port));
104  return my_port_num;
105  }
106 
109  int get_num_input_ports() const { return (int)input_ports_.size(); }
110 
113  const InputPort3& get_input_port(int port_num) const {
114  return *get_input_port_finder(port_num).port;
115  }
116 
120  return get_input_port_finder(port_num).port;
121  }
122 
126  int get_num_output_ports() const { return (int)output_ports_.size(); }
127 
131  return *get_output_port_finder(port_num).port;
132  }
133 
137  return get_output_port_finder(port_num).port;
138  }
146  DRAKESYSTEMFRAMEWORK_EXPORT std::unique_ptr<AbstractContext3>
147  CreateDefaultContext() const;
148 
158  DRAKESYSTEMFRAMEWORK_EXPORT const AbstractValue& EvalOutputPort(
159  const AbstractContext3& context, int port_num) const;
160 
161  //----------------------------------------------------------------------------
172  //----------------------------------------------------------------------------
182  template <class ConcreteSystem>
183  ConcreteSystem* AddSubsystem(std::unique_ptr<ConcreteSystem> subsystem) {
184  ConcreteSystem* concrete = subsystem.get();
185  subsystem->set_owner(this, get_num_subsystems());
186  subsystems_.push_back(std::move(subsystem));
187  return concrete;
188  }
189 
194  int InheritInputPort(AbstractSystem3* child_subsystem, int input_port_num) {
195  DRAKE_ABORT_UNLESS(child_subsystem->get_parent_system() == this);
196  InputPort3* sub_port =
197  child_subsystem->get_mutable_input_port(input_port_num);
198  const int my_port_num = (int)input_ports_.size();
199  input_ports_.emplace_back(child_subsystem->get_subsystem_num(),
200  input_port_num, sub_port);
201  return my_port_num;
202  }
203 
208  int InheritOutputPort(AbstractSystem3* child_subsystem, int output_port_num) {
209  DRAKE_ABORT_UNLESS(child_subsystem->get_parent_system() == this);
210  OutputPort3* sub_port =
211  child_subsystem->get_mutable_output_port(output_port_num);
212  const int my_port_num = (int)output_ports_.size();
213  output_ports_.emplace_back(child_subsystem->get_subsystem_num(),
214  output_port_num, sub_port);
215  return my_port_num;
216  }
217 
224  void Connect(AbstractSystem3* source_subsystem, int output_port_num,
225  AbstractSystem3* sink_subsystem, int input_port_num) {
226  DRAKE_ABORT_UNLESS(source_subsystem->get_parent_system() == this &&
227  sink_subsystem->get_parent_system() == this);
228  const OutputPort3& out = source_subsystem->get_output_port(output_port_num);
229  InputPort3* in = sink_subsystem->get_mutable_input_port(input_port_num);
230  in->ConnectTo(&out);
231  }
232 
236  int get_num_subsystems() const { return (int)subsystems_.size(); }
237 
240  const AbstractSystem3& get_subsystem(int index) const {
241  const AbstractSystem3* subsystem = subsystems_[index].get();
242  DRAKE_ASSERT(subsystem && subsystem->get_parent_system() == this &&
243  subsystem->get_subsystem_num() == index);
244  return *subsystem;
245  }
246 
250  return const_cast<AbstractSystem3*>(&get_subsystem(index));
251  }
252 
255  const AbstractSystem3* get_parent_system() const { return owner_; }
256 
260 
263  int get_subsystem_num() const { return subsystem_num_; }
264 
268  std::string GetSubsystemPathName() const {
269  std::string path_name;
270  if (get_parent_system())
271  path_name = get_parent_system()->GetSubsystemPathName();
272  path_name += ("/" + get_name());
273  return path_name;
274  }
275 
279  const AbstractContext3& some_subcontext) const {
280  // TODO(sherm1) This should use a prebuilt index rather than searching.
281  std::vector<int> path = get_path_from_root_system();
282  const AbstractContext3& my_subcontext =
283  some_subcontext.get_root_context().find_subcontext(path);
284  return my_subcontext;
285  }
286 
292  AbstractContext3* some_subcontext) const {
293  return const_cast<AbstractContext3*>(&find_my_subcontext(*some_subcontext));
294  }
295 
300  if (!get_parent_system()) return *this;
301  return get_parent_system()->get_root_system();
302  }
303 
308  return const_cast<AbstractSystem3*>(&get_root_system());
309  }
310 
313  const InputPortFinder& get_input_port_finder(int port_num) const {
314  DRAKE_ASSERT(0 <= port_num && port_num < (int)input_ports_.size());
315  return input_ports_[port_num];
316  }
317 
318  const OutputPortFinder& get_output_port_finder(int port_num) const {
319  DRAKE_ASSERT(0 <= port_num && port_num < (int)output_ports_.size());
320  return output_ports_[port_num];
321  }
322 
328  using namespace std::placeholders; // for _1, _2, _3...
329  return std::bind(&AbstractSystem3::CalcOutputPort, _1, _2, port_num, _3);
330  }
331 
334  void CalcOutputPort(const AbstractContext3& context, int port_num,
335  AbstractValue* result) const {
336  const int n = get_num_output_ports();
337  if (!(0 <= port_num && port_num < n))
338  throw std::out_of_range("AbstractSystem3::CalcOutputPort(): port " +
339  std::to_string(port_num) +
340  " is out of range. There are " +
341  std::to_string(n) + " output ports.");
342  DoCalcOutputPort(context, port_num, result);
343  }
344 
345  protected:
346  explicit AbstractSystem3(const std::string& name) : name_(name) {}
347 
356  DRAKESYSTEMFRAMEWORK_EXPORT const AbstractValue& EvalInputPort(
357  const AbstractContext3& context, int port_num) const;
358 
361  virtual std::unique_ptr<AbstractContext3> DoCreateEmptyContext() const = 0;
362 
367  virtual void DoAcquireContextResources(AbstractContext3* context) const {}
368 
373  virtual void DoCalcOutputPort(const AbstractContext3& context, int port_num,
374  AbstractValue* value) const = 0;
375 
376  private:
377  friend class AbstractContext3;
378 
379  // Create a Context that has no content but whose tree structure matches
380  // that of this system diagram, with the right kind of Context in each node
381  // as provided by DoCreateEmptyContext().
382  DRAKESYSTEMFRAMEWORK_EXPORT std::unique_ptr<AbstractContext3>
383  CreateEmptyContext() const;
384 
385  // Given an empty Context with appropriate tree structure, allocate and
386  // connect input and output ports in the context to match the wiring of this
387  // system diagram.
388  DRAKESYSTEMFRAMEWORK_EXPORT void AllocateOutputPorts(
389  AbstractContext3* context) const;
390 
391  // Given an empty Context with appropriate tree structure, allocate and
392  // connect input and output ports in the context to match the wiring of this
393  // system diagram.
394  DRAKESYSTEMFRAMEWORK_EXPORT void AllocateAndConnectInputPorts(
395  AbstractContext3* context) const;
396 
402  const AbstractSystem3& find_subsystem(const std::vector<int>& path,
403  int start = 0) const {
404  if (start == (int)path.size()) return *this;
405  return get_subsystem(path[start]).find_subsystem(path, start + 1);
406  }
407 
410  AbstractSystem3* find_mutable_subsystem(const std::vector<int>& path) {
411  return const_cast<AbstractSystem3*>(&find_subsystem(path));
412  }
413 
421  std::vector<int> get_path_from_root_system() const {
422  std::vector<int> path;
423  if (get_parent_system()) {
424  path = get_parent_system()->get_path_from_root_system();
425  DRAKE_ASSERT(get_subsystem_num() >= 0);
426  path.push_back(get_subsystem_num());
427  }
428  return path;
429  }
430 
431  // AbstractSystem3 objects are neither copyable nor moveable.
432  AbstractSystem3(const AbstractSystem3& other) = delete;
433  AbstractSystem3& operator=(const AbstractSystem3& other) = delete;
434  AbstractSystem3(AbstractSystem3&& other) = delete;
435  AbstractSystem3& operator=(AbstractSystem3&& other) = delete;
436 
437  // Set backpointer to parent system and subsystem number by which we are
438  // known there.
439  void set_owner(AbstractSystem3* parent, int subsystem_num) {
440  owner_ = parent;
441  subsystem_num_ = subsystem_num;
442  }
443 
444  std::string name_;
445 
446  // These are the actual ports indexed by port number. For leaf systems these
447  // simply point to the corresponding entries in the "owned" lists. For
448  // system diagrams they may point to inherited ports owned by an interior
449  // subsystem, and the port numbers will be different than the indices of
450  // the owned ports. If you need to know the difference, ask the port for
451  // the System that owns it.
452  std::vector<InputPortFinder> input_ports_;
453  std::vector<OutputPortFinder> output_ports_;
454 
455  // These ports are owned by this system object.
456  std::vector<std::unique_ptr<InputPort3>> owned_input_ports_;
457  std::vector<std::unique_ptr<OutputPort3>> owned_output_ports_;
458 
459  // These are the immediate children owned by this system, indexed by
460  // "subsystem number", in order of AddSubsystem calls.
461  std::vector<std::unique_ptr<AbstractSystem3>> subsystems_;
462 
463  // If this system is a subsystem in a system diagram, this is set to the
464  // owning parent system, with the subsystem number as known to the parent.
465  AbstractSystem3* owner_{};
466  int subsystem_num_{-1};
467 };
468 
480 template <typename T>
481 class System3 : public AbstractSystem3 {
482  // TODO(david-german-tri): Add static_asserts on T.
483  public:
484  //----------------------------------------------------------------------------
492  std::unique_ptr<Context3<T>> CreateDefaultContext() const {
493  auto abstract_context = AbstractSystem3::CreateDefaultContext();
494  std::unique_ptr<Context3<T>> context(
495  dynamic_cast<Context3<T>*>(abstract_context.release()));
496  DRAKE_ABORT_UNLESS(context != nullptr);
497  return context;
498  }
499 
505  int port_num) const {
506  const VectorInterface<T>& vector =
507  to_vector_interface<T>(EvalOutputPort(context, port_num));
508  return vector;
509  }
512  //----------------------------------------------------------------------------
528  const T& EvalPotentialEnergy(const Context3<T>& context) const {
529  // TODO(sherm1) Validate the context at least in Debug.
530  return DoEvalPotentialEnergy(context);
531  }
532 
535  const T& EvalKineticEnergy(const Context3<T>& context) const {
536  // TODO(sherm1) Validate the context at least in Debug.
537  return DoEvalKineticEnergy(context);
538  }
541  //----------------------------------------------------------------------------
544  enum DerivativeBlock { kQdot = 0, kVdot = 1, kZdot = 2, kQdotDot = 3 };
545 
554  Eigen::VectorBlock<const VectorX<T>> EvalTimeDerivatives(
555  const Context3<T>& context, DerivativeBlock block) const;
556 
565  const T& EvalConservativePower(const Context3<T>& context) const {
566  return DoEvalConservativePower(context);
567  }
568 
577  const T& EvalNonConservativePower(const Context3<T>& context) const {
578  return DoEvalNonConservativePower(context);
579  }
580 
600  const Context3<T>& context,
601  const Eigen::Ref<const VectorX<T>>& generalized_velocity,
602  Eigen::Ref<VectorX<T>>* configuration_derivatives) const {
603  // TODO(sherm1) Validate arguments.
604  DoMapVelocityToConfigurationDerivatives(context, generalized_velocity,
605  configuration_derivatives);
606  }
607 
629  const Context3<T>& context,
630  const Eigen::Ref<const VectorX<T>>& generalized_acceleration,
631  Eigen::Ref<VectorX<T>>* configuration_second_derivatives) const {
632  // TODO(sherm1) Validate arguments.
633  DoMapAccelerationToConfigurationSecondDerivatives(
634  context, generalized_acceleration, configuration_second_derivatives);
635  }
638  //----------------------------------------------------------------------------
642  // TODO(sherm1) Only a subset needs to be updated at any given sampling
643  // time. Probably makes more sense to pass a writable Context so the
644  // %System can perform the limited update.
645  void UpdateDiscreteVariables(Context3<T>& context, int sample_key) const;
646 
651  // TODO(sherm1) This is half-baked and need to be thought through better.
652  // Sampling doesn't just apply to discrete variables; many internal
653  // computations need sampling too.
654  std::pair<double,int> GetNextSampleTime(const Context3<T>& context) const;
658  protected:
660  explicit System3(const std::string& name) : AbstractSystem3(name) {}
661 
669  int port_num) const {
670  const VectorInterface<T>& vector =
671  to_vector_interface<T>(EvalInputPort(context, port_num));
672  return vector;
673  }
674 
680  virtual const T& DoEvalPotentialEnergy(const Context3<T>& context) const {
681  static const T zero(0);
682  return zero;
683  }
684 
690  virtual const T& DoEvalKineticEnergy(const Context3<T>& context) const {
691  static const T zero(0);
692  return zero;
693  }
694 
711  void DoMapVelocityToConfigurationDerivatives(
712  const Context3<T>& context,
713  const Eigen::Ref<const VectorX<T>>& generalized_velocity,
714  Eigen::Ref<VectorX<T>>* configuration_derivatives) const;
715 
717  void DoMapAccelerationToConfigurationSecondDerivatives(
718  const Context3<T>& context,
719  const Eigen::Ref<const VectorX<T>>& generalized_acceleration,
720  Eigen::Ref<VectorX<T>>* configuration_second_derivatives) const;
721 
722  // These two power methods should be present only for continuous
723  // systems that represent some kind of physical system that can inject or
724  // dissipate energy into the simulation.
725 
734  virtual const T& DoEvalConservativePower(const Context3<T>& context) const {
735  static const T zero(0);
736  return zero;
737  }
738 
747  virtual const T& DoEvalNonConservativePower(const Context3<T>& context) const {
748  static const T zero(0);
749  return zero;
750  }
751 
752  private:
753  // System3 objects are neither copyable nor moveable.
754  System3(const System3<T>& other) = delete;
755  System3& operator=(const System3<T>& other) = delete;
756  System3(System3<T>&& other) = delete;
757  System3& operator=(System3<T>&& other) = delete;
758 };
759 
760 } // namespace systems
761 } // namespace drake
DRAKESYSTEMFRAMEWORK_EXPORT std::unique_ptr< AbstractContext3 > CreateDefaultContext() const
Returns a default context, initialized with run time mutable memory for the correct number and type o...
Definition: system3.cc:11
const AbstractSystem3 & get_root_system() const
Find the root system of the tree of which this subsystem is a member.
Definition: system3.h:299
VectorInterface is a pure abstract interface that real-valued signals between Systems must satisfy...
Definition: vector_interface.h:25
AbstractSystem3 * get_mutable_parent_system()
Returns a mutable pointer to the parent system that owns this one, or nullptr if this is a root syste...
Definition: system3.h:259
An OutputPort3 represents a data output from a System.
Definition: system3_output.h:35
int get_num_input_ports() const
Returns the current number of input ports in this system.
Definition: system3.h:109
An abstract superclass for the Context3 objects for dynamical systems, encapsulating functionality th...
Definition: context3.h:87
A superclass template for systems that use a specified scalar type T for numerical values...
Definition: system3.h:481
int port_num
Port number as understood by the subsystem.
Definition: system3.h:33
const AbstractContext3 & get_root_context() const
Find the root context of the tree of which this subcontext is a member.
Definition: context3.h:215
void Connect(AbstractSystem3 *source_subsystem, int output_port_num, AbstractSystem3 *sink_subsystem, int input_port_num)
Connect the given output port of subsystem 1 into the given input port of subsystem 2...
Definition: system3.h:224
int get_num_output_ports() const
Returns the current number of output ports in this system.
Definition: system3.h:126
Definition: constants.h:3
AbstractSystem3 * get_mutable_root_system()
Get a mutable pointer to the root system of the tree of which this subsystem is a member...
Definition: system3.h:307
An InputPort3 represents an external data input to a System.
Definition: system3_input.h:40
OutputPort3 * get_mutable_output_port(int port_num)
Returns a mutable pointer to the OutputPort3 with the given port number.
Definition: system3.h:136
virtual const T & DoEvalConservativePower(const Context3< T > &context) const
Return the rate at which mechanical energy is being converted from potential energy to kinetic energy...
Definition: system3.h:734
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorX
A column vector of any size, templated on scalar type.
Definition: eigen_types.h:36
std::string get_name() const
Returns the name of this system.
Definition: system3.h:77
int InheritInputPort(AbstractSystem3 *child_subsystem, int input_port_num)
The given subsystem&#39;s InputPort3 becomes the next InputPort3 of this system diagram.
Definition: system3.h:194
System3(const std::string &name)
Creates a System3 with no ports.
Definition: system3.h:660
const T & EvalNonConservativePower(const Context3< T > &context) const
For continuous, physical systems only, returns the rate at which energy is being added to (positive) ...
Definition: system3.h:577
DerivativeBlock
Definition: system3.h:544
ConcreteSystem * AddSubsystem(std::unique_ptr< ConcreteSystem > subsystem)
Takes ownership of the given system and returns an unowned, raw pointer to the concrete type for conv...
Definition: system3.h:183
const AbstractSystem3 & get_subsystem(int index) const
Returns a const reference to one of the contained subsystems, using the index reflecting the order in...
Definition: system3.h:240
InputPort3 * get_mutable_input_port(int port_num)
Returns a mutable pointer to the InputPort3 with the given port number.
Definition: system3.h:119
A system diagram may inherit an input port from one of its contained subsystems, which will know that...
Definition: system3.h:29
CacheEntry::Calculator get_output_port_calculator(int port_num) const
Given an output port number, return a function that knows how to calculate the value of that port whe...
Definition: system3.h:327
InputPortFinder(int subsystem_num, int port_num, InputPort3 *port)
Definition: system3.h:30
#define DRAKE_ASSERT(condition)
DRAKE_ASSERT(condition) is similar to the built-in assert(condition) from the C++ system header <cas...
Definition: drake_assert.h:35
const T & EvalPotentialEnergy(const Context3< T > &context) const
Returns the potential energy currently stored in the configuration provided in the given Context3...
Definition: system3.h:528
const T & EvalConservativePower(const Context3< T > &context) const
For continuous, physical systems only, returns the rate at which energy is being converted from poten...
Definition: system3.h:565
Provides Drake&#39;s assertion implementation.
#define DRAKE_ABORT_UNLESS(condition)
Evaluates condition and iff the value is false will ::abort() the program with a message showing at l...
Definition: drake_assert.h:39
See InputPortFinder for information.
Definition: system3.h:38
int AddInputPort(std::unique_ptr< InputPort3 > port)
Add an input port that is to be owned by this system.
Definition: system3.h:88
std::string GetSubsystemPathName() const
Determine the full path name of this subsystem in a form like /rootname/parentname/myname.
Definition: system3.h:268
std::string to_string(const Eigen::MatrixBase< Derived > &a)
Definition: testUtil.h:29
const InputPortFinder & get_input_port_finder(int port_num) const
Definition: system3.h:313
int AddOutputPort(std::unique_ptr< OutputPort3 > port)
Add an output port that is to be owned by this System.
Definition: system3.h:99
void MapAccelerationToConfigurationSecondDerivatives(const Context3< T > &context, const Eigen::Ref< const VectorX< T >> &generalized_acceleration, Eigen::Ref< VectorX< T >> *configuration_second_derivatives) const
Transforms a given generalized acceleration vdot into qdotdot, the second time derivative of the gene...
Definition: system3.h:628
An abstract superclass for dynamical systems, encapsulating functionality that is independent of the ...
Definition: system3.h:68
AbstractContext3 * find_my_mutable_subcontext(AbstractContext3 *some_subcontext) const
Get mutable access to this subsystem&#39;s subcontext given mutable access to any other subsystem&#39;s subco...
Definition: system3.h:291
int InheritOutputPort(AbstractSystem3 *child_subsystem, int output_port_num)
The given subsystem&#39;s OutputPort3 becomes the next OutputPort3 of this system diagram.
Definition: system3.h:208
std::vector< Number > result
Definition: IpoptSolver.cpp:170
const InputPort3 & get_input_port(int port_num) const
Returns a const reference to the InputPort3 with the given port number.
Definition: system3.h:113
const OutputPort3 & get_output_port(int port_num) const
Returns a const reference to the OutputPort3 with the given port number.
Definition: system3.h:130
AbstractSystem3 * get_mutable_subsystem(int index)
Returns a mutable pointer to one of the contained subsystems, using the index reflecting the order in...
Definition: system3.h:249
A fully type-erased container class.
Definition: value.h:22
virtual const T & DoEvalNonConservativePower(const Context3< T > &context) const
Return the rate at which mechanical energy is being generated (positive) or dissipated (negative) oth...
Definition: system3.h:747
virtual const T & DoEvalKineticEnergy(const Context3< T > &context) const
If your system models energy of motion, implement this method to return the kinetic energy currently ...
Definition: system3.h:690
int get_subsystem_num() const
If this system is a subsystem of a parent system, return the subsystem number by which that parent kn...
Definition: system3.h:263
virtual void DoAcquireContextResources(AbstractContext3 *context) const
Acquire any private Context resources your concrete System needs, and assign them default values...
Definition: system3.h:367
const T & EvalKineticEnergy(const Context3< T > &context) const
Return the kinetic energy currently present in the motion provided in the given Context3.
Definition: system3.h:535
const AbstractSystem3 * get_parent_system() const
Returns a const pointer to the parent system that owns this one, or nullptr if this is a root system...
Definition: system3.h:255
std::function< void(const class AbstractSystem3 &, const class AbstractContext3 &, AbstractValue *)> Calculator
This is the type of a function that unconditionally computes this cache entry&#39;s value with respect to...
Definition: cache3.h:35
void MapVelocityToConfigurationDerivatives(const Context3< T > &context, const Eigen::Ref< const VectorX< T >> &generalized_velocity, Eigen::Ref< VectorX< T >> *configuration_derivatives) const
Transforms a given generalized velocity v into qdot, the time derivative of the generalized configura...
Definition: system3.h:599
const VectorInterface< T > & EvalVectorInputPort(const Context3< T > &context, int port_num) const
Convenience method for obtaining the up-to-date value for an input port which is known to be vector v...
Definition: system3.h:668
The context is a container for all data necessary to uniquely determine the results of computations p...
Definition: context3.h:371
void ConnectTo(const OutputPort3 *output_port)
Connect this InputPort3 to a compatible OutputPort3.
Definition: system3_input.h:56
void CalcOutputPort(const AbstractContext3 &context, int port_num, AbstractValue *result) const
Unconditionally calculate what would be the output port value into an already-allocated appropriate r...
Definition: system3.h:334
virtual const T & DoEvalPotentialEnergy(const Context3< T > &context) const
If your system is capable of storing energy, implement this method to return the potential energy cur...
Definition: system3.h:680
const AbstractContext3 & find_my_subcontext(const AbstractContext3 &some_subcontext) const
Get const access to this subsystem&#39;s subcontext given const access to any other subsystem&#39;s subcontex...
Definition: system3.h:278
int get_num_subsystems() const
Returns the current number of subsystems contained in this system diagram.
Definition: system3.h:236
const VectorInterface< T > & EvalVectorOutputPort(const Context3< T > &context, int port_num) const
Convenience method for obtaining the up-to-date value for an output port which is known to be vector ...
Definition: system3.h:504
std::unique_ptr< Context3< T > > CreateDefaultContext() const
Get a default Context<T> compatible with this System<T>.
Definition: system3.h:492
virtual ~AbstractSystem3()
Definition: system3.h:70
AbstractSystem3(const std::string &name)
Definition: system3.h:346
OutputPortFinder(int subsystem_num, int port_num, OutputPort3 *port)
Definition: system3.h:39
const OutputPortFinder & get_output_port_finder(int port_num) const
Definition: system3.h:318
int subsystem_num
-1 means this system.
Definition: system3.h:32
InputPort3 * port
Convenience pointer to the actual port.
Definition: system3.h:34