colored_noise.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
34 
35 
36 
38 
39 
40 
41 
43 {
44  dynamicSystem = 0;
45 }
46 
47 
49  ) : Noise( )
50 {
51  dynamicSystem = new DynamicSystem( _dynamicSystem );
52 }
53 
54 
56 {
57  if( rhs.dynamicSystem != 0 )
59  else
60  dynamicSystem = 0;
61 }
62 
63 
65 {
66  if( dynamicSystem != 0 )
67  delete dynamicSystem;
68 }
69 
70 
72 {
73  if( this != &rhs )
74  {
75  if( dynamicSystem != 0 )
76  delete dynamicSystem;
77 
78  Noise::operator=( rhs );
79 
80  if( rhs.dynamicSystem != 0 )
82  else
83  dynamicSystem = 0;
84  }
85 
86  return *this;
87 }
88 
89 
91 {
92  return ( new ColoredNoise( *this ) );
93 }
94 
95 
97  ) const
98 {
99  if ( idx >= getDim( ) )
100  return 0;
101 
102  return ( new ColoredNoise( *this ) );
103 }
104 
105 
107  )
108 {
109  if( dynamicSystem != 0 )
110  *dynamicSystem = _dynamicSystem;
111  else
112  dynamicSystem = new DynamicSystem( _dynamicSystem );
113 
114  return SUCCESSFUL_RETURN;
115 }
116 
117 
118 
120  )
121 {
122  w.setZero( );
123 
124  setStatus( BS_READY );
125  return SUCCESSFUL_RETURN;
126 }
127 
128 
130  )
131 {
133 }
134 
135 
136 
138  )
139 {
141 }
142 
143 
145 
146 // end of file.
returnValue setDynamicSystem(const DynamicSystem &_dynamicSystem)
Stores a DifferentialEquation together with an OutputFcn.
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
Base class for generating pseudo-random noise for simulating the Process.
Definition: noise.hpp:56
VariablesGrid w
Definition: noise.hpp:194
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
returnValue setStatus(BlockStatus _status)
#define CLOSE_NAMESPACE_ACADO
virtual ~ColoredNoise()
virtual returnValue init(uint seed=0)
Generates pseudo-random colored noise for simulating the Process.
void rhs(const real_t *x, real_t *f)
Noise & operator=(const Noise &rhs)
Definition: noise.cpp:56
DynamicSystem * dynamicSystem
#define BEGIN_NAMESPACE_ACADO
virtual returnValue step(DVector &_w)
uint getDim() const
virtual ColoredNoise * clone() const
#define ACADOERROR(retval)
ColoredNoise & operator=(const ColoredNoise &rhs)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:30