PetaVision  Alpha
MomentumConn.cpp
1 /* MomentumConn.cpp
2  *
3  * Created on: Feburary 27, 2014
4  * Author: slundquist
5  */
6 
7 #include "MomentumConn.hpp"
8 #include "columns/HyPerCol.hpp"
9 #include "utils/MapLookupByType.hpp"
10 #include "weightupdaters/MomentumUpdater.hpp"
11 
12 namespace PV {
13 
14 MomentumConn::MomentumConn(char const *name, HyPerCol *hc) { initialize(name, hc); }
15 
16 MomentumConn::MomentumConn() {}
17 
18 MomentumConn::~MomentumConn() {}
19 
20 int MomentumConn::initialize(char const *name, HyPerCol *hc) {
21  return HyPerConn::initialize(name, hc);
22 }
23 
24 BaseWeightUpdater *MomentumConn::createWeightUpdater() { return new MomentumUpdater(name, parent); }
25 
26 char const *MomentumConn::getMomentumMethod() const {
27  auto *momentumUpdater =
28  mapLookupByType<MomentumUpdater>(mComponentTable.getObjectMap(), getDescription());
29  pvAssert(momentumUpdater);
30  return momentumUpdater->getMomentumMethod();
31 }
32 
33 float MomentumConn::getTimeConstantTau() const {
34  auto *momentumUpdater =
35  mapLookupByType<MomentumUpdater>(mComponentTable.getObjectMap(), getDescription());
36  pvAssert(momentumUpdater);
37  return momentumUpdater->getTimeConstantTau();
38 }
39 
40 } // namespace PV