8 #include "CopyConn.hpp" 9 #include "columns/HyPerCol.hpp" 10 #include "components/CopyWeightsPair.hpp" 11 #include "components/DependentArborList.hpp" 12 #include "components/DependentPatchSize.hpp" 13 #include "components/DependentSharedWeights.hpp" 14 #include "utils/MapLookupByType.hpp" 15 #include "weightupdaters/CopyUpdater.hpp" 19 CopyConn::CopyConn(
char const *name, HyPerCol *hc) { initialize(name, hc); }
21 CopyConn::CopyConn() {}
23 CopyConn::~CopyConn() {}
25 int CopyConn::initialize(
char const *name, HyPerCol *hc) {
26 int status = HyPerConn::initialize(name, hc);
30 void CopyConn::defineComponents() {
31 HyPerConn::defineComponents();
32 mOriginalConnNameParam = createOriginalConnNameParam();
33 if (mOriginalConnNameParam) {
38 ArborList *CopyConn::createArborList() {
return new DependentArborList(name, parent); }
40 PatchSize *CopyConn::createPatchSize() {
return new DependentPatchSize(name, parent); }
42 SharedWeights *CopyConn::createSharedWeights() {
return new DependentSharedWeights(name, parent); }
44 WeightsPairInterface *CopyConn::createWeightsPair() {
return new CopyWeightsPair(name, parent); }
46 InitWeights *CopyConn::createWeightInitializer() {
return nullptr; }
48 BaseWeightUpdater *CopyConn::createWeightUpdater() {
return new CopyUpdater(name, parent); }
50 OriginalConnNameParam *CopyConn::createOriginalConnNameParam() {
51 return new OriginalConnNameParam(name, parent);
54 Response::Status CopyConn::initializeState() {
55 auto *copyWeightsPair =
dynamic_cast<CopyWeightsPair *
>(mWeightsPair);
56 pvAssert(copyWeightsPair);
57 if (!copyWeightsPair->getOriginalWeightsPair()->getInitialValuesSetFlag()) {
58 return Response::POSTPONE;
60 copyWeightsPair->copy();
61 return Response::SUCCESS;
virtual void addObserver(Observer *observer) override