// // C++ Implementation: simmod_localinh // // Description: // // // Author: Frank Michler,,, , (C) 2010 // // Copyright: See COPYING file that comes with this distribution // // #include "sys.hpp" // for libcwd #include "debug.hpp" // for libcwd #include "objsimexception.hpp" #include "objsimlibrary.hpp" #include "simmod_localinh.hpp" SimMod_LocalInh::SimMod_LocalInh(AnyOptionWrapper* _opt) : SimModule(_opt), mInhLayer(0), mConInhEx(0), mConExInh(0), mConnectivity(0.5), mNumberOfChanges(0) { } SimMod_LocalInh::~SimMod_LocalInh() { } void SimMod_LocalInh::SetCmdLineOptions() { myAnyWrap->setOption( "LocInh_Range", 'a', &mRange, 0.08); myAnyWrap->setOption( "LocInh_InhExNeuronRatio", 'a', &mInhExNeuronRatio, 1); myAnyWrap->setOption( "LocInh_InhExStrength", 'a', &mInhExStrength, 0.2); myAnyWrap->setOption( "LocInh_ExInhStrength", 'a', &mExInhStrength, 2.0); myAnyWrap->setOption( "LocInh_GlobalExInhStrength", 'a', &mGlobalExInhStrength, 2.0); myAnyWrap->setOption( "LocInh_GlobalInhExStrength", 'a', &mGlobalInhExStrength, 2.0); } layer* SimMod_LocalInh::Setup (SimLoop* _MainSimLoop, layer* _ExLayer, bool LoadWeights, bool VecCon ) { MainSimLoop = _MainSimLoop; if (!_ExLayer) throw ObjSimException("_ExLayer is NULL"); // setup InhLayer int NExNeurons = _ExLayer->NNeurons(); int ExNeuronsNx = _ExLayer->NeuronsNx(); int ExNeuronsNy = _ExLayer->NeuronsNy(); int NInhNeurons = static_cast(NExNeurons*mInhExNeuronRatio); mInhLayer = new DecoLifLayer(NInhNeurons, DecoParaInhibitory); mInhLayer->SetupPositions(static_cast(mInhExNeuronRatio*ExNeuronsNx), static_cast(mInhExNeuronRatio*ExNeuronsNy), true); mInhLayer->SetName("LocInh_InhLayer"); MainSimLoop->AddSimElement(mInhLayer); // connecting InhLayer to _ExLayer mConInhEx = new VecConnection(mInhLayer, _ExLayer, csimInputChannel_GABAa, false); mConInhEx->SetName("LocInh_ConInhEx"); mConInhEx->ConnectSelf(mInhExStrength, 1, 0); // mConInhEx->ConnectGaussian(0.01, mInhExStrength, 1,0, true); mConInhEx->Save(); MainSimLoop->AddSimElement(mConInhEx); // connecting _ExLayer to InhLayer mConExInh = new VecConnection(_ExLayer, mInhLayer, csimInputChannel_NMDA_AMPA, true); mConExInh->SetName("LocInh_ConExInh"); RangeConnectionParameters ConExInhParameter(mRange, mExInhStrength, 1,0, mConnectivity, true); //mConExInh->ConnectGaussian(mRange, mExInhStrength, 1,0, true); mConExInh->ConnectCircular(ConExInhParameter); mConExInh->Save(); MainSimLoop->AddSimElement(mConExInh); } void SimMod_LocalInh::changeParameter(ParameterSet * ParaSet) { TwoParameters* RangeAndSetrngth = dynamic_cast* >(ParaSet); if (RangeAndSetrngth) { RangeConnectionParameters ConExInhParameter( RangeAndSetrngth->first, RangeAndSetrngth->second, 1, 0, mConnectivity, true); mConExInh->DeleteSynapseArrays(); mConExInh->ConnectCircular(ConExInhParameter); //mConExInh->Save(mNumberOfChanges++); } }