- Timestamp:
- 02/03/11 03:09:19 (14 years ago)
- Location:
- cpp/gdk
- Files:
-
- 10 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/gdk/Makefile
r66 r69 2 2 # Framsticks GDK makefile 3 3 # 4 # 5 # frams->GDK differences: 6 # ------------------------- 7 # #define GDK_WITHOUT_FRAMS 8 # f0.def (removed some neurons) 9 # gen-config.h (only f1->f0 is supported) 10 # neuroimpl-body-gdk.h (dummy implementations) 11 # 12 # autogenerated files can differ: 13 # defassign-f0_joint.h defassign-f0_part.h defassign-f0_neuro.h f0classes.h 14 # defassign-f0_neuroconn.h f0def.xml neurocls-library.h neurocls-factory.h model.def 4 15 5 16 TARGETS=convtest gdktest genotest neurotest loadertest f0def.xml model.def … … 7 18 all: $(TARGETS) 8 19 9 CXXOPTS= -D NOCREATUREOBJECT-DEASYMAPDEBUG -g -Wno-parentheses -Wno-overloaded-virtual -Wno-format20 CXXOPTS= -DGDK_WITHOUT_FRAMS -DEASYMAPDEBUG -g -Wno-parentheses -Wno-overloaded-virtual -Wno-format 10 21 # -DEASYMAPDEBUG is required for convtest 11 22 … … 86 97 fullclean: clean 87 98 rm -f $(TARGETS) $(AUTOGENERATED) 88 89 prepare: $(AUTOGENERATED) depend90 rm -f Makefile.bak91 ~/bin/addhead ../gdk-head.txt *.h *.cpp92 99 93 100 depend: -
cpp/gdk/defassign-f0_joint.h
r66 r69 1 // This file is a part of the Framsticks GDK library.2 // Copyright (C) 2002-2011 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.framsticks.com/ for further information.4 5 1 6 2 -
cpp/gdk/defassign-f0_neuro.h
r66 r69 1 // This file is a part of the Framsticks GDK library.2 // Copyright (C) 2002-2011 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.framsticks.com/ for further information.4 5 1 6 2 -
cpp/gdk/defassign-f0_neuroconn.h
r66 r69 1 // This file is a part of the Framsticks GDK library.2 // Copyright (C) 2002-2011 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.framsticks.com/ for further information.4 5 1 6 2 -
cpp/gdk/defassign-f0_part.h
r66 r69 1 // This file is a part of the Framsticks GDK library.2 // Copyright (C) 2002-2011 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.framsticks.com/ for further information.4 5 1 6 2 // default assignments for Part : -
cpp/gdk/f0.def
r66 r69 139 139 ENDNEUROCLASS 140 140 141 NEUROCLASS(VectorEye,VEye,Vector Eye [EXPERIMENTAL!],Refer to publications to learn more about this neuron.,1,1,1)142 SYMBOL(`11,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,14,70,50,65,40,60,35,45,30,30,30,15,35,10,40,5,50,10,60,15,65,30,70,45,70,60,65,65,60,70,50,8,38,67,28,62,23,52,28,42,38,37,48,42,53,52,48,62,38,67,4,33,52,38,47,43,52,38,57,33,52,5,70,50,60,40,45,35,30,35,15,40,5,50,1,53,33,58,22,1,62,36,68,26,1,45,30,47,19,1,35,30,35,19,1,27,31,24,20,1,18,34,12,24')143 NEUROPROP(tx,0,0,target.x,f,,,,target.x)144 NEUROPROP(ty,0,0,target.y,f,,,,target.y)145 NEUROPROP(tz,0,0,target.z,f,,,,target.z)146 NEUROPROP(ts,0,0,target shape,s,0,-1,0,targetShape)147 NEUROPROP(p,0,0,perspective,f,0.1,10.0,1.0,perspz)148 NEUROPROP(s,0,0,scale,f,0.1,100.0,1.0,perspscale)149 NEUROPROP(h,0,0,show hidden lines,d,0,1,0,showhidden)150 NEUROPROP(o,0,0,`output lines count (each line needs four channels)',d,0,99,0,outputcount)151 NEUROPROP(d,0,0,debug,d,0,1,0,showdebug)152 ENDNEUROCLASS153 154 NEUROCLASS(VisualMotorNeuron,VMotor,Visual-Motor Cortex [EXPERIMENTAL!],`Must be connected to the VEye and properly set up. Refer to publications to learn more about this neuron.',-1,1,0)155 NEUROPROP(noIF,0,0,number of basic features,d,,,,noIF)156 NEUROPROP(noDim,0,0,number of degrees of freedom,d,,,,noDim)157 NEUROPROP(params,0,0,parameters,s,,,,params)158 ENDNEUROCLASS159 160 141 NEUROCLASS(Sticky,Sti,Sticky [EXPERIMENTAL!],,1,0,1) 161 142 VISUALHINTS(EffectorClass) … … 196 177 NEUROPROP(t,0,0,time,f,0,6.283185307,0,t) 197 178 ENDNEUROCLASS 198 -
cpp/gdk/f0classes.h
r66 r69 156 156 157 157 158 159 160 -
cpp/gdk/f0def.xml
r66 r69 130 130 </NEUROCLASS> 131 131 132 <NEUROCLASS ID="VEye" NAME="Vector Eye [EXPERIMENTAL!]" DESCRIPTION="Refer to publications to learn more about this neuron." INPUTS="1" OUTPUT="1" LOCATION="1" SYMBOL="11,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,14,70,50,65,40,60,35,45,30,30,30,15,35,10,40,5,50,10,60,15,65,30,70,45,70,60,65,65,60,70,50,8,38,67,28,62,23,52,28,42,38,37,48,42,53,52,48,62,38,67,4,33,52,38,47,43,52,38,57,33,52,5,70,50,60,40,45,35,30,35,15,40,5,50,1,53,33,58,22,1,62,36,68,26,1,45,30,47,19,1,35,30,35,19,1,27,31,24,20,1,18,34,12,24" >133 134 <NEUROPROP ID="tx" NAME="target.x" TYPE="f" MIN="" MAX="" DEF="" />135 <NEUROPROP ID="ty" NAME="target.y" TYPE="f" MIN="" MAX="" DEF="" />136 <NEUROPROP ID="tz" NAME="target.z" TYPE="f" MIN="" MAX="" DEF="" />137 <NEUROPROP ID="ts" NAME="target shape" TYPE="s" MIN="0" MAX="-1" DEF="0" />138 <NEUROPROP ID="p" NAME="perspective" TYPE="f" MIN="0.1" MAX="10.0" DEF="1.0" />139 <NEUROPROP ID="s" NAME="scale" TYPE="f" MIN="0.1" MAX="100.0" DEF="1.0" />140 <NEUROPROP ID="h" NAME="show hidden lines" TYPE="d" MIN="0" MAX="1" DEF="0" />141 <NEUROPROP ID="o" NAME="output lines count (each line needs four channels)" TYPE="d" MIN="0" MAX="99" DEF="0" />142 <NEUROPROP ID="d" NAME="debug" TYPE="d" MIN="0" MAX="1" DEF="0" />143 </NEUROCLASS>144 145 <NEUROCLASS ID="VMotor" NAME="Visual-Motor Cortex [EXPERIMENTAL!]" DESCRIPTION="Must be connected to the VEye and properly set up. Refer to publications to learn more about this neuron." INPUTS="-1" OUTPUT="1" LOCATION="0" >146 <NEUROPROP ID="noIF" NAME="number of basic features" TYPE="d" MIN="" MAX="" DEF="" />147 <NEUROPROP ID="noDim" NAME="number of degrees of freedom" TYPE="d" MIN="" MAX="" DEF="" />148 <NEUROPROP ID="params" NAME="parameters" TYPE="s" MIN="" MAX="" DEF="" />149 </NEUROCLASS>150 151 132 <NEUROCLASS ID="Sti" NAME="Sticky [EXPERIMENTAL!]" DESCRIPTION="" INPUTS="1" OUTPUT="0" LOCATION="1" VISUALHINTS="16" > 152 133 … … 188 169 </NEUROCLASS> 189 170 190 191 171 </F0CLASSES> -
cpp/gdk/model.def
r66 r69 59 59 prop:id=getInputNeuroIndex,name="get input neuron index",group="Connections",flags=1+2,type="p d(d) " 60 60 prop:id=getInputWeight,name="get input weight",group="Connections",flags=1+2,type="p f(d) " 61 prop:id=classObject,name="neuron class",group="Connections",flags=1+2,type="o NeuroClass " 61 62 62 63 … … 101 102 102 103 103 neuro: id=*,name="Constant",info="Constant value",inputs=0,output=1,location=0 ,vhints=1 ,symbol=" 3,6,100,50,90,50,90,40,70,40,70,60,90,60,90,50,1,85,50,75,50,1,80,45,80,55"104 neuro: id=*,name="Constant",info="Constant value",inputs=0,output=1,location=0 ,vhints=1 ,symbol="4,4,26,27,26,73,73,73,73,27,26,27,1,73,50,100,50,1,56,68,46,68,2,41,47,51,32,51,68" 104 105 105 106 … … 119 120 120 121 121 neuro: id=D,name="Differentiate",info="Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights",inputs=-1,output=1,location=0 122 neuro: id=D,name="Differentiate",info="Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights",inputs=-1,output=1,location=0 ,symbol="3,3,25,0,25,100,75,50,25,0,1,75,50,100,50,3,44,42,51,57,36,57,44,42" 122 123 123 124 124 neuro: id=Fuzzy,name="Fuzzy system [EXPERIMENTAL!]",info="Refer to publications to learn about this neuron",inputs=-1,output=1,location=0 ,symbol="5,2,30,65,37,37,44,65,3,37,65,44,37,51,37,58,65,2,51,65,58,37,65,65,6,100,50,70,50,70,25,25,10,25,90,70,75,70,50,1,70,65,25,65" 125 126 neuro: id=Fuzzy,name="Fuzzy system [EXPERIMENTAL!]",info="Refer to publications to learn more about this neuron.",inputs=-1,output=1,location=0 ,symbol="5,2,30,65,37,37,44,65,3,37,65,44,37,51,37,58,65,2,51,65,58,37,65,65,6,100,50,70,50,70,25,25,10,25,90,70,75,70,50,1,70,65,25,65" 125 127 126 128 prop:id=ns,name="number of fuzzy sets",type="d 1 " … … 130 132 131 133 132 neuro: id=VEye,name="Vector Eye [EXPERIMENTAL!]",info="",inputs=1,output=1,location=1 ,symbol="11,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,14,70,50,65,40,60,35,45,30,30,30,15,35,10,40,5,50,10,60,15,65,30,70,45,70,60,65,65,60,70,50,8,38,67,28,62,23,52,28,42,38,37,48,42,53,52,48,62,38,67,4,33,52,38,47,43,52,38,57,33,52,5,70,50,60,40,45,35,30,35,15,40,5,50,1,53,33,58,22,1,62,36,68,26,1,45,30,47,19,1,35,30,35,19,1,27,31,24,20,1,18,34,12,24" 133 134 prop:id=tx,name="target.x",type="f " 135 prop:id=ty,name="target.y",type="f " 136 prop:id=tz,name="target.z",type="f " 137 prop:id=ts,name="target shape",type="s 0 -1 0" 138 prop:id=p,name="perspective",type="f 0.1 10.0 1.0" 139 prop:id=s,name="scale",type="f 0.1 100.0 1.0" 140 prop:id=h,name="show hidden lines",type="d 0 1 0" 141 prop:id=o,name="output lines count (each line needs four channels)",type="d 0 99 0" 142 prop:id=d,name="debug",type="d 0 1 0" 143 144 145 neuro: id=VMotor,name="Visual-Motor Cortex [EXPERIMENTAL!]",info="Must be connected to the VEye and properly set up.",inputs=-1,output=1,location=0 146 prop:id=noIF,name="number of basic features",type="d " 147 prop:id=noDim,name="number of degrees of freedom",type="d " 148 prop:id=params,name="parameters",type="s " 149 150 151 neuro: id=Sti,name="Sticky [EXPERIMENTAL!]",info="",inputs=1,output=0,location=1 ,vhints=32 134 neuro: id=Sti,name="Sticky [EXPERIMENTAL!]",info="",inputs=1,output=0,location=1 ,vhints=16 152 135 153 136 154 137 155 neuro: id=LMu,name="L engthmuscle [EXPERIMENTAL!]",info="",inputs=1,output=0,location=2 ,vhints=16138 neuro: id=LMu,name="Linear muscle [EXPERIMENTAL!]",info="",inputs=1,output=0,location=2 ,vhints=16 156 139 157 140 prop:id=p,name="power",type="f 0.01 1.0 1.0" … … 166 149 167 150 168 neuro: id=Ch,name="Channelize",info="Combines all input signals into a single multichannel output; Note: ChSel and ChMux are the only neurons which support multiple channels. Other neurons discard everything except the first channel.",inputs=-1,output=1,location=0 151 neuro: id=Ch,name="Channelize",info="Combines all input signals into a single multichannel output; Note: ChSel and ChMux are the only neurons which support multiple channels. Other neurons discard everything except the first channel.",inputs=-1,output=1,location=0 ,symbol="10,4,25,0,25,100,75,70,75,30,25,0,1,75,50,100,50,1,70,50,55,50,1,30,80,55,50,1,30,20,55,50,1,30,35,55,50,1,30,45,55,50,1,30,55,55,50,1,61,53,65,47,1,30,65,55,50" 169 152 170 153 171 neuro: id=ChMux,name="Channel multiplexer",info="Outputs the selected channel from the second (multichannel) input. The first input is used as the selector value (-1=select first channel, .., 1=last channel)",inputs=2,output=1,location=0 154 155 neuro: id=ChMux,name="Channel multiplexer",info="Outputs the selected channel from the second (multichannel) input. The first input is used as the selector value (-1=select first channel, .., 1=last channel)",inputs=2,output=1,location=0 ,symbol="7,4,25,0,25,100,75,70,75,30,25,0,1,75,50,100,50,1,70,50,55,50,3,50,55,55,50,50,45,50,55,3,30,67,45,67,45,50,50,50,1,35,70,39,64,2,30,33,53,33,53,48" 172 156 173 157 174 neuro: id=ChSel,name="Channel selector",info="Outputs a single channel (selected by the \"ch\" parameter) from multichannel input",inputs=1,output=1,location=0 158 159 neuro: id=ChSel,name="Channel selector",info="Outputs a single channel (selected by the \"ch\" parameter) from multichannel input",inputs=1,output=1,location=0 ,symbol="6,4,25,0,25,100,75,70,75,30,25,0,1,75,50,100,50,1,70,50,55,50,3,50,55,55,50,50,45,50,55,1,30,50,50,50,1,35,53,39,47" 160 175 161 prop:id=ch,name="channel",type="d " 176 162 -
cpp/gdk/modelparts.cpp
r66 r69 22 22 #include "extvalue.h" 23 23 24 #ifndef GDK_WITHOUT_FRAMS 24 25 #include "neuroclsobject.h" 26 #endif 25 27 26 28 template<> … … 528 530 void Neuro::get_classObject(PARAMGETARGS) 529 531 { 532 #ifndef GDK_WITHOUT_FRAMS 530 533 NeuroClassExt::makeStaticObject(ret,getClass()); 534 #endif 531 535 } 532 536 -
cpp/gdk/neurocls-factory.h
r66 r69 83 83 #undef FIELDSTRUCT 84 84 85 #define FIELDSTRUCT NI_VectorEye86 ParamEntry NI_VectorEye_tab []={87 {"Vector Eye [EXPERIMENTAL!]",1, 9 ,"VEye",},88 {"tx",0,0,"target.x","f ",FIELD(target.x),},89 {"ty",0,0,"target.y","f ",FIELD(target.y),},90 {"tz",0,0,"target.z","f ",FIELD(target.z),},91 {"ts",0,0,"target shape","s 0 -1 0",FIELD(targetShape),},92 {"p",0,0,"perspective","f 0.1 10.0 1.0",FIELD(perspz),},93 {"s",0,0,"scale","f 0.1 100.0 1.0",FIELD(perspscale),},94 {"h",0,0,"show hidden lines","d 0 1 0",FIELD(showhidden),},95 {"o",0,0,"output lines count (each line needs four channels)","d 0 99 0",FIELD(outputcount),},96 {"d",0,0,"debug","d 0 1 0",FIELD(showdebug),},97 {0,0,0,},};98 #undef FIELDSTRUCT99 100 #define FIELDSTRUCT NI_VisualMotorNeuron101 ParamEntry NI_VisualMotorNeuron_tab []={102 {"Visual-Motor Cortex [EXPERIMENTAL!]",1, 3 ,"VMotor",},103 {"noIF",0,0,"number of basic features","d ",FIELD(noIF),},104 {"noDim",0,0,"number of degrees of freedom","d ",FIELD(noDim),},105 {"params",0,0,"parameters","s ",FIELD(params),},106 {0,0,0,},};107 #undef FIELDSTRUCT108 109 85 #define FIELDSTRUCT NI_Sticky 110 86 ParamEntry NI_Sticky_tab []={ … … 165 141 #undef FIELDSTRUCT 166 142 167 168 143 #define SETIMPLEMENTATION \ 169 144 setImplementation("N",new NI_StdNeuron); \ … … 177 152 setImplementation("D",new NI_Diff); \ 178 153 setImplementation("Fuzzy",new NI_FuzzyNeuro); \ 179 setImplementation("VEye",new NI_VectorEye); \180 setImplementation("VMotor",new NI_VisualMotorNeuron); \181 154 setImplementation("Sti",new NI_Sticky); \ 182 155 setImplementation("LMu",new NI_LinearMuscle); \ -
cpp/gdk/neurocls-library.h
r66 r69 108 108 addClass(new NeuroClass(NI_FuzzyNeuro_tab,"Refer to publications to learn more about this neuron.",-1,1,0, FuzzyNeuro_xy,0,0)); 109 109 110 static int VectorEye_xy[]={122,11,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,14,70,50,65,40,60,35,45,30,30,30,15,35,10,40,5,50,10,60,15,65,30,70,45,70,60,65,65,60,70,50,8,38,67,28,62,23,52,28,42,38,37,48,42,53,52,48,62,38,67,4,33,52,38,47,43,52,38,57,33,52,5,70,50,60,40,45,35,30,35,15,40,5,50,1,53,33,58,22,1,62,36,68,26,1,45,30,47,19,1,35,30,35,19,1,27,31,24,20,1,18,34,12,24};111 static ParamEntry NI_VectorEye_tab[]={112 {"Vector Eye [EXPERIMENTAL!]",1, 9 ,"VEye",},113 114 {"tx",0,0,"target.x","f ",},115 {"ty",0,0,"target.y","f ",},116 {"tz",0,0,"target.z","f ",},117 {"ts",0,0,"target shape","s 0 -1 0",},118 {"p",0,0,"perspective","f 0.1 10.0 1.0",},119 {"s",0,0,"scale","f 0.1 100.0 1.0",},120 {"h",0,0,"show hidden lines","d 0 1 0",},121 {"o",0,0,"output lines count (each line needs four channels)","d 0 99 0",},122 {"d",0,0,"debug","d 0 1 0",},123 124 {0,0,0,},};125 addClass(new NeuroClass(NI_VectorEye_tab,"Refer to publications to learn more about this neuron.",1,1,1, VectorEye_xy,0,0));126 127 128 static ParamEntry NI_VisualMotorNeuron_tab[]={129 {"Visual-Motor Cortex [EXPERIMENTAL!]",1, 3 ,"VMotor",},130 {"noIF",0,0,"number of basic features","d ",},131 {"noDim",0,0,"number of degrees of freedom","d ",},132 {"params",0,0,"parameters","s ",},133 134 {0,0,0,},};135 addClass(new NeuroClass(NI_VisualMotorNeuron_tab,"Must be connected to the VEye and properly set up. Refer to publications to learn more about this neuron.",-1,1,0, 0,0));136 137 110 138 111 static ParamEntry NI_Sticky_tab[]={ … … 209 182 {0,0,0,},}; 210 183 addClass(new NeuroClass(NI_Sinus_tab,"Output frequency = f0+input",1,1,0, Sinus_xy,0,0)); 211 -
cpp/gdk/neuroimpl-body-gdk.h
r66 r69 16 16 }; 17 17 18 extern ParamEntry NI_Touch_tab[]; 18 19 class NI_Touch: public NeuroImpl 19 20 { 20 21 public: 22 double range; 21 23 NeuroImpl* makeNew(){return new NI_Touch();} // for NeuroFactory 22 24 int lateinit() {if (!neuro->part) return 0; simorder=0; return 1;} 23 25 void go() {setState(0);} 26 NI_Touch():range(1) {paramentries=NI_Touch_tab;} 24 27 }; 25 28 -
cpp/gdk/neuroimpl.cpp
r68 r69 5 5 #include "neuroimpl.h" 6 6 #include "neurofactory.h" 7 #ifdef NOCREATUREOBJECT 8 #include "neuroclsobject.h" 9 #else 7 #ifndef GDK_WITHOUT_FRAMS 10 8 #include "creature.h" 11 9 #include "creatmechobj.h" … … 446 444 Creature* NeuroImpl::getCreature() 447 445 { 448 #ifndef NOCREATUREOBJECT446 #ifndef GDK_WITHOUT_FRAMS 449 447 CreatMechObject *cmo=(CreatMechObject *)neuro->owner->userdata[CreatMechObject::modeltags_id]; 450 448 return cmo->creature; … … 456 454 void NeuroImpl::get_creature(ExtValue *ret) 457 455 { 458 #ifndef NOCREATUREOBJECT456 #ifndef GDK_WITHOUT_FRAMS 459 457 ret->setObject(ExtObject(&creature_param,getCreature())); 460 458 #endif … … 463 461 void NeuroImpl::get_part(ExtValue *ret) 464 462 { 465 #ifndef NOCREATUREOBJECT463 #ifndef GDK_WITHOUT_FRAMS 466 464 Part *pa; 467 465 if (pa=neuro->getPart()) … … 474 472 void NeuroImpl::get_joint(ExtValue *ret) 475 473 { 476 #ifndef NOCREATUREOBJECT474 #ifndef GDK_WITHOUT_FRAMS 477 475 Joint *jo; 478 476 if (jo=neuro->getJoint()) … … 485 483 bool NeuroImpl::getPosition(Pt3D &pos) 486 484 { 487 #ifndef NOCREATUREOBJECT485 #ifndef GDK_WITHOUT_FRAMS 488 486 Part *pa; Joint *jo; 489 487 if (pa=neuro->getPart()) … … 531 529 void NeuroImpl::get_classObject(ExtValue *ret) 532 530 { 531 #ifndef GDK_WITHOUT_FRAMS 533 532 NeuroClassExt::makeStaticObject(ret,neuroclass); 533 #endif 534 534 } 535 535 -
cpp/gdk/neuroimplfiles.h
r66 r69 6 6 #include "neuroimpl-channels.h" 7 7 #include "neuroimpl-fuzzy.h" 8 #ifdef GDK_WITHOUT_FRAMS 8 9 #include "neuroimpl-body-gdk.h" 10 #else 11 #include "neuroimpl-test.h" 12 #include "neuroimpl-body.h" 13 #include "neuroimpl-vectoreye.h" 14 #include "neuroimpl-vmot.hpp" 15 #endif 16 -
cpp/gdk/neurotest.cpp
r66 r69 19 19 DefaultGenoConvManager gcm; //without this object the application would only handle "format 0" genotypes 20 20 21 #ifndef NOCREATUREOBJECT21 #ifndef GDK_WITHOUT_FRAMS 22 22 #include "creatmechobj.h" 23 23 int CreatMechObject::modeltags_id=0; -
cpp/gdk/nonstd.h
r68 r69 49 49 #define PATHSEPARATORCHAR '/' 50 50 #define PATHSEPARATORSTRING "/" 51 #define FOPEN_READ "r" 52 #define FOPEN_WRITE "w" 53 #define FOPEN_APPEND "a" 51 54 #endif 52 55
Note: See TracChangeset
for help on using the changeset viewer.