Miind
RateFunctor.hpp
Go to the documentation of this file.
1 // Copyright (c) 2005 - 2009 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 cite
19 // the 'currently valid reference', which can be found at http://miind.sourceforge.net
20 
21 
22 #ifndef MPILIB_ALGORITHMS_RATEFUNCTOR_HPP_
23 #define MPILIB_ALGORITHMS_RATEFUNCTOR_HPP_
24 
27 
28 namespace MPILib {
29 
31 
32  inline Rate Nul(Time){ return 0; }
33 
39 
40  template <class WeightValue>
41  class RateFunctor : public AlgorithmInterface<WeightValue>{
42  public:
43 
44 
47 
49  virtual ~RateFunctor(){}
50 
55  virtual RateFunctor* clone() const;
56 
57 
62  virtual void configure(const SimulationRunParameter& simParam);
63 
64 
71  virtual void evolveNodeState(const std::vector<Rate>& nodeVector,
72  const std::vector<WeightValue>& weightVector, Time time);
73 
74 
79  virtual MPILib::Time getCurrentTime() const;
80 
85  virtual MPILib::Rate getCurrentRate() const;
86 
87 
88  virtual AlgorithmGrid getGrid(NodeId, bool b_state) const;
89 
90 
91  private:
92 
96 
97  }; // end of RateFunctor
98 
100 
101 } // end of MPILib
102 
103 #endif // include guard
104 
virtual AlgorithmGrid getGrid(NodeId, bool b_state) const
virtual ~RateFunctor()
mandatory virtual destructor
Definition: RateFunctor.hpp:49
RateFunction _function
Definition: RateFunctor.hpp:93
virtual MPILib::Rate getCurrentRate() const
double Time
MPILib::Time _current_time
Definition: RateFunctor.hpp:94
The interface for all algorithm classes.
virtual void evolveNodeState(const std::vector< Rate > &nodeVector, const std::vector< WeightValue > &weightVector, Time time)
MPILib::Rate _current_rate
Definition: RateFunctor.hpp:95
virtual void configure(const SimulationRunParameter &simParam)
RateFunctor(RateFunction)
Constructor must be initialized with pointer a rate function of time.
An Algorithm that encapsulates a rate as a function of time.
Definition: RateFunctor.hpp:41
virtual MPILib::Time getCurrentTime() const
RateFunctor< double > D_RateFunctor
Definition: RateFunctor.hpp:99
Rate Nul(Time)
Definition: RateFunctor.hpp:32
unsigned int NodeId
Parameter determining how a simulation is run. Specifiying begin and end time, log file names...
virtual RateFunctor * clone() const
MPILib::Rate(* RateFunction)(MPILib::Time)
Definition: RateFunctor.hpp:30
double Rate