PetaVision  Alpha
HyPerDelivery.hpp
1 /*
2  * HyPerDelivery.hpp
3  *
4  * Created on: Aug 24, 2017
5  * Author: Pete Schultz
6  */
7 
8 #ifndef HYPERDELIVERY_HPP_
9 #define HYPERDELIVERY_HPP_
10 
11 #include "BaseDelivery.hpp"
12 #include "components/ArborList.hpp"
13 #include "components/WeightsPair.hpp"
14 
15 namespace PV {
16 
23 class HyPerDelivery : public BaseDelivery {
24  protected:
39  virtual void ioParam_convertRateToSpikeCount(enum ParamsIOFlag ioFlag); // End of list of HyPerDeliveryFacade parameters.
41 
42  public:
43  enum AccumulateType { UNDEFINED, CONVOLVE, STOCHASTIC };
44 
45  HyPerDelivery(char const *name, HyPerCol *hc);
46 
47  virtual ~HyPerDelivery();
48 
49  void setConnectionData(ConnectionData *connectionData);
50 
51  virtual void deliver() override = 0;
52 
53  virtual bool isAllInputReady() override;
54 
55  protected:
56  HyPerDelivery();
57 
58  int initialize(char const *name, HyPerCol *hc);
59 
60  virtual void setObjectType() override;
61 
62  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
63 
64  virtual Response::Status
65  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
66 
67  virtual Response::Status allocateDataStructures() override;
68 
69  double convertToRateDeltaTimeFactor(double timeConstantTau) const;
70 
71  // Data members
72  protected:
73  AccumulateType mAccumulateType = CONVOLVE;
74  bool mUpdateGSynFromPostPerspective = false;
75  bool mConvertRateToSpikeCount = false;
76 
77  float mDeltaTimeFactor = 1.0f;
78  WeightsPair *mWeightsPair = nullptr;
79  ArborList *mArborList = nullptr;
80 
81 }; // end class HyPerDelivery
82 
83 } // end namespace PV
84 
85 #endif // HYPERDELIVERY_HPP_
virtual void ioParam_convertRateToSpikeCount(enum ParamsIOFlag ioFlag)
convertRateToSpikeCount: If true, presynaptic activity is converted from a rate (spikes per second) t...
virtual bool isAllInputReady() override
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override