Miind
GeomAlgorithm.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 
21 #ifndef _CODE_LIBS_GEOMLIB_GEOMALGORITHM_INCLUDE_GUARD
22 #define _CODE_LIBS_GEOMLIB_GEOMALGORITHM_INCLUDE_GUARD
23 
24 #include <boost/circular_buffer.hpp>
26 #include "GeomParameter.hpp"
28 
29 
30 namespace GeomLib {
32 
75  template <class WeightValue>
76  class GeomAlgorithm : public AlgorithmInterface<WeightValue> {
77  public:
78 
81 
84  (
85  const GeomParameter&
86  );
87 
90 
92  virtual ~GeomAlgorithm();
93 
98  virtual GeomAlgorithm* clone() const;
99 
104  virtual void configure(const MPILib::SimulationRunParameter& simParam);
105 
107  virtual void evolveNodeState
108  (
109  const std::vector<Rate>&,
110  const std::vector<WeightValue>&,
111  Time
112  );
113 
114  virtual void prepareEvolve(const std::vector<Rate>&,
115  const std::vector<WeightValue>&,
116  const std::vector<MPILib::NodeType>&);
117 
118 
123  virtual MPILib::Time getCurrentTime() const;
124 
125 
130  virtual MPILib::Rate getCurrentRate() const;
131 
136  virtual MPILib::AlgorithmGrid getGrid(NodeId, bool b_state = true) const;
137 
138  private:
139 
140  bool IsReportDue() const;
141 
144  unique_ptr<AbstractOdeSystem> _p_system;
145  unique_ptr<AbstractMasterEquation> _p_zl;
146 
147  bool _b_zl;
151 
152  mutable Number _n_report;
153 
154  };
155 }
156 
157 #endif // include guard
158 
Population density algorithm based on Geometric binning: http://arxiv.org/abs/1309.1654.
virtual MPILib::Time getCurrentTime() const
virtual ~GeomAlgorithm()
virtual destructor
const GeomParameter _par_geom
GeomAlgorithm(const GeomParameter &)
Standard way for user to create algorithm.
virtual void prepareEvolve(const std::vector< Rate > &, const std::vector< WeightValue > &, const std::vector< MPILib::NodeType > &)
unsigned int Number
bool IsReportDue() const
double Time
The interface for all algorithm classes.
virtual MPILib::Rate getCurrentRate() const
virtual void evolveNodeState(const std::vector< Rate > &, const std::vector< WeightValue > &, Time)
Evolve the state of the node, by time t, given input firing rates and weight vector.
Parameter for the configuration of a GeomAlgorithm object. Users of SpikingOdeSystem should read the ...
unsigned int NodeId
Parameter determining how a simulation is run. Specifiying begin and end time, log file names...
unique_ptr< AbstractOdeSystem > _p_system
virtual void configure(const MPILib::SimulationRunParameter &simParam)
virtual MPILib::AlgorithmGrid getGrid(NodeId, bool b_state=true) const
virtual GeomAlgorithm * clone() const
unique_ptr< AbstractMasterEquation > _p_zl
double Rate