Miind
AbstractOdeSystem.hpp
Go to the documentation of this file.
1 // Copyright (c) 2005 - 2014 Marc de Kamps
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 //
6 // * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 // * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
8 // and/or other materials provided with the distribution.
9 // * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software
10 // without specific prior written permission.
11 //
12 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
13 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
14 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
15 // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
16 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 //
18 // If you use this software in work leading to a scientific publication, you should include a reference there to
19 // the 'currently valid reference', which can be found at http://miind.sourceforge.net
20 #ifndef _CODE_LIBS_POPULISTLIB_ABSTRACTODESYSTEM_INCLUDE_GUARD
21 #define _CODE_LIBS_POPULISTLIB_ABSTRACTODESYSTEM_INCLUDE_GUARD
22 
23 #include <vector>
24 #include <boost/shared_ptr.hpp>
26 #include "OdeParameter.hpp"
27 
28 using std::vector;
29 
30 namespace GeomLib {
31 
33 
47 
49  public:
50 
53  (
55  );
56 
59 
61  virtual ~AbstractOdeSystem() = 0;
62 
66  virtual void
67  Evolve
68  (
70  ) = 0;
71 
72  MPILib::Time TStep() const {return _t_step; }
73 
74  virtual AbstractOdeSystem* Clone() const = 0;
75 
77  const OdeParameter& Par() const { return _par; }
78 
79  MPILib::Time CurrentTime() const { return _t_current; }
80 
82  virtual MPILib::Rate CurrentRate() const = 0;
83 
84  virtual Potential DCContribution() const { return 0;}
85 
88 
91  vector<MPILib::Potential>& InterpretationBuffer() { return _buffer_interpretation; }
92 
95  const vector<MPILib::Potential>& InterpretationBuffer() const { return _buffer_interpretation; }
96 
100  vector<MPILib::Potential>& MassBuffer() { return _buffer_mass; }
101 
105 
106  const vector<MPILib::Potential>& MassBuffer() const { return _buffer_mass; }
107 
110 
113 
116 
119  void PrepareReport
120  (
121  double*,
122  double*
123  ) const;
124 
125  protected:
126 
127  boost::shared_ptr<AbstractNeuralDynamics> _p_dyn;
128  const string _name_namerical;
131 
133  vector<MPILib::Potential> _buffer_interpretation;
134  vector<MPILib::Density> _buffer_mass;
135 
139 
140  vector<MPILib::Index> _map_cache;
141 
142  private:
143 
146 
147  vector<MPILib::Density> InitializeDensity () const;
148 
149  void NormaliseDensity (vector<MPILib::Density>*) const;
150  void InitializeGaussian (vector<MPILib::Density>*) const;
151  void InitializeSingleBin (vector<MPILib::Density>*) const;
152 
154  };
155 }
156 
157 #endif // include guard
158 
MPILib::Time CurrentTime() const
MPILib::Index FindBin(Potential) const
Find which bin in the interpretation array contains this potential.
double Potential
A geometric grid to represent population densities.
void InitializeSingleBin(vector< MPILib::Density > *) const
Contains the parameters necessary to configure a concrete OdeSystem instance. See AbstractOdeSystem a...
const vector< MPILib::Potential > & MassBuffer() const
Const direct access to the array that represents the density mass. Note that this may be confusing...
MPILib::Index IndexResetBin() const
Index of the reset bin relative to the interpretation array, i.e. constant during simulation...
vector< MPILib::Potential > _buffer_interpretation
virtual Potential DCContribution() const
unsigned int Number
void InitializeGaussian(vector< MPILib::Density > *) const
unsigned int Index
double Time
The configuration of a GeomAlgorithm requires that the neural dynamics is defined somewhere...
void NormaliseDensity(vector< MPILib::Density > *) const
vector< MPILib::Potential > & MassBuffer()
Direct access to the array that represents the density mass. Note that this may be confusing...
MPILib::Index InitializeResetBin() const
virtual MPILib::Rate CurrentRate() const =0
Rate due to neural dynamics driving.
vector< MPILib::Index > _map_cache
const OdeParameter & Par() const
Access to the OdeParameter of the system. It is often time-critical, therefore implemented as referen...
virtual ~AbstractOdeSystem()=0
pure virtual destructor for base class
const vector< MPILib::Potential > & InterpretationBuffer() const
Const access to the array of bin limits; be aware of the convention that the upper limit of the highe...
MPILib::Index InitializeReversalBin() const
virtual void Evolve(MPILib::Time)=0
Every sub class defines its own evolution. This Evolve function does not relate to neural dynamics: t...
void PrepareReport(double *, double *) const
Represents the current density profile. Both double pointers must point to contiguous memory at least...
MPILib::Time TStep() const
MPILib::Index MapPotentialToProbabilityBin(MPILib::Index i) const
Maintains the current mapping from a probability mass bin to its current poetntial bin in the interpr...
vector< MPILib::Potential > & InterpretationBuffer()
Access to the array of bin limits; be aware of the convention that the upper limit of the highest bin...
boost::shared_ptr< AbstractNeuralDynamics > _p_dyn
MPILib::Number NumberOfBins() const
Number of bins used in the grid representation.
vector< MPILib::Density > _buffer_mass
vector< MPILib::Density > InitializeDensity() const
The objective is find a numerical solution for this equation This requires a numerical representation of the density We will work in the state space of a two dimensional and define a mesh there We first give two examples and then define the general procedure and given in Table for given fixed Delta g see Fig and we will denote coordinates in this dimension by a small letter $v The second dimension can be used to represent parameters as varied as and will represented by $w A strip is constructed by choosing two neighbouring points in state e g and integrating the vector field for a time $T that is assumed to be an integer multiple of a period of time Delta which we assume to be a defining characteristic of the grid Let then the set of points the set of points which is quadrilateral in shape The quadrilateral should be but not necessarily as long as they are but it is convenient to number them in order of creation In the we will assume that strip numbers created by the integration procedure start and are so that the numbers i in each identify a unique strip Strip no is reserved for stationary points There may or more cells in strip The number of cells in strip $i denoted by with $i the strip number and $j the cell as the i
Definition: 2D.hpp:145
AbstractOdeSystem(const AbstractNeuralDynamics &)
Constructor using neural dynamics object (see AbstractNeuralDynamics and derived classes).
virtual AbstractOdeSystem * Clone() const =0
double Rate