7 #include "PlasticCloneConn.hpp" 8 #include "columns/HyPerCol.hpp" 9 #include "components/OriginalConnNameParam.hpp" 10 #include "weightupdaters/HebbianUpdater.hpp" 14 PlasticCloneConn::PlasticCloneConn() {}
16 PlasticCloneConn::PlasticCloneConn(
const char *name, HyPerCol *hc) { initialize(name, hc); }
18 PlasticCloneConn::~PlasticCloneConn() {}
20 int PlasticCloneConn::initialize(
const char *name, HyPerCol *hc) {
21 int status = CloneConn::initialize(name, hc);
26 PlasticCloneConn::communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) {
27 auto status = CloneConn::communicateInitInfo(message);
31 auto *originalConnNameParam = getComponentByType<OriginalConnNameParam>();
33 originalConnNameParam ==
nullptr,
34 "%s requires an OriginalConnNameParam component.\n",
36 auto *originalConnName = originalConnNameParam->getOriginalConnName();
37 auto *originalConn = message->lookup<HyPerConn>(std::string(originalConnName));
38 pvAssert(originalConn);
39 auto *originalUpdater = originalConn->getComponentByType<HebbianUpdater>();
41 originalUpdater ==
nullptr,
42 "%s specifies %s as its original connection, but this connection does not have a " 45 originalConn->getDescription_c());
47 auto *connectionData = getComponentByType<ConnectionData>();
48 pvAssert(connectionData);
49 pvAssert(connectionData->getInitInfoCommunicatedFlag());
52 originalUpdater->addClone(connectionData);
54 return Response::SUCCESS;
static bool completed(Status &a)