Changeset 80 for cpp


Ignore:
Timestamp:
02/08/13 03:22:37 (11 years ago)
Author:
Maciej Komosinski
Message:
  • new properties in Parts and Joints: visual red, green, blue, thickness
  • updated list of Neurons and their properties
Location:
cpp/gdk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • cpp/gdk/3d.cpp

    r68 r80  
    33// Refer to http://www.framsticks.com/ for further information.
    44
    5 #include "nonstd.h"
    6 #include <math.h>
    7 #include <string.h>
     5#include "nonstd_math.h"
     6#include "framsg.h"
    87#include "3d.h"
    9 #include "framsg.h"
    108
    119Pt3D 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  
    66#define _3D_H_
    77
    8 #include <memory.h>
     8#ifdef SHP
     9#include <string.h> //memcpy
     10#else
     11#include <memory.h> //memcpy
     12#endif
    913
    1014/**********************************
     
    4953double operator()() const;
    5054/** vector length = \f$\sqrt{x^2+y^2+z^2}\f$  */
    51 double length() const {return operator()();}
     55double length() const {return operator()();}
     56double length2() const {return x*x+y*y+z*z;}
    5257double distanceTo(const Pt3D& p) const;
    5358double manhattanDistanceTo(const Pt3D& p) const;
     
    131136
    132137#endif
    133 
  • cpp/gdk/conv_f1.cpp

    r66 r80  
    44
    55#include "conv_f1.h"
    6 #include "nonstd.h"
     6#include "nonstd_stl.h"
    77#include "framsg.h"
    88#include "multirange.h"
     
    1212//#define v1f1COMPATIBLE
    1313
    14 F1Props stdprops={1, 0, 1, 0.4, 0.25, 0.25, 0.25, 0.25, 0.0, 1.0, 1.0, 1 };
     14F1Props 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 };
    1516
    1617class Builder
     
    141142        case 'E': c.energ+=(10.0-c.energ)*0.1;  break;
    142143        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
    143154        case '[': //neuron
    144155//              setdebug(g-(char*)geny,DEBUGNEURO | !l_neu);
     
    181192                // oslabianie cech wzdluz struktury
    182193                c.dlug=0.5*c.dlug+0.5*stdprops.dlug;
     194                c.grub=0.5*c.grub+0.5*stdprops.grub;
    183195                c.skr=0.66*c.skr;
    184196                c.rot=0.66*c.rot;
     
    251263{
    252264double 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);
     265sprintf(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);
    255267lastjoint_muscle_power=c.ruch;
    256268return model.singleStepBuild(tmp,makeRange(g));
     
    259271int Builder::growPart(F1Props &c,const char *g)
    260272{
    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);
     273sprintf(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);
    263275return model.singleStepBuild(tmp,makeRange(g));
    264276}
  • cpp/gdk/conv_f1.h

    r66 r80  
    1414        double bendrange;
    1515        int resetrange;
     16        double grub,cred,cgreen,cblue;
    1617        void wykluczanie();
    1718};
  • cpp/gdk/defassign-f0_joint.h

    r69 r80  
     1
    12
    23
     
    1213stamina=0.25;
    1314vis_style="joint";
     15vcolor.x=0.5;
     16vcolor.y=0.5;
     17vcolor.z=0.5;
    1418
    1519
     
    3741
    3842
     43
     44
     45
  • cpp/gdk/defassign-f0_neuro.h

    r69 r80  
     1
    12
    23
     
    910part_refno=-1;
    1011joint_refno=-1;
     12
    1113vis_style="neuro";
    1214
     
    3133
    3234
     35
     36
     37
  • cpp/gdk/defassign-f0_neuroconn.h

    r69 r80  
     1
    12
    23
     
    3132
    3233
     34
     35
     36
  • cpp/gdk/defassign-f0_part.h

    r69 r80  
     1
    12
    23// default assignments for Part :
     
    89assim=0.25;
    910vis_style="part";
     11vsize=0.2;
     12vcolor.x=0.5;
     13vcolor.y=0.5;
     14vcolor.z=0.5;
    1015
    1116
     
    3540
    3641
     42
     43
     44
  • cpp/gdk/f0.def

    r69 r80  
     1CLASS(Model,f0_model,m)
     2GROUP(Properties)
     3GROUP(Visual)
     4PROP(se,0,1024,startenergy,f,,,,startenergy)
     5PROP(Vstyle,1,0,vis_style,s,0,-1,,vis_style)
     6ENDCLASS
     7
    18CLASS(Part,f0_part,p)
    29GROUP(Geometry)
     
    1724PROP(i,1,0,`info',s,,,,info)
    1825PROP(Vstyle,2,0,vis_style,s,0,-1,part,vis_style)
     26XPROP(vs,2,0,visual thickness,f,0.05,0.7,0.2,vsize)
     27XPROP(vr,2,0,red component,f,0.0,1.0,0.5,vcolor.x)
     28XPROP(vg,2,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     29XPROP(vb,2,1024,blue component,f,0.0,1.0,0.5,vcolor.z)
    1930ENDCLASS
    2031
     
    3748PROP(i,2,0,`info',s,,,,info)
    3849PROP(Vstyle,3,0,vis_style,s,0,-1,joint,vis_style)
     50XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x)
     51XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     52XPROP(vb,3,1024,blue component,f,0.0,1.0,0.5,vcolor.z)
    3953ENDCLASS
    4054
     
    5165PROP(i,2,0,`info',s,,,,info)
    5266PROP(Vstyle,3,0,vis_style,s,0,-1,joint,vis_style)
     67XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x)
     68XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     69XPROP(vb,3,1024,blue component,f,0.0,1.0,0.5,vcolor.z)
    5370ENDCLASS
    5471
     
    5976PROP(p,0,0,`part ref#',d,-1,999999,-1,part_refno)
    6077PROP(j,0,0,`joint ref#',d,-1,999999,-1,joint_refno)
    61 PROP(d,1,0,item details,s,,,,details,GETSET)
     78PROP(d,1,0,item details,s,,,N,details,GETSET)
    6279PROP(i,1,0,`info',s,,,,info)
    6380PROP(Vstyle,2,0,vis_style,s,0,-1,neuro,vis_style)
     
    139156ENDNEUROCLASS
    140157
     158NEUROCLASS(VectorEye,VEye,Vector Eye [EXPERIMENTAL!],Refer to publications to learn more about this neuron.,1,1,1)
     159SYMBOL(`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')
     160NEUROPROP(tx,0,0,target.x,f,,,,target.x)
     161NEUROPROP(ty,0,0,target.y,f,,,,target.y)
     162NEUROPROP(tz,0,0,target.z,f,,,,target.z)
     163NEUROPROP(ts,0,0,target shape,s,0,-1,0,targetShape)
     164NEUROPROP(p,0,0,perspective,f,0.1,10.0,1.0,perspz)
     165NEUROPROP(s,0,0,scale,f,0.1,100.0,1.0,perspscale)
     166NEUROPROP(h,0,0,show hidden lines,d,0,1,0,showhidden)
     167NEUROPROP(o,0,0,`output lines count (each line needs four channels)',d,0,99,0,outputcount)
     168NEUROPROP(d,0,0,debug,d,0,1,0,showdebug)
     169ENDNEUROCLASS
     170
     171NEUROCLASS(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)
     172NEUROPROP(noIF,0,0,number of basic features,d,,,,noIF)
     173NEUROPROP(noDim,0,0,number of degrees of freedom,d,,,,noDim)
     174NEUROPROP(params,0,0,parameters,s,,,,params)
     175ENDNEUROCLASS
     176
    141177NEUROCLASS(Sticky,Sti,Sticky [EXPERIMENTAL!],,1,0,1)
    142178VISUALHINTS(EffectorClass)
     
    177213NEUROPROP(t,0,0,time,f,0,6.283185307,0,t)
    178214ENDNEUROCLASS
     215
  • cpp/gdk/f0classes.h

    r69 r80  
     1
    12
    23#define FIELDSTRUCT Part
    34ParamEntry f0_part_paramtab[]=
    45{
    5  {"Geometry",3,14,"p" },
     6 {"Geometry",3,18,"p" },
    67 {"Other properties",},
    78 {"Visual",},
     
    2021 {"i",1,0,"info","s",FIELD(info),},
    2122 {"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),},
    2227 {0,0,0,}
    2328};
    2429ParamEntry f0_part_xtra_paramtab[]=
    2530{
    26  {"Extra properties",1,5,"p"},
     31 {"Extra properties",1,9,"p"},
    2732 {"m",0,0,"mass","f 0.1 999.0 1.0",FIELD(mass),},
    2833 {"dn",0,0,"density","f 0.2 5.0 1.0",FIELD(density),},
     
    3035 {"ing",0,0,"ingestion","f 0.0 1.0 0.25",FIELD(ingest),},
    3136 {"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),},
    3241 {0,0,0,}
    3342};
     
    3847ParamEntry f0_joint_paramtab[]=
    3948{
    40  {"Connections",4,13,"j" },
     49 {"Connections",4,16,"j" },
    4150 {"Geometry",},
    4251 {"Other properties",},
     
    5564 {"i",2,0,"info","s",FIELD(info),},
    5665 {"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),},
    5769 {0,0,0,}
    5870};
    5971ParamEntry f0_joint_xtra_paramtab[]=
    6072{
    61  {"Extra properties",1,2,"j"},
     73 {"Extra properties",1,5,"j"},
    6274 {"stif",0,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),},
    6375 {"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),},
    6479 {0,0,0,}
    6580};
     
    7085ParamEntry f0_nodeltajoint_paramtab[]=
    7186{
    72  {"Connections",4,7,"j" },
     87 {"Connections",4,10,"j" },
    7388 {"Geometry",},
    7489 {"Other properties",},
     
    8196 {"i",2,0,"info","s",FIELD(info),},
    8297 {"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),},
    83101 {0,0,0,}
    84102};
    85103ParamEntry f0_nodeltajoint_xtra_paramtab[]=
    86104{
    87  {"Extra properties",1,2,"j"},
     105 {"Extra properties",1,5,"j"},
    88106 {"stif",0,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),},
    89107 {"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),},
    90111 {0,0,0,}
    91112};
     
    156177
    157178
     179
     180
     181
  • cpp/gdk/f0def.xml

    r69 r80  
    11<!DOCTYPE F0CLASSES>
    22<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>
    310
    411 <CLASS ID="p" NAME="Part">
     
    2027  <PROP ID="i" NAME="info" GROUP="1" FLAGS="0" TYPE="s" />
    2128  <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" />
    2233 </CLASS>
    2334
     
    4051  <PROP ID="i" NAME="info" GROUP="2" FLAGS="0" TYPE="s" />
    4152  <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" />
    4256 </CLASS>
    4357
     
    5064  <PROP ID="p" NAME="part ref#" GROUP="0" FLAGS="0" TYPE="d" MIN="-1" MAX="999999" DEF="-1" />
    5165  <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" />
    5367  <PROP ID="i" NAME="info" GROUP="1" FLAGS="0" TYPE="s" />
    5468  <PROP ID="Vstyle" NAME="vis_style" GROUP="2" FLAGS="0" TYPE="s" MIN="0" MAX="-1" DEF="neuro" />
     
    7791 </NEUROCLASS>
    7892
    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 &quot;gate circuits&quot;, where input signal is passed through or blocked depending on the other singal." INPUTS="-1" OUTPUT="1" LOCATION="0"  >
    8094  <NEUROPROP ID="in" NAME="Inertia" TYPE="f" MIN="0.0" MAX="1.0" DEF="0.8" />
    8195  <NEUROPROP ID="fo" NAME="Force" TYPE="f" MIN="0.0" MAX="999.0" DEF="0.04" />
     
    95109 </NEUROCLASS>
    96110
    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 &quot;smell of energy&quot; 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"  >
    98112
    99113
     
    130144 </NEUROCLASS>
    131145
     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
    132165 <NEUROCLASS ID="Sti" NAME="Sticky [EXPERIMENTAL!]" DESCRIPTION="" INPUTS="1" OUTPUT="0" LOCATION="1"  VISUALHINTS="16"  >
    133166
     
    155188 </NEUROCLASS>
    156189
    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 &quot;ch&quot; 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"  >
    158191
    159192  <NEUROPROP ID="ch" NAME="channel" TYPE="d" MIN="" MAX="" DEF="" />
     
    169202 </NEUROCLASS>
    170203
     204
    171205</F0CLASSES>
  • cpp/gdk/f0defxml.m4

    r66 r80  
    1515define(`PROP',ZPROP(-,$@))
    1616define(`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" )/>')
    1818define(`GROUP',`  <`GROUP' NAME="$1" />')
    1919define(`ENDCLASS',` </`CLASS'>divert')
    2020
    21 define(`NEUROCLASS',` <`NEUROCLASS' ID="$2" NAME="$3" DESCRIPTION="$4" INPUTS="$5" OUTPUT="$6" LOCATION="$7" divert(2) >')
     21define(`NEUROCLASS',` <`NEUROCLASS' ID="$2" NAME="$3" DESCRIPTION="patsubst(`$4',`\\\"',&quot;)" INPUTS="$5" OUTPUT="$6" LOCATION="$7" divert(2) >')
    2222define(`VISUALHINTS',`divert `VISUALHINTS'="eval($1)" divert(2)')
    2323define(`SYMBOL',`divert `SYMBOL'="$1" divert(2)')
  • cpp/gdk/model.def

    r69 r80  
    5959prop:id=getInputNeuroIndex,name="get input neuron index",group="Connections",flags=1+2,type="p d(d)   "
    6060prop: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   "
    6261
    6362
     
    102101
    103102
    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"
     103neuro: 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"
    105104
    106105
     
    120119
    121120
    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"
     121neuro: 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
    123122
    124123
    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"
     124neuro: 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"
    127125
    128126prop:id=ns,name="number of fuzzy sets",type="d 1  "
     
    132130
    133131
    134 neuro: id=Sti,name="Sticky [EXPERIMENTAL!]",info="",inputs=1,output=0,location=1  ,vhints=16
     132neuro: 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
     134prop:id=tx,name="target.x",type="f   "
     135prop:id=ty,name="target.y",type="f   "
     136prop:id=tz,name="target.z",type="f   "
     137prop:id=ts,name="target shape",type="s 0 -1 0"
     138prop:id=p,name="perspective",type="f 0.1 10.0 1.0"
     139prop:id=s,name="scale",type="f 0.1 100.0 1.0"
     140prop:id=h,name="show hidden lines",type="d 0 1 0"
     141prop:id=o,name="output lines count (each line needs four channels)",type="d 0 99 0"
     142prop:id=d,name="debug",type="d 0 1 0"
     143
     144
     145neuro: id=VMotor,name="Visual-Motor Cortex [EXPERIMENTAL!]",info="Must be connected to the VEye and properly set up.",inputs=-1,output=1,location=0
     146prop:id=noIF,name="number of basic features",type="d   "
     147prop:id=noDim,name="number of degrees of freedom",type="d   "
     148prop:id=params,name="parameters",type="s   "
     149 
     150
     151neuro: id=Sti,name="Sticky [EXPERIMENTAL!]",info="",inputs=1,output=0,location=1  ,vhints=32
    135152
    136153
    137154
    138 neuro: id=LMu,name="Linear muscle [EXPERIMENTAL!]",info="",inputs=1,output=0,location=2  ,vhints=16
     155neuro: id=LMu,name="Length muscle [EXPERIMENTAL!]",info="",inputs=1,output=0,location=2  ,vhints=16
    139156
    140157prop:id=p,name="power",type="f 0.01 1.0 1.0"
     
    149166
    150167
    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"
     168neuro: 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
    152169
    153170
    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"
     171neuro: 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
    156172
    157173
    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 
     174neuro: id=ChSel,name="Channel selector",info="Outputs a single channel (selected by the \"ch\" parameter) from multichannel input",inputs=1,output=1,location=0
    161175prop:id=ch,name="channel",type="d   "
    162176
  • cpp/gdk/neurocls-factory.h

    r69 r80  
    22// do not edit - generated automatically from "f0.def"
    33// (to be included in "neurofactory.cpp")
     4
    45
    56
     
    8384#undef FIELDSTRUCT
    8485
     86#define FIELDSTRUCT NI_VectorEye
     87ParamEntry 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
     102ParamEntry 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
    85110#define FIELDSTRUCT NI_Sticky
    86111ParamEntry NI_Sticky_tab []={
     
    141166#undef FIELDSTRUCT
    142167
     168
    143169#define SETIMPLEMENTATION \
    144170setImplementation("N",new NI_StdNeuron); \
     
    152178setImplementation("D",new NI_Diff); \
    153179setImplementation("Fuzzy",new NI_FuzzyNeuro); \
     180setImplementation("VEye",new NI_VectorEye); \
     181setImplementation("VMotor",new NI_VisualMotorNeuron); \
    154182setImplementation("Sti",new NI_Sticky); \
    155183setImplementation("LMu",new NI_LinearMuscle); \
  • cpp/gdk/neurocls-library.h

    r69 r80  
    22// do not edit - generated automatically from "f0.def"
    33// (to be included in "neurolibrary.cpp")
     4
    45
    56
     
    108109addClass(new NeuroClass(NI_FuzzyNeuro_tab,"Refer to publications to learn more about this neuron.",-1,1,0, FuzzyNeuro_xy,0,0));
    109110
     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};   
     112static 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,},};
     126addClass(new NeuroClass(NI_VectorEye_tab,"Refer to publications to learn more about this neuron.",1,1,1, VectorEye_xy,0,0));
     127
     128     
     129static 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,},};
     136addClass(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
    110138     
    111139static ParamEntry NI_Sticky_tab[]={
     
    182210{0,0,0,},};
    183211addClass(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.