/****************************************************************/ /* */ /* tectum_88.C */ /* */ /****************************************************************/ # include "nsl_include.h" # include "tectum_88.h" extern void ganglion_cell_def(nsl_input_matrix&,int,float,float,float); extern void erf_func(nsl_input_matrix&,nsl_input_matrix&,int,float,float,float); Tectum88::Tectum88(nsl_string str, NslModule* parent) : NslModule(str,parent), in("in",this,32,32), // network input // in1("in1",this,8,8), // network input r2("r2",this,8,8), // ganglion cells r3("r3",this,8,8), r4("r4",this,8,8), gl("gl",this,8,8), GL("GL",this,8,8), lp("lp",this,8,8), LP("LP",this,8,8), sp("sp",this,8,8), SP("SP",this,8,8), sn("sn",this,8,8), SN("SN",this,8,8), py("py",this,8,8), PY("PY",this,8,8), tp("tp",this,8,8), TP("TP",this,8,8), C("C",this), gl_tm("gl_tm",this), lp_tm("lp_tm",this), sp_tm("sp_tm",this), sn_tm("sn_tm",this), py_tm("py_tm",this), tp_tm("tp_tm",this), Wr2gl("Wr2gl",this,3,3), Wlpgl("Wlpgl",this,3,3), Wspgl("Wspgl",this,3,3), Wr2lp("Wr2lp",this,3,3), Wgllp("Wgllp",this,3,3), Wsplp("Wsplp",this,3,3), Wsnlp("Wsnlp",this,3,3), Wtplp("Wtplp",this,3,3), Wr2sp("Wr2sp",this,3,3), Wglsp("Wglsp",this,3,3), Wsnsp("Wsnsp",this,3,3), Wtpsp("Wtpsp",this,3,3), Wlpsn("Wlpsn",this,3,3), Wr2py("Wr2py",this,3,3), Wr3py("Wr3py",this,3,3), Wr4py("Wr4py",this,3,3), Wsppy("Wsppy",this,3,3), Wlppy("Wlppy",this,3,3), Wtppy("Wtppy",this,3,3), Wr3tp("Wr3tp",this,3,3), Wr4tp("Wr4tp",this,3,3) { } void Tectum88::initRun() { in = 0; // in1 = 0; r2 = 0; r3 = 0; r4 = 0; gl = 0; GL = 0; lp = -0.09; LP = 0; sp = -0.18; SP = 0; sn = 0; SN = 0; py = -0.36; PY = 0; tp = 0; TP = 0; } void Tectum88::simRun() { in = 0; in.run(); // in1 = 0; // in1.run(); // type = 2 // d = 0.7 // erf = 4.0 // val = 1.0 erf_func(in,r2,2,0.7,4.0,1.0); // type = 3 // d = 1.2 // erf = 8.0 // val = 0.65 erf_func(in,r3,3,1.2,8.0,0.65); // type = 4 // d = 1.1 // erf = 12.0-16.0 // val = 0.4 erf_func(in,r4,4,1.1,16.0,0.4); nslDiff(gl,gl_tm, -gl + Wr2gl*r2 + Wlpgl*LP + Wspgl*SP); GL = gl; nslDiff(lp,lp_tm, -lp+Wr2lp*r2+Wgllp*GL+Wsplp*SP-Wsnlp*SN-Wtplp*TP); LP = NSLstep(lp,(float)1.0); nslDiff(sp,sp_tm, -sp + Wr2sp*r2 + Wglsp*GL - Wsnsp*SN - Wtpsp*TP); SP = NSLstep(sp,(float)1.7); nslDiff(sn,sn_tm, -sn + Wlpsn*LP); SN = NSLramp(sn,(float)0.2,(float)0,(float)0.2); nslDiff(py,py_tm, -py + Wr2py*r2 + Wr3py*r3 + Wr4py*r4 + Wsppy*SP + Wlppy*LP - Wtppy*TP); PY = NSLsat(py,(float)1.91,(float)5); nslDiff(tp,tp_tm, -tp + Wr3tp*r3 + Wr4tp*r4); TP = NSLramp(tp,(float)3.7,(float)0,(float)3.7); } Tectum88Model::Tectum88Model() : NslModel("Tectum88Model"), tectum("tectum",this) { } AslSchemaModel _Tectum88Model("Tectum88Model");