/* © Copyright 2008 Randal A. Koene With design assistance from J. van Pelt & A. van Ooyen, and support from the Netherlands Organization for Scientific Research (NWO) Program Computational Life Sciences grant CLS2003 (635.100.005) and from the EC Marie Curie Research and Training Network (RTN) NEURoVERS-it 019247. This file is part of NETMORPH. NETMORPH is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. NETMORPH is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NETMORPH. If not, see . */ // Catacomb_Object.cc // Randal A. Koene, 20080316 #include "diagnostic.hh" #include "global.hh" #include "network.hh" #include "spatial.hh" #include "Catacomb_Object.hh" Catacomb_Group * ccmregionsgroup = NULL; Catacomb_Group * ccmprojectionsgroup = NULL; Catacomb_Group * ccmconnectionsgroup = NULL; long Catacomb_neuronindex = 0; long Catacomb_connectionindex = 0; Catacomb_Header::Catacomb_Header(): text("\n\ \"2.210\"\n\ \n\ \n\ \n\ \n\ \"org.enorg.catacomb.lab.Workbench\"\n\ \"workbench\"\n\ \n\ \n\ \"org.enorg.catacomb.assembly.AssemblyItem\"\n\ \"assemblyItems\"\n\ \n\ 100.0\n\ 0.2\n\ 0.1\n\ 10.0\n\ 0\n\ \n\ -17.27623406341942 8.591042824452437 \n\ \n\ \n\ 1.0 1.0 \n\ \n\ 10065101\n\ 0\n\ \"fixedStepRunner\"\n\ \n") { } String Catacomb_Neuron::str() { // Note that due to the normal ordering used for output, // the output for this object begins with the closing // of the preceding workbench content. String s("\n\ 14465878\n\ 0\n\ \"Workbench\"\n\ \n\ \n\ \n\ \"org.enorg.catacomb.network.Neuron\"\n\ \"neuron\"\n\ \n\ 1\n\ \n\ \"org.enorg.catacomb.assembly.AssemblyItem\"\n\ \"assemblyItems\"\n\ \n\ 5.0\n\ 1.0\n\ 2\n\ 1.0\n\ 5.0\n\ 1.0\n\ -70.0\n\ -70.0\n\ \n\ -1.1237332461588743 -1.2827721477607072 \n\ \n\ \n\ 1.0 1.0 \n\ \n\ 14197955\n\ 0\n\ \"integratorCompartment\"\n\ \n\ \n\ -90.0\n\ 1.0\n\ 4.0\n\ 8.0\n\ 30.0\n\ \n\ 0.006047728015692755 1.4004576659038896 \n\ \n\ \n\ 1.0 1.0 \n\ \n\ 5741236\n\ 0\n\ \"spikeResponseFunction\"\n\ \n\ \n\ -50.0\n\ 1.0\n\ \n\ 2.3362209872507362 -0.5766590389016022 \n\ \n\ \n\ 1.0 1.0 \n\ \n\ 8857063\n\ 0\n\ \"thresholdSpikeGenerator\"\n\ \n\ \n\ 0.0\n\ 0.1\n\ 10.0\n\ 4.0\n\ 10.0\n\ 30.0\n\ 0\n\ 0.5\n\ 0\n\ 0.0\n\ 0.0\n\ \n\ -3.595129127165741 0.8355671788166061 \n\ \n\ \n\ 1.0 1.0 \n\ \n\ 16332687\n\ 0\n\ \"synapsePopulation\"\n\ \n\ \n\ \n\ -2.4888852566198096 -0.5531219352729657 \n\ \n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n\ \"-0.3662 0.6486 synapsePopulation membrane -1\"\n\ \"0.7151 -0.07965 integratorCompartment channels -1\"\n\ \n\ 12162413\n\ 0\n\ \"insertionArrow\"\n\ \n\ \n\ \n\ -0.27639751552795033 0.15299117358613845 \n\ \n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n\ \"0.2824 0.2474 spikeResponseFunction membrane -1\"\n\ \"-1.497 -0.7857 integratorCompartment channels -1\"\n\ \n\ 9685697\n\ 0\n\ \"insertionArrow_0\"\n\ \n\ \n\ \n\ 0.7592350441320708 -0.6472703497875125 \n\ \n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n\ \"-1.383 -0.1355 integratorCompartment potential -1\"\n\ \"0.5769 0.07061 thresholdSpikeGenerator potentialIn -1\"\n\ \n\ 7065045\n\ 0\n\ \"vectorCable\"\n\ \n\ \n\ \n\ 2.595129127165741 2.106570774762994 \n\ \n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n\ \"0.7410 -2.683 thresholdSpikeGenerator spikeOut -1\"\n\ \"-2.589 0.2938 spikeResponseFunction spikeIn -1\"\n\ \n\ 15739752\n\ 0\n\ \"spikeCable\"\n\ \n\ \n\ \n\ 2.38329519450801 -2.106570774762995 \n\ \n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n\ \"0.9529 1.529 thresholdSpikeGenerator spikeOut -1\"\n\ \"-2.857 0.1738 integratorCompartment reset -1\"\n\ \n\ 13846473\n\ 0\n\ \"spikeCable_0\"\n\ \n\ \n\ 0.0\n\ 0.1\n\ 10.0\n\ 4.0\n\ 10.0\n\ 30.0\n\ 0\n\ 0.5\n\ 0\n\ 0.0\n\ 0.0\n\ \n\ -3.586862886561444 -2.0404827899054783 \n\ \n\ \n\ 1.0 1.0 \n\ \n\ 6223864\n\ 0\n\ \"synapsePopulation_0\"\n\ \n\ \n\ \n\ -2.2376720897815927 -1.9099159386042022 \n\ \n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n\ \"-0.6091 -0.8705 synapsePopulation_0 membrane -1\"\n\ \"0.4639 1.277 integratorCompartment channels -1\"\n\ \n\ 12823593\n\ 0\n\ \"insertionArrow_1\"\n\ \n\ \n\ 11372167\n\ 0\n\ \"neuron\"\n\ \n\ \n"); return s; } String Catacomb_Region::str() { String s("\n\ 0.3\n\ 1\n\ 1\n\ 1\n\ 1\n\ \n\ \n"); for (int i=0; i\n\ \n\ 0\n\ \n"; s += String(x+5.0,"%.5f ") + String(y+5.0,"%.5f \n"); s += "\n\ \n\ 1.0 1.0 \n\ \n\ 16678431\n\ 0\n\ \""; s += name + "_recorder"; s += "\"\n\ \n\ \n\ \n\ \"org.enorg.catacomb.network.Neuron\"\n\ 0\n\ \"neuron\"\n\ \"neuron\"\n\ \n\ 0\n\ "; s += String((long) n); s += "\n\ 1\n\ 0\n\ \n"; s += String(x,"%.5f ") + String(y,"%.5f \n"); s += "\n\ \n\ 4.0 4.0 \n\ \n\ 2981602\n\ 0\n\ \""; s += name; s += "\"\n\ \n"; s += "\n\ \n"; s += String(x+4.0,"%.5f ") + String(y+4.0,"%.5f \n"); s += "\n\ \n\ 1.0 1.0 \n\ \n\ 15674009\n\ 0\n\ \""; s += name + "_JoinCloneRelay"; s += "\"\n\ \n"; s += "\n\ \n"; s += String(x+2.0,"%.5f ") + String(y+2.0,"%.5f \n"); s += "\n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n"; s += "\"-0.4416 -6.088 " + name + " thresholdSpikeGenerator.spikeOut -1\"\n\ \"0.5534 1.435 " + name + "_JoinCloneRelay spikes in 0\"\n"; s += "\n\ 10514627\n\ 0\n\ \""; s += name + "toRelay_spikeCable\"\n\ \n"; s += "\n\ \n"; s += String(x+4.5,"%.5f ") + String(y+4.5,"%.5f \n"); s += "\n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n"; s += "\"-0.8829 -1.059 " + name + "_JoinCloneRelay spike out -1\"\n\ \"0.4122 0.7176 " + name + "_recorder spike in -1\"\n"; s += "\n\ 1702589\n\ 0\n\ \""; s += "Relayto" + name + "_recorder_spikeCable\"\n\ \n"; s += "\n\ \n"; s += String(x+2.5,"%.5f ") + String(y+2.5,"%.5f \n"); s += "\n\ \n\ 2.0 2.0 \n\ \n\ \n\ 16777215\n\ 0\n\ 0\n\ \n"; s += "\"-3.015 -4.364 " + name + " thresholdSpikeGenerator.effective potential -1\"\n\ \"1.189 2.977 " + name + "_recorder vector in -1\"\n"; s += "\n\ 14930997\n\ 0\n\ \""; s += name + "torecorder_vectorCable\"\n\ \n"; return s; } String Catacomb_Projection::str() { String s; for (int i=0; iDim(); i++) { for (int j=0; jDim(); j++) { if (ccmprojections->el(i,j)!=NULL) { s += "\n\ 3\n\ \n\ \"org.enorg.catacomb.network.ConnectionTable\"\n\ 0\n\ \""; region * r_from = regions->el(i); region * r_to = regions->el(j); s += r_from->Name()+"to"+r_to->Name(); s += "\"\n\ \"connectionTable\"\n\ \n\ 0\n\ 0\n\ 0\n\ 0.0\n\ \n"; spatial p(r_from->center()); if (i==j) { s += String(p.X()+5.0,"%.5f ") + String(p.Y()-5.0,"%.5f\n"); } else { p += r_to->center(); p /= 2.0; s += String(p.X(),"%.5f ") + String(p.Y(),"%.5f\n"); } s += "\n\ \n\ 2.0 2.0 \n\ \n\ \n\ 0\n\ 0\n\ 0\n\ \n"; s += "\"7.486 4.759 " + r_from->Name() + " thresholdSpikeGenerator.spikeOut -1\"\n"; s += "\"0.3859 6.058 " + r_to->Name(); if (i==j) s += " synapsePopulation.afferent spike -1\"\n"; else s += " synapsePopulation_0.afferent spike -1\"\n"; s += "\n\ 7124075\n\ 0\n\ \""; s += r_from->Name()+"to"+r_to->Name() + "_spikeProjection\"\n\ \n"; } } } return s; } String Catacomb_ConnectionTable::str() { String s("\n\ \"org.enorg.catacomb.network.ConnectionTable\"\n\ \"connectionTable\"\n"); for (int i=0; iDim(); i++) { for (int j=0; jDim(); j++) { ccm_tableptr & ctp = ccmprojections->el(i,j); // a reference can be set only once if (ctp!=NULL) { s += "\n\ 1\n\ "; region * r_from = regions->el(i); region * r_to = regions->el(j); s += String((long) ctp->Dim_in()); s += "\n\ "; s += String((long) ctp->Dim_out()); s += "\n\ 0.8\n\ 2.0\n\ \n\ \"\"\n\ 1\n\ 13148976\n\ 0\n\ \"importer\"\n\ \n\ \n\ \n\ \n\ \n\ \n\ "; s += String((long) ctp->Dim_in()); s += "\n\ "; s += String((long) ctp->Dim_out()); s += "\n\ \n"; for (int r=0; rDim_in(); r++) { s += "\n\ \"\"\n\ \n"; int numindices = 0; for (int c=0; cDim_in(); c++) if (ctp->el(r,c)!=0) { s += String((long) c); numindices++; } s += "\n\n\ \n"; for (int ni=0; niName() + "to" + r_to->Name(); s += "\"\n\ \n"; } } } s += "\n"; return s; } String Catacomb_Group::str() { String s; if (!comment.empty()) { comment.prepend(""; s = comment; } PLL_LOOP_FORWARD(Catacomb_Object,ccmobjects.head(),1) s+=e->str(); return s; } void Catacomb_Group::Add_Catacomb_Object(Catacomb_Object * ccmobject) { if (!ccmobject) return; ccmobjects.link_before(ccmobject); }