- 3.0.2 core module.
DiscreteSystem.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 namespace ct {
9 namespace core {
10 
11 template <size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR>
13 {
14 public:
15  typedef int time_t;
16  typedef StateVector<STATE_DIM, SCALAR> state_vector_t; //<! state vector type
17  typedef ControlVector<CONTROL_DIM, SCALAR> control_vector_t; //<! control vector type
18 
20  DiscreteSystem(const SYSTEM_TYPE& type = GENERAL) : type_(type) {}
22  virtual ~DiscreteSystem() {}
24  virtual DiscreteSystem* clone() const { throw std::runtime_error("DiscreteSystem: clone() not implemented"); };
26 
32  virtual void propagateDynamics(const StateVector<STATE_DIM, SCALAR>& state,
33  const time_t n,
34  StateVector<STATE_DIM, SCALAR>& stateNext) = 0;
35 
37 
40  SYSTEM_TYPE getType() const { return type_; }
41 protected:
43 };
44 } // namespace core
45 } // namespace ct
ControlVector< CONTROL_DIM, SCALAR > control_vector_t
Definition: DiscreteSystem.h:17
StateVector< STATE_DIM, SCALAR > state_vector_t
Definition: DiscreteSystem.h:16
virtual void propagateDynamics(const StateVector< STATE_DIM, SCALAR > &state, const time_t n, StateVector< STATE_DIM, SCALAR > &stateNext)=0
propagates the system dynamics forward by one step
Definition: ControlVector.h:12
virtual DiscreteSystem * clone() const
deep copy
Definition: DiscreteSystem.h:24
constexpr size_t n
Definition: MatrixInversionTest.cpp:14
Definition: StateVector.h:12
virtual ~DiscreteSystem()
desctructor
Definition: DiscreteSystem.h:22
SYSTEM_TYPE type_
type of system
Definition: DiscreteSystem.h:42
SYSTEM_TYPE
type of system
Definition: System.h:15
SYSTEM_TYPE getType() const
get the type of system
Definition: DiscreteSystem.h:40
DiscreteSystem(const SYSTEM_TYPE &type=GENERAL)
constructor
Definition: DiscreteSystem.h:20
any non-specific system
Definition: System.h:17
Definition: DiscreteSystem.h:12
int time_t
the type of the time variable
Definition: DiscreteSystem.h:15