Changeset 80
- Timestamp:
- 02/08/13 03:22:37 (12 years ago)
- Location:
- cpp/gdk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/gdk/3d.cpp
r68 r80 3 3 // Refer to http://www.framsticks.com/ for further information. 4 4 5 #include "nonstd.h" 6 #include <math.h> 7 #include <string.h> 5 #include "nonstd_math.h" 6 #include "framsg.h" 8 7 #include "3d.h" 9 #include "framsg.h"10 8 11 9 Pt3D operator+(const Pt3D &p1,const Pt3D &p2) {return Pt3D(p1.x+p2.x,p1.y+p2.y,p1.z+p2.z);} -
cpp/gdk/3d.h
r66 r80 6 6 #define _3D_H_ 7 7 8 #include <memory.h> 8 #ifdef SHP 9 #include <string.h> //memcpy 10 #else 11 #include <memory.h> //memcpy 12 #endif 9 13 10 14 /********************************** … … 49 53 double operator()() const; 50 54 /** vector length = \f$\sqrt{x^2+y^2+z^2}\f$ */ 51 double length() const {return operator()();} 55 double length() const {return operator()();} 56 double length2() const {return x*x+y*y+z*z;} 52 57 double distanceTo(const Pt3D& p) const; 53 58 double manhattanDistanceTo(const Pt3D& p) const; … … 131 136 132 137 #endif 133 -
cpp/gdk/conv_f1.cpp
r66 r80 4 4 5 5 #include "conv_f1.h" 6 #include "nonstd .h"6 #include "nonstd_stl.h" 7 7 #include "framsg.h" 8 8 #include "multirange.h" … … 12 12 //#define v1f1COMPATIBLE 13 13 14 F1Props stdprops={1, 0, 1, 0.4, 0.25, 0.25, 0.25, 0.25, 0.0, 1.0, 1.0, 1 }; 14 F1Props stdprops={1, 0, 1, 0.4, 0.25, 0.25, 0.25, 0.25, 0.0, 1.0, 1.0, 1, 15 0.2, 0.5,0.5,0.5 }; 15 16 16 17 class Builder … … 141 142 case 'E': c.energ+=(10.0-c.energ)*0.1; break; 142 143 case 'e': c.energ-=c.energ*0.1; break; 144 145 case 'D': c.cred+=(1.0-c.cred)*0.25;break; 146 case 'd': c.cred+=(0.0-c.cred)*0.25;break; 147 case 'G': c.cgreen+=(1.0-c.cgreen)*0.25;break; 148 case 'g': c.cgreen+=(0.0-c.cgreen)*0.25;break; 149 case 'B': c.cblue+=(1.0-c.cblue)*0.25;break; 150 case 'b': c.cblue+=(0.0-c.cblue)*0.25;break; 151 case 'H': c.grub+=(0.7-c.grub)*0.25;break; 152 case 'h': c.grub+=(0.05-c.grub)*0.25;break; 153 143 154 case '[': //neuron 144 155 // setdebug(g-(char*)geny,DEBUGNEURO | !l_neu); … … 181 192 // oslabianie cech wzdluz struktury 182 193 c.dlug=0.5*c.dlug+0.5*stdprops.dlug; 194 c.grub=0.5*c.grub+0.5*stdprops.grub; 183 195 c.skr=0.66*c.skr; 184 196 c.rot=0.66*c.rot; … … 251 263 { 252 264 double len=min(2.0,c.dlug); 253 sprintf(tmp,"j:p1=%ld,p2=%ld,dx=%lg,rx=%lg,ry=%lg,rz=%lg,stam=%lg ",254 part1,part2,len,angle.x,angle.y,angle.z,c.odpor );265 sprintf(tmp,"j:p1=%ld,p2=%ld,dx=%lg,rx=%lg,ry=%lg,rz=%lg,stam=%lg,vr=%g,vg=%g,vb=%g", 266 part1,part2,len,angle.x,angle.y,angle.z,c.odpor, c.cred,c.cgreen,c.cblue); 255 267 lastjoint_muscle_power=c.ruch; 256 268 return model.singleStepBuild(tmp,makeRange(g)); … … 259 271 int Builder::growPart(F1Props &c,const char *g) 260 272 { 261 sprintf(tmp,"p:m=1,dn=%lg,fr=%lg,ing=%lg,as=%lg ",262 1.0/c.masa,c.tarcie,c.wchl,c.asym );273 sprintf(tmp,"p:m=1,dn=%lg,fr=%lg,ing=%lg,as=%lg,vs=%g,vr=%g,vg=%g,vb=%g", 274 1.0/c.masa,c.tarcie,c.wchl,c.asym, c.grub, c.cred,c.cgreen,c.cblue); 263 275 return model.singleStepBuild(tmp,makeRange(g)); 264 276 } -
cpp/gdk/conv_f1.h
r66 r80 14 14 double bendrange; 15 15 int resetrange; 16 double grub,cred,cgreen,cblue; 16 17 void wykluczanie(); 17 18 }; -
cpp/gdk/defassign-f0_joint.h
r69 r80 1 1 2 2 3 … … 12 13 stamina=0.25; 13 14 vis_style="joint"; 15 vcolor.x=0.5; 16 vcolor.y=0.5; 17 vcolor.z=0.5; 14 18 15 19 … … 37 41 38 42 43 44 45 -
cpp/gdk/defassign-f0_neuro.h
r69 r80 1 1 2 2 3 … … 9 10 part_refno=-1; 10 11 joint_refno=-1; 12 11 13 vis_style="neuro"; 12 14 … … 31 33 32 34 35 36 37 -
cpp/gdk/defassign-f0_neuroconn.h
r69 r80 1 1 2 2 3 … … 31 32 32 33 34 35 36 -
cpp/gdk/defassign-f0_part.h
r69 r80 1 1 2 2 3 // default assignments for Part : … … 8 9 assim=0.25; 9 10 vis_style="part"; 11 vsize=0.2; 12 vcolor.x=0.5; 13 vcolor.y=0.5; 14 vcolor.z=0.5; 10 15 11 16 … … 35 40 36 41 42 43 44 -
cpp/gdk/f0.def
r69 r80 1 CLASS(Model,f0_model,m) 2 GROUP(Properties) 3 GROUP(Visual) 4 PROP(se,0,1024,startenergy,f,,,,startenergy) 5 PROP(Vstyle,1,0,vis_style,s,0,-1,,vis_style) 6 ENDCLASS 7 1 8 CLASS(Part,f0_part,p) 2 9 GROUP(Geometry) … … 17 24 PROP(i,1,0,`info',s,,,,info) 18 25 PROP(Vstyle,2,0,vis_style,s,0,-1,part,vis_style) 26 XPROP(vs,2,0,visual thickness,f,0.05,0.7,0.2,vsize) 27 XPROP(vr,2,0,red component,f,0.0,1.0,0.5,vcolor.x) 28 XPROP(vg,2,1024,green component,f,0.0,1.0,0.5,vcolor.y) 29 XPROP(vb,2,1024,blue component,f,0.0,1.0,0.5,vcolor.z) 19 30 ENDCLASS 20 31 … … 37 48 PROP(i,2,0,`info',s,,,,info) 38 49 PROP(Vstyle,3,0,vis_style,s,0,-1,joint,vis_style) 50 XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x) 51 XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y) 52 XPROP(vb,3,1024,blue component,f,0.0,1.0,0.5,vcolor.z) 39 53 ENDCLASS 40 54 … … 51 65 PROP(i,2,0,`info',s,,,,info) 52 66 PROP(Vstyle,3,0,vis_style,s,0,-1,joint,vis_style) 67 XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x) 68 XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y) 69 XPROP(vb,3,1024,blue component,f,0.0,1.0,0.5,vcolor.z) 53 70 ENDCLASS 54 71 … … 59 76 PROP(p,0,0,`part ref#',d,-1,999999,-1,part_refno) 60 77 PROP(j,0,0,`joint ref#',d,-1,999999,-1,joint_refno) 61 PROP(d,1,0,item details,s,,, ,details,GETSET)78 PROP(d,1,0,item details,s,,,N,details,GETSET) 62 79 PROP(i,1,0,`info',s,,,,info) 63 80 PROP(Vstyle,2,0,vis_style,s,0,-1,neuro,vis_style) … … 139 156 ENDNEUROCLASS 140 157 158 NEUROCLASS(VectorEye,VEye,Vector Eye [EXPERIMENTAL!],Refer to publications to learn more about this neuron.,1,1,1) 159 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') 160 NEUROPROP(tx,0,0,target.x,f,,,,target.x) 161 NEUROPROP(ty,0,0,target.y,f,,,,target.y) 162 NEUROPROP(tz,0,0,target.z,f,,,,target.z) 163 NEUROPROP(ts,0,0,target shape,s,0,-1,0,targetShape) 164 NEUROPROP(p,0,0,perspective,f,0.1,10.0,1.0,perspz) 165 NEUROPROP(s,0,0,scale,f,0.1,100.0,1.0,perspscale) 166 NEUROPROP(h,0,0,show hidden lines,d,0,1,0,showhidden) 167 NEUROPROP(o,0,0,`output lines count (each line needs four channels)',d,0,99,0,outputcount) 168 NEUROPROP(d,0,0,debug,d,0,1,0,showdebug) 169 ENDNEUROCLASS 170 171 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) 172 NEUROPROP(noIF,0,0,number of basic features,d,,,,noIF) 173 NEUROPROP(noDim,0,0,number of degrees of freedom,d,,,,noDim) 174 NEUROPROP(params,0,0,parameters,s,,,,params) 175 ENDNEUROCLASS 176 141 177 NEUROCLASS(Sticky,Sti,Sticky [EXPERIMENTAL!],,1,0,1) 142 178 VISUALHINTS(EffectorClass) … … 177 213 NEUROPROP(t,0,0,time,f,0,6.283185307,0,t) 178 214 ENDNEUROCLASS 215 -
cpp/gdk/f0classes.h
r69 r80 1 1 2 2 3 #define FIELDSTRUCT Part 3 4 ParamEntry f0_part_paramtab[]= 4 5 { 5 {"Geometry",3,1 4,"p" },6 {"Geometry",3,18,"p" }, 6 7 {"Other properties",}, 7 8 {"Visual",}, … … 20 21 {"i",1,0,"info","s",FIELD(info),}, 21 22 {"Vstyle",2,0,"vis_style","s 0 -1 part",FIELD(vis_style),}, 23 {"vs",2,0,"visual thickness","f 0.05 0.7 0.2",FIELD(vsize),}, 24 {"vr",2,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),}, 25 {"vg",2,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),}, 26 {"vb",2,1024,"blue component","f 0.0 1.0 0.5",FIELD(vcolor.z),}, 22 27 {0,0,0,} 23 28 }; 24 29 ParamEntry f0_part_xtra_paramtab[]= 25 30 { 26 {"Extra properties",1, 5,"p"},31 {"Extra properties",1,9,"p"}, 27 32 {"m",0,0,"mass","f 0.1 999.0 1.0",FIELD(mass),}, 28 33 {"dn",0,0,"density","f 0.2 5.0 1.0",FIELD(density),}, … … 30 35 {"ing",0,0,"ingestion","f 0.0 1.0 0.25",FIELD(ingest),}, 31 36 {"as",0,0,"assimilation","f 0.0 1.0 0.25",FIELD(assim),}, 37 {"vs",0,0,"visual thickness","f 0.05 0.7 0.2",FIELD(vsize),}, 38 {"vr",0,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),}, 39 {"vg",0,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),}, 40 {"vb",0,1024,"blue component","f 0.0 1.0 0.5",FIELD(vcolor.z),}, 32 41 {0,0,0,} 33 42 }; … … 38 47 ParamEntry f0_joint_paramtab[]= 39 48 { 40 {"Connections",4,1 3,"j" },49 {"Connections",4,16,"j" }, 41 50 {"Geometry",}, 42 51 {"Other properties",}, … … 55 64 {"i",2,0,"info","s",FIELD(info),}, 56 65 {"Vstyle",3,0,"vis_style","s 0 -1 joint",FIELD(vis_style),}, 66 {"vr",3,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),}, 67 {"vg",3,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),}, 68 {"vb",3,1024,"blue component","f 0.0 1.0 0.5",FIELD(vcolor.z),}, 57 69 {0,0,0,} 58 70 }; 59 71 ParamEntry f0_joint_xtra_paramtab[]= 60 72 { 61 {"Extra properties",1, 2,"j"},73 {"Extra properties",1,5,"j"}, 62 74 {"stif",0,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),}, 63 75 {"rotstif",0,0,"rotation stiffness","f 0.0 1.0 1.0",FIELD(rotstif),}, 76 {"vr",0,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),}, 77 {"vg",0,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),}, 78 {"vb",0,1024,"blue component","f 0.0 1.0 0.5",FIELD(vcolor.z),}, 64 79 {0,0,0,} 65 80 }; … … 70 85 ParamEntry f0_nodeltajoint_paramtab[]= 71 86 { 72 {"Connections",4, 7,"j" },87 {"Connections",4,10,"j" }, 73 88 {"Geometry",}, 74 89 {"Other properties",}, … … 81 96 {"i",2,0,"info","s",FIELD(info),}, 82 97 {"Vstyle",3,0,"vis_style","s 0 -1 joint",FIELD(vis_style),}, 98 {"vr",3,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),}, 99 {"vg",3,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),}, 100 {"vb",3,1024,"blue component","f 0.0 1.0 0.5",FIELD(vcolor.z),}, 83 101 {0,0,0,} 84 102 }; 85 103 ParamEntry f0_nodeltajoint_xtra_paramtab[]= 86 104 { 87 {"Extra properties",1, 2,"j"},105 {"Extra properties",1,5,"j"}, 88 106 {"stif",0,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),}, 89 107 {"rotstif",0,0,"rotation stiffness","f 0.0 1.0 1.0",FIELD(rotstif),}, 108 {"vr",0,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),}, 109 {"vg",0,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),}, 110 {"vb",0,1024,"blue component","f 0.0 1.0 0.5",FIELD(vcolor.z),}, 90 111 {0,0,0,} 91 112 }; … … 156 177 157 178 179 180 181 -
cpp/gdk/f0def.xml
r69 r80 1 1 <!DOCTYPE F0CLASSES> 2 2 <F0CLASSES> 3 4 <CLASS ID="m" NAME="Model"> 5 <GROUP NAME="Properties" /> 6 <GROUP NAME="Visual" /> 7 <PROP ID="se" NAME="startenergy" GROUP="0" FLAGS="1024" TYPE="f" /> 8 <PROP ID="Vstyle" NAME="vis_style" GROUP="1" FLAGS="0" TYPE="s" MIN="0" MAX="-1" /> 9 </CLASS> 3 10 4 11 <CLASS ID="p" NAME="Part"> … … 20 27 <PROP ID="i" NAME="info" GROUP="1" FLAGS="0" TYPE="s" /> 21 28 <PROP ID="Vstyle" NAME="vis_style" GROUP="2" FLAGS="0" TYPE="s" MIN="0" MAX="-1" DEF="part" /> 29 <PROP ID="vs" XTRA="1" NAME="visual thickness" GROUP="2" FLAGS="0" TYPE="f" MIN="0.05" MAX="0.7" DEF="0.2" /> 30 <PROP ID="vr" XTRA="1" NAME="red component" GROUP="2" FLAGS="0" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.5" /> 31 <PROP ID="vg" XTRA="1" NAME="green component" GROUP="2" FLAGS="1024" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.5" /> 32 <PROP ID="vb" XTRA="1" NAME="blue component" GROUP="2" FLAGS="1024" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.5" /> 22 33 </CLASS> 23 34 … … 40 51 <PROP ID="i" NAME="info" GROUP="2" FLAGS="0" TYPE="s" /> 41 52 <PROP ID="Vstyle" NAME="vis_style" GROUP="3" FLAGS="0" TYPE="s" MIN="0" MAX="-1" DEF="joint" /> 53 <PROP ID="vr" XTRA="1" NAME="red component" GROUP="3" FLAGS="0" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.5" /> 54 <PROP ID="vg" XTRA="1" NAME="green component" GROUP="3" FLAGS="1024" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.5" /> 55 <PROP ID="vb" XTRA="1" NAME="blue component" GROUP="3" FLAGS="1024" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.5" /> 42 56 </CLASS> 43 57 … … 50 64 <PROP ID="p" NAME="part ref#" GROUP="0" FLAGS="0" TYPE="d" MIN="-1" MAX="999999" DEF="-1" /> 51 65 <PROP ID="j" NAME="joint ref#" GROUP="0" FLAGS="0" TYPE="d" MIN="-1" MAX="999999" DEF="-1" /> 52 <PROP ID="d" NAME="item details" GROUP="1" FLAGS="0" TYPE="s" />66 <PROP ID="d" NAME="item details" GROUP="1" FLAGS="0" TYPE="s" DEF="N" /> 53 67 <PROP ID="i" NAME="info" GROUP="1" FLAGS="0" TYPE="s" /> 54 68 <PROP ID="Vstyle" NAME="vis_style" GROUP="2" FLAGS="0" TYPE="s" MIN="0" MAX="-1" DEF="neuro" /> … … 77 91 </NEUROCLASS> 78 92 79 <NEUROCLASS ID="Nu" NAME="Unipolar neuron [EXPERIMENTAL!]" DESCRIPTION="Works like standard neuron (N) but the output value is scaled to 0...+1 instead of -1...+1.\nHaving 0 as one of the saturation states should help in \"gate circuits\", where input signal is passed through or blocked depending on the other singal." INPUTS="-1" OUTPUT="1" LOCATION="0" >93 <NEUROCLASS ID="Nu" NAME="Unipolar neuron [EXPERIMENTAL!]" DESCRIPTION="Works like standard neuron (N) but the output value is scaled to 0...+1 instead of -1...+1.\nHaving 0 as one of the saturation states should help in "gate circuits", where input signal is passed through or blocked depending on the other singal." INPUTS="-1" OUTPUT="1" LOCATION="0" > 80 94 <NEUROPROP ID="in" NAME="Inertia" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.8" /> 81 95 <NEUROPROP ID="fo" NAME="Force" TYPE="f" MIN="0.0" MAX="999.0" DEF="0.04" /> … … 95 109 </NEUROCLASS> 96 110 97 <NEUROCLASS ID="S" NAME="Smell" DESCRIPTION="Smell sensor. Aggregated \"smell of energy\"experienced from all energy objects (creatures and food pieces).\nClose objects have bigger influence than the distant ones: for each energy source, its partial feeling is proportional to its energy/(distance^2)" INPUTS="0" OUTPUT="1" LOCATION="1" VISUALHINTS="32" SYMBOL="5,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,3,10,40,15,45,15,55,10,60,5,20,30,25,35,30,45,30,55,25,65,20,70,4,15,35,20,40,22,50,20,60,15,65,5,75,50,50,50,45,45,40,50,45,55,50,50" >111 <NEUROCLASS ID="S" NAME="Smell" DESCRIPTION="Smell sensor. Aggregated "smell of energy" experienced from all energy objects (creatures and food pieces).\nClose objects have bigger influence than the distant ones: for each energy source, its partial feeling is proportional to its energy/(distance^2)" INPUTS="0" OUTPUT="1" LOCATION="1" VISUALHINTS="32" SYMBOL="5,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,3,10,40,15,45,15,55,10,60,5,20,30,25,35,30,45,30,55,25,65,20,70,4,15,35,20,40,22,50,20,60,15,65,5,75,50,50,50,45,45,40,50,45,55,50,50" > 98 112 99 113 … … 130 144 </NEUROCLASS> 131 145 146 <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" > 147 148 <NEUROPROP ID="tx" NAME="target.x" TYPE="f" MIN="" MAX="" DEF="" /> 149 <NEUROPROP ID="ty" NAME="target.y" TYPE="f" MIN="" MAX="" DEF="" /> 150 <NEUROPROP ID="tz" NAME="target.z" TYPE="f" MIN="" MAX="" DEF="" /> 151 <NEUROPROP ID="ts" NAME="target shape" TYPE="s" MIN="0" MAX="-1" DEF="0" /> 152 <NEUROPROP ID="p" NAME="perspective" TYPE="f" MIN="0.1" MAX="10.0" DEF="1.0" /> 153 <NEUROPROP ID="s" NAME="scale" TYPE="f" MIN="0.1" MAX="100.0" DEF="1.0" /> 154 <NEUROPROP ID="h" NAME="show hidden lines" TYPE="d" MIN="0" MAX="1" DEF="0" /> 155 <NEUROPROP ID="o" NAME="output lines count (each line needs four channels)" TYPE="d" MIN="0" MAX="99" DEF="0" /> 156 <NEUROPROP ID="d" NAME="debug" TYPE="d" MIN="0" MAX="1" DEF="0" /> 157 </NEUROCLASS> 158 159 <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" > 160 <NEUROPROP ID="noIF" NAME="number of basic features" TYPE="d" MIN="" MAX="" DEF="" /> 161 <NEUROPROP ID="noDim" NAME="number of degrees of freedom" TYPE="d" MIN="" MAX="" DEF="" /> 162 <NEUROPROP ID="params" NAME="parameters" TYPE="s" MIN="" MAX="" DEF="" /> 163 </NEUROCLASS> 164 132 165 <NEUROCLASS ID="Sti" NAME="Sticky [EXPERIMENTAL!]" DESCRIPTION="" INPUTS="1" OUTPUT="0" LOCATION="1" VISUALHINTS="16" > 133 166 … … 155 188 </NEUROCLASS> 156 189 157 <NEUROCLASS ID="ChSel" NAME="Channel selector" DESCRIPTION="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" >190 <NEUROCLASS ID="ChSel" NAME="Channel selector" DESCRIPTION="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" > 158 191 159 192 <NEUROPROP ID="ch" NAME="channel" TYPE="d" MIN="" MAX="" DEF="" /> … … 169 202 </NEUROCLASS> 170 203 204 171 205 </F0CLASSES> -
cpp/gdk/f0defxml.m4
r66 r80 15 15 define(`PROP',ZPROP(-,$@)) 16 16 define(`ZPROP', 17 ` <`PROP' ID="$2" ifelse($1,X,`XTRA="1" ')NAME="$5" `GROUP'="$3" FLAGS="$4" TYPE="$6" ifelse($7,,,MIN="$7" MAX="$8"DEF="$9" )/>')17 ` <`PROP' ID="$2" ifelse($1,X,`XTRA="1" ')NAME="$5" `GROUP'="$3" FLAGS="$4" TYPE="$6" ifelse($7,,,MIN="$7" )ifelse($8,,,MAX="$8" )ifelse($9,,,DEF="$9" )/>') 18 18 define(`GROUP',` <`GROUP' NAME="$1" />') 19 19 define(`ENDCLASS',` </`CLASS'>divert') 20 20 21 define(`NEUROCLASS',` <`NEUROCLASS' ID="$2" NAME="$3" DESCRIPTION=" $4" INPUTS="$5" OUTPUT="$6" LOCATION="$7" divert(2) >')21 define(`NEUROCLASS',` <`NEUROCLASS' ID="$2" NAME="$3" DESCRIPTION="patsubst(`$4',`\\\"',")" INPUTS="$5" OUTPUT="$6" LOCATION="$7" divert(2) >') 22 22 define(`VISUALHINTS',`divert `VISUALHINTS'="eval($1)" divert(2)') 23 23 define(`SYMBOL',`divert `SYMBOL'="$1" divert(2)') -
cpp/gdk/model.def
r69 r80 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 "62 61 63 62 … … 102 101 103 102 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"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" 105 104 106 105 … … 120 119 121 120 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"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 123 122 124 123 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" 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" 127 125 128 126 prop:id=ns,name="number of fuzzy sets",type="d 1 " … … 132 130 133 131 134 neuro: id=Sti,name="Sticky [EXPERIMENTAL!]",info="",inputs=1,output=0,location=1 ,vhints=16 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 135 152 136 153 137 154 138 neuro: id=LMu,name="L inearmuscle [EXPERIMENTAL!]",info="",inputs=1,output=0,location=2 ,vhints=16155 neuro: id=LMu,name="Length muscle [EXPERIMENTAL!]",info="",inputs=1,output=0,location=2 ,vhints=16 139 156 140 157 prop:id=p,name="power",type="f 0.01 1.0 1.0" … … 149 166 150 167 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"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 152 169 153 170 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" 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 156 172 157 173 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 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 161 175 prop:id=ch,name="channel",type="d " 162 176 -
cpp/gdk/neurocls-factory.h
r69 r80 2 2 // do not edit - generated automatically from "f0.def" 3 3 // (to be included in "neurofactory.cpp") 4 4 5 5 6 … … 83 84 #undef FIELDSTRUCT 84 85 86 #define FIELDSTRUCT NI_VectorEye 87 ParamEntry NI_VectorEye_tab []={ 88 {"Vector Eye [EXPERIMENTAL!]",1, 9 ,"VEye",}, 89 {"tx",0,0,"target.x","f ",FIELD(target.x),}, 90 {"ty",0,0,"target.y","f ",FIELD(target.y),}, 91 {"tz",0,0,"target.z","f ",FIELD(target.z),}, 92 {"ts",0,0,"target shape","s 0 -1 0",FIELD(targetShape),}, 93 {"p",0,0,"perspective","f 0.1 10.0 1.0",FIELD(perspz),}, 94 {"s",0,0,"scale","f 0.1 100.0 1.0",FIELD(perspscale),}, 95 {"h",0,0,"show hidden lines","d 0 1 0",FIELD(showhidden),}, 96 {"o",0,0,"output lines count (each line needs four channels)","d 0 99 0",FIELD(outputcount),}, 97 {"d",0,0,"debug","d 0 1 0",FIELD(showdebug),}, 98 {0,0,0,},}; 99 #undef FIELDSTRUCT 100 101 #define FIELDSTRUCT NI_VisualMotorNeuron 102 ParamEntry NI_VisualMotorNeuron_tab []={ 103 {"Visual-Motor Cortex [EXPERIMENTAL!]",1, 3 ,"VMotor",}, 104 {"noIF",0,0,"number of basic features","d ",FIELD(noIF),}, 105 {"noDim",0,0,"number of degrees of freedom","d ",FIELD(noDim),}, 106 {"params",0,0,"parameters","s ",FIELD(params),}, 107 {0,0,0,},}; 108 #undef FIELDSTRUCT 109 85 110 #define FIELDSTRUCT NI_Sticky 86 111 ParamEntry NI_Sticky_tab []={ … … 141 166 #undef FIELDSTRUCT 142 167 168 143 169 #define SETIMPLEMENTATION \ 144 170 setImplementation("N",new NI_StdNeuron); \ … … 152 178 setImplementation("D",new NI_Diff); \ 153 179 setImplementation("Fuzzy",new NI_FuzzyNeuro); \ 180 setImplementation("VEye",new NI_VectorEye); \ 181 setImplementation("VMotor",new NI_VisualMotorNeuron); \ 154 182 setImplementation("Sti",new NI_Sticky); \ 155 183 setImplementation("LMu",new NI_LinearMuscle); \ -
cpp/gdk/neurocls-library.h
r69 r80 2 2 // do not edit - generated automatically from "f0.def" 3 3 // (to be included in "neurolibrary.cpp") 4 4 5 5 6 … … 108 109 addClass(new NeuroClass(NI_FuzzyNeuro_tab,"Refer to publications to learn more about this neuron.",-1,1,0, FuzzyNeuro_xy,0,0)); 109 110 111 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}; 112 static ParamEntry NI_VectorEye_tab[]={ 113 {"Vector Eye [EXPERIMENTAL!]",1, 9 ,"VEye",}, 114 115 {"tx",0,0,"target.x","f ",}, 116 {"ty",0,0,"target.y","f ",}, 117 {"tz",0,0,"target.z","f ",}, 118 {"ts",0,0,"target shape","s 0 -1 0",}, 119 {"p",0,0,"perspective","f 0.1 10.0 1.0",}, 120 {"s",0,0,"scale","f 0.1 100.0 1.0",}, 121 {"h",0,0,"show hidden lines","d 0 1 0",}, 122 {"o",0,0,"output lines count (each line needs four channels)","d 0 99 0",}, 123 {"d",0,0,"debug","d 0 1 0",}, 124 125 {0,0,0,},}; 126 addClass(new NeuroClass(NI_VectorEye_tab,"Refer to publications to learn more about this neuron.",1,1,1, VectorEye_xy,0,0)); 127 128 129 static ParamEntry NI_VisualMotorNeuron_tab[]={ 130 {"Visual-Motor Cortex [EXPERIMENTAL!]",1, 3 ,"VMotor",}, 131 {"noIF",0,0,"number of basic features","d ",}, 132 {"noDim",0,0,"number of degrees of freedom","d ",}, 133 {"params",0,0,"parameters","s ",}, 134 135 {0,0,0,},}; 136 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)); 137 110 138 111 139 static ParamEntry NI_Sticky_tab[]={ … … 182 210 {0,0,0,},}; 183 211 addClass(new NeuroClass(NI_Sinus_tab,"Output frequency = f0+input",1,1,0, Sinus_xy,0,0)); 212
Note: See TracChangeset
for help on using the changeset viewer.