Changeset 64
- Timestamp:
- 01/28/11 23:29:40 (14 years ago)
- Location:
- cpp
- Files:
-
- 99 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/gdk/3d.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include <math.h> -
cpp/gdk/3d.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _3D_H_ -
cpp/gdk/advlist.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include <stdlib.h> -
cpp/gdk/advlist.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _ADVLIST_H_ -
cpp/gdk/callbacks.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "callbacks.h" -
cpp/gdk/callbacks.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _CALLBACKS_H_ -
cpp/gdk/conv_f1.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "conv_f1.h" … … 48 48 void addOrRememberInput(int n1,int n2,float w) 49 49 { 50 if (!addInput(n1,n2,w,false))51 50 //if (!addInput(n1,n2,w,false)) 51 connections+=Connection(n1,n2,w); 52 52 } 53 53 bool addInput(int n1,int n2,float w,bool final) … … 270 270 } 271 271 272 // remove leading & trailing whitespaces273 static void trim(SString& s)274 {275 const char*b=(const char*)s;276 const char*e=b+s.len();277 while((b<e)&&(*b<=' ')) b++;278 while((b<e)&&(e[-1]<=' ')) e--;279 if ((e-b)==s.len()) return;280 char* t=s.directWrite();281 if (t!=b) memmove(t,b,e-b);282 s.endWrite(e-b);283 }284 285 272 const char* Builder::growNeuro(const char* t, F1Props& props,int &hasmuscles) 286 273 { … … 346 333 haveclass=1; 347 334 SString clsname(begin,t-begin); 348 trim(clsname);335 clsname=trim(clsname); 349 336 last_f1_neuro->setClassName(clsname); 350 337 NeuroClass *cls=last_f1_neuro->getClass(); -
cpp/gdk/conv_f1.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _CONV_F1_H … … 64 64 GenoConv_F1() 65 65 { 66 name=" f1 converter";66 name="Recursive encoding"; 67 67 in_format='1'; 68 68 mapsupport=1; 69 info="Original Framsticks genotype format";70 69 } 71 70 SString convert(SString &i,MultiMap *map); -
cpp/gdk/convtest.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include <ctype.h> -
cpp/gdk/defassign-f0_joint.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 -
cpp/gdk/defassign-f0_neuro.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 -
cpp/gdk/defassign-f0_neuroconn.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 -
cpp/gdk/defassign-f0_part.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 -
cpp/gdk/defgenoconv.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams.alife.pl/ for further information.4 5 1 #include "defgenoconv.h" 6 2 … … 32 28 #endif 33 29 #ifdef USE_GENCONV_F81 34 #include "conv_f8 .h"30 #include "conv_f8tof1.h" 35 31 #endif 36 32 … … 62 58 #endif 63 59 #ifdef USE_GENCONV_F81 64 addConverter(new GenoConv_F81); 60 GenoConv_F8ToF1 *gc81=new GenoConv_F8ToF1(); 61 GenoConv_F8ToF1::staticpar=gc81->par; //a trick so that the simulator can see this parama 62 addConverter(gc81); 65 63 #endif 66 64 -
cpp/gdk/defgenoconv.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _DEFGENOCONV_H_ -
cpp/gdk/errmanager.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "errmanager.h" … … 90 90 { 91 91 if (w>maxlevel) maxlevel=w; 92 if (w>=FMLV_INFO) infocount++; 92 93 if (w>=FMLV_WARN) warncount++; 93 94 if (w>=FMLV_ERROR) errcount++; -
cpp/gdk/errmanager.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _ERRMANAGER_H_ … … 64 64 { 65 65 protected: 66 int maxlevel,errcount,warncount,storlevel,storcount ;66 int maxlevel,errcount,warncount,storlevel,storcount,infocount; 67 67 SString msgs; 68 68 69 69 public: 70 70 71 void reset() {maxlevel=FMLV_INFO-1; errcount=warncount=storcount= 0; msgs=0;}71 void reset() {maxlevel=FMLV_INFO-1; errcount=warncount=storcount=infocount=0; msgs=0;} 72 72 73 73 enum Options2 … … 76 76 int getErrorCount() {return errcount;} 77 77 int getWarningCount() {return warncount;} 78 int getInfoCount() {return infocount;} 78 79 int getStoredCount() {return storcount;} 79 80 int getErrorLevel() {return maxlevel;} -
cpp/gdk/extvalue.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "extvalue.h" … … 20 20 SString tmp("<"); 21 21 tmp+=p->getName(); 22 sprintf(tmp.directAppend(30)," object at %p>",object); 22 sprintf(tmp.directAppend(30)," object at %p>", 23 (object?object:paraminterface)); 23 24 tmp.endAppend(); 24 25 return tmp; … … 36 37 case TDouble: setd(src.ddata()); break; 37 38 case TObj: seto(src.odata()); break; 39 case TInvalid: type=TInvalid; break; 38 40 } 39 41 } … … 284 286 case TObj: 285 287 return odata().toString(); 288 case TInvalid: 289 return SString("undefined"); 286 290 default: 287 291 return SString("null"); -
cpp/gdk/extvalue.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _EXTVALUE_H_ … … 13 13 14 14 enum ExtPType 15 {TUnknown=0,TInt,TDouble,TString,TObj };15 {TUnknown=0,TInt,TDouble,TString,TObj,TInvalid}; 16 16 17 17 /** … … 114 114 :type(TUnknown) {set(src);} 115 115 void setEmpty(); 116 void setInvalid() {setEmpty();type=TInvalid;} 116 117 ExtPType getType() {return type;} 117 118 void *getObjectTarget(const char* classname) {return (type==TObj)?getObject().getTarget(classname):0;} -
cpp/gdk/f0-modeldef.m4
r5 r64 6 6 define(`AtSecondPart',`8') 7 7 define(`InTheMiddle',`12') 8 define(` MuscleClass',`16')8 define(`EffectorClass',`16') 9 9 define(`ReceptorClass',`32') 10 10 define(`V1BendMuscle',`64') -
cpp/gdk/f0.def
r5 r64 66 66 PROP(getInputNeuroIndex,0,1+2,`get input neuron index',p d(d),,,,p_getInputNeuroIndex,PROCEDURE) 67 67 PROP(getInputWeight,0,1+2,`get input weight',p f(d),,,,p_getInputWeight,PROCEDURE) 68 PROP(classObject,0,1+2,`neuron class',o NeuroClass,,,,classObject,GETONLY) 68 69 ENDCLASS 69 70 … … 100 101 VISUALHINTS(ReceptorClass) 101 102 SYMBOL(`2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50') 103 NEUROPROP(r,1,0,Range,f,0.0,1.0,1.0,range) 102 104 ENDNEUROCLASS 103 105 … … 109 111 NEUROCLASS(Const,*,Constant,Constant value,0,1,0) 110 112 VISUALHINTS(Invisible) 111 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')113 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') 112 114 ENDNEUROCLASS 113 115 114 116 NEUROCLASS(BendMuscle,|,Bend muscle,,1,0,2) 115 VISUALHINTS(DontShowClass+ MuscleClass+V1BendMuscle+AtFirstPart)117 VISUALHINTS(DontShowClass+EffectorClass+V1BendMuscle+AtFirstPart) 116 118 SYMBOL(`6,5,25,40,35,40,45,50,35,60,25,60,25,40,4,65,85,65,50,75,50,75,85,65,85,3,65,56,49,29,57,24,72,50,4,68,53,70,53,70,55,68,55,68,53,5,50,21,60,15,70,14,79,15,87,20,81,10,1,86,20,77,21') 117 119 NEUROPROP(p,0,0,power,f,0.01,1.0,0.25,power) … … 120 122 121 123 NEUROCLASS(RotMuscle,@,Rotation muscle,,1,0,2) 122 VISUALHINTS(DontShowClass+ MuscleClass+V1RotMuscle+AtFirstPart)124 VISUALHINTS(DontShowClass+EffectorClass+V1RotMuscle+AtFirstPart) 123 125 SYMBOL(`5,5,25,40,35,40,45,50,35,60,25,60,25,40,4,65,85,65,50,75,50,75,85,65,85,1,69,10,77,17,10,59,15,57,17,57,22,60,26,69,27,78,26,82,21,82,16,79,12,69,10,80,6,3,65,50,65,20,75,20,75,50') 124 126 NEUROPROP(p,0,0,power,f,0.01,1.0,1.0,power) … … 126 128 127 129 NEUROCLASS(Diff,D,Differentiate,Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights,-1,1,0) 130 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') 128 131 ENDNEUROCLASS 129 132 130 NEUROCLASS(FuzzyNeuro,Fuzzy,Fuzzy system [EXPERIMENTAL!],Refer to publications to learn about this neuron,-1,1,0)133 NEUROCLASS(FuzzyNeuro,Fuzzy,Fuzzy system [EXPERIMENTAL!],Refer to publications to learn more about this neuron.,-1,1,0) 131 134 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') 132 135 NEUROPROP(ns,0,0,number of fuzzy sets,d,1,,,fuzzySetsNr) … … 136 139 ENDNEUROCLASS 137 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 ENDNEUROCLASS 153 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 ENDNEUROCLASS 159 138 160 NEUROCLASS(Sticky,Sti,Sticky [EXPERIMENTAL!],,1,0,1) 139 VISUALHINTS( ReceptorClass)161 VISUALHINTS(EffectorClass) 140 162 ENDNEUROCLASS 141 163 142 164 NEUROCLASS(LinearMuscle,LMu,Linear muscle [EXPERIMENTAL!],,1,0,2) 143 VISUALHINTS( MuscleClass)165 VISUALHINTS(EffectorClass) 144 166 NEUROPROP(p,0,0,power,f,0.01,1.0,1.0,power) 145 167 ENDNEUROCLASS … … 154 176 155 177 NEUROCLASS(Channelize,Ch,Channelize,`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.',-1,1,0) 178 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') 156 179 ENDNEUROCLASS 157 180 158 181 NEUROCLASS(ChMux,ChMux,Channel multiplexer,`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)',2,1,0) 182 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') 159 183 ENDNEUROCLASS 160 184 161 185 NEUROCLASS(ChSel,ChSel,Channel selector,`Outputs a single channel (selected by the \"ch\" parameter) from multichannel input',1,1,0) 186 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') 162 187 NEUROPROP(ch,0,0,channel,d,,,,ch) 163 188 ENDNEUROCLASS … … 171 196 NEUROPROP(t,0,0,time,f,0,6.283185307,0,t) 172 197 ENDNEUROCLASS 198 -
cpp/gdk/f0classes.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams.alife.pl/ for further information.4 5 1 6 2 #define FIELDSTRUCT Part … … 100 96 ParamEntry f0_neuro_paramtab[]= 101 97 { 102 {"Connections",3, 9,"n" },98 {"Connections",3,10,"n" }, 103 99 {"Other",}, 104 100 {"Visual",}, … … 112 108 {"getInputNeuroIndex",0,1+2,"get input neuron index","p d(d)",PROCEDURE(p_getInputNeuroIndex),}, 113 109 {"getInputWeight",0,1+2,"get input weight","p f(d)",PROCEDURE(p_getInputWeight),}, 110 {"classObject",0,1+2,"neuron class","o NeuroClass",GETONLY(classObject),}, 114 111 {0,0,0,} 115 112 }; … … 159 156 160 157 158 159 160 -
cpp/gdk/f0def.xml
r5 r64 57 57 <PROP ID="getInputNeuroIndex" NAME="get input neuron index" GROUP="0" FLAGS="1+2" TYPE="p d(d)" /> 58 58 <PROP ID="getInputWeight" NAME="get input weight" GROUP="0" FLAGS="1+2" TYPE="p f(d)" /> 59 <PROP ID="classObject" NAME="neuron class" GROUP="0" FLAGS="1+2" TYPE="o NeuroClass" /> 59 60 </CLASS> 60 61 … … 91 92 92 93 94 <NEUROPROP ID="r" NAME="Range" TYPE="f" MIN="0.0" MAX="1.0" DEF="1.0" /> 93 95 </NEUROCLASS> 94 96 … … 98 100 </NEUROCLASS> 99 101 100 <NEUROCLASS ID="*" NAME="Constant" DESCRIPTION="Constant value" INPUTS="0" OUTPUT="1" LOCATION="0" VISUALHINTS="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" >102 <NEUROCLASS ID="*" NAME="Constant" DESCRIPTION="Constant value" INPUTS="0" OUTPUT="1" LOCATION="0" VISUALHINTS="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" > 101 103 102 104 … … 116 118 </NEUROCLASS> 117 119 118 <NEUROCLASS ID="D" NAME="Differentiate" DESCRIPTION="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" > 120 <NEUROCLASS ID="D" NAME="Differentiate" DESCRIPTION="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 119 122 </NEUROCLASS> 120 123 121 <NEUROCLASS ID="Fuzzy" NAME="Fuzzy system [EXPERIMENTAL!]" DESCRIPTION="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" >124 <NEUROCLASS ID="Fuzzy" NAME="Fuzzy system [EXPERIMENTAL!]" DESCRIPTION="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" > 122 125 123 126 <NEUROPROP ID="ns" NAME="number of fuzzy sets" TYPE="d" MIN="1" MAX="" DEF="" /> … … 127 130 </NEUROCLASS> 128 131 129 <NEUROCLASS ID="Sti" NAME="Sticky [EXPERIMENTAL!]" DESCRIPTION="" INPUTS="1" OUTPUT="0" LOCATION="1" VISUALHINTS="32" > 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 <NEUROCLASS ID="Sti" NAME="Sticky [EXPERIMENTAL!]" DESCRIPTION="" INPUTS="1" OUTPUT="0" LOCATION="1" VISUALHINTS="16" > 130 152 131 153 </NEUROCLASS> … … 144 166 </NEUROCLASS> 145 167 146 <NEUROCLASS ID="Ch" NAME="Channelize" DESCRIPTION="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" > 168 <NEUROCLASS ID="Ch" NAME="Channelize" DESCRIPTION="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 147 170 </NEUROCLASS> 148 171 149 <NEUROCLASS ID="ChMux" NAME="Channel multiplexer" DESCRIPTION="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" > 172 <NEUROCLASS ID="ChMux" NAME="Channel multiplexer" DESCRIPTION="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" > 173 150 174 </NEUROCLASS> 151 175 152 <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" > 176 <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" > 177 153 178 <NEUROPROP ID="ch" NAME="channel" TYPE="d" MIN="" MAX="" DEF="" /> 154 179 </NEUROCLASS> … … 163 188 </NEUROCLASS> 164 189 190 165 191 </F0CLASSES> -
cpp/gdk/f0defxml.m4
r5 r64 6 6 define(`AtSecondPart',`8') 7 7 define(`InTheMiddle',`12') 8 define(` MuscleClass',`16')8 define(`EffectorClass',`16') 9 9 define(`ReceptorClass',`32') 10 10 define(`V1BendMuscle',`64') -
cpp/gdk/framsg.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "nonstd.h" -
cpp/gdk/framsg.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _FRAMSG_H_ -
cpp/gdk/gdktest.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include <stdlib.h> … … 249 249 } 250 250 251 void findingConverters() 252 { 253 GenoConverter *gc=gcm.findConverters(0,'1'); 254 if (gc) printf("found converter accepting f1: \"%s\"\n",gc->name); 255 SListTempl<GenoConverter*> found; 256 gcm.findConverters(&found,-1,'0'); 257 printf("found %d converter(s) producing f0\n",found.size()); 258 } 259 251 260 int main(int argc,char*argv[]) 252 261 { 253 262 srand(time(0)); 254 263 printNiceBanner("Welcome to GDK test application!"); 264 265 findingConverters(); 255 266 256 267 //Geno g(argc>1?argv[1]:"X[|G:1.23]"); -
cpp/gdk/gen-config.h
r5 r64 1 // This file is a part of Framsticks GDK library. 2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details. 3 // Refer to http://www.frams.alife.pl/ for further information. 1 // This file is a part of the Framsticks GDK library. See LICENSE.txt for details. 2 // Refer to http://www.framsticks.com/ for further information. 4 3 5 // This file is a part of Framsticks GDK library. See LICENSE.TXT for details.6 // Refer to http://www.frams.alife.pl/ for further information.7 4 8 5 /** -
cpp/gdk/geno.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "geno.h" … … 173 173 else 174 174 out+="/*"; 175 out+=format; 175 if (format==0) 176 out+="invalid"; 177 else 178 out+=format; 176 179 if (multiline) 177 180 out+="\n"; -
cpp/gdk/geno.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _GENO_H_ -
cpp/gdk/genoconv.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "nonstd.h" … … 49 49 tab[0].flags=ile; 50 50 tab[0].name="gkparam:"; 51 gcnames.clear(); 51 52 for (i=0,pe=tab+1;gk=(GenoConverter *)gcm->converters(i);pe++,i++) 52 53 { … … 54 55 pe->group=0; 55 56 pe->flags=0; 56 pe->name=gk->name; 57 std::string descr="f"; 58 descr+=gk->in_format; 59 descr+=" -> f"; 60 descr+=gk->out_format; 61 descr+=" : "; 62 descr+=gk->name; 63 gcnames.push_back(descr); 64 pe->name=descr.c_str(); 57 65 pe->type="d 0 1"; 58 66 pe->help=gk->info; … … 96 104 converters-=gc; 97 105 param.updatetab(); 106 } 107 108 GenoConverter *GenoConvManager::findConverters(SListTempl<GenoConverter*>* result,char in,char out,int enabled,char* name) 109 { 110 GenoConverter *gk,*retval=0; 111 int i=0; 112 for (;gk=(GenoConverter*)converters(i);i++) 113 { 114 if ((in!=-1)&&(in!=gk->in_format)) continue; 115 if ((out!=-1)&&(out!=gk->out_format)) continue; 116 if ((enabled!=-1)&&(enabled!=gk->enabled)) continue; 117 if ((name)&&(strcmp(name,gk->name))) continue; 118 if (!retval) {retval=gk; if (!result) break;} 119 if (result) result->append(gk); 120 } 121 return retval; 98 122 } 99 123 -
cpp/gdk/genoconv.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _GENCONV_H_ … … 11 11 #include "sstring.h" 12 12 13 #include <string> 14 #include <vector> 15 13 16 14 17 class GenoConvManager; … … 17 20 { 18 21 GenoConvManager *gcm; 22 std::vector<std::string> gcnames; 19 23 void freetab(); 20 24 public: … … 89 93 char *getPath(char in,char out,char *path,int maxlen,int *mapavailable=0); 90 94 char *getFormatPath(char in,char out,char *path,int maxlen,int *mapavailable=0); 95 /// returns the list of converters meeting the specified criteria 96 /// pass result=0 if you only need one result (by return value) 97 /// default criteria values mean "don't care", pass anything else to narrow your search 98 GenoConverter *findConverters(SListTempl<GenoConverter*>* result=0,char in=-1,char out=-1,int enabled=-1,char* name=0); 91 99 }; 92 100 -
cpp/gdk/genotest.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "geno.h" -
cpp/gdk/genotypeloader.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "genotypeloader.h" -
cpp/gdk/genotypeloader.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _GENOTYPELOADER_H_ -
cpp/gdk/list.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include <stdlib.h> -
cpp/gdk/list.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _LIST_H_ -
cpp/gdk/loadertest.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "genotypeloader.h" -
cpp/gdk/model.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "nonstd.h" … … 960 960 } 961 961 } 962 if (final) if (j->d()>getMaxJoint().d.x) 962 if (final) 963 { 964 if (j->d()>getMaxJoint().d.x) 963 965 { 964 966 ret=0; 965 967 FMprintf("Model","internalCheck",FMLV_ERROR,"delta too big in joint #%d (%s)", 966 968 i,(const char*)geno.getName()); 969 } 970 else if (j->d()<getMinJoint().d.x) 971 { 972 ret=0; 973 FMprintf("Model","internalCheck",FMLV_ERROR,"delta too small in joint #%d (%s)", 974 i,(const char*)geno.getName()); 975 } 967 976 } 968 977 } … … 1259 1268 class MaxNeuro: public Neuro {public: MaxNeuro() {Param par(f0_neuro_paramtab,this);par.setMax();}}; 1260 1269 1261 constPart& Model::getMinPart() {static MinPart part; return part;}1262 constPart& Model::getMaxPart() {static MaxPart part; return part;}1263 constPart& Model::getDefPart() {static Part part; return part;}1264 constJoint& Model::getMinJoint() {static MinJoint joint; return joint;}1265 constJoint& Model::getMaxJoint() {static MaxJoint joint; return joint;}1266 constJoint& Model::getDefJoint() {static Joint joint; return joint;}1267 constNeuro& Model::getMinNeuro() {static MinNeuro neuro; return neuro;}1268 constNeuro& Model::getMaxNeuro() {static MaxNeuro neuro; return neuro;}1269 constNeuro& Model::getDefNeuro() {static Neuro neuro; return neuro;}1270 Part& Model::getMinPart() {static MinPart part; return part;} 1271 Part& Model::getMaxPart() {static MaxPart part; return part;} 1272 Part& Model::getDefPart() {static Part part; return part;} 1273 Joint& Model::getMinJoint() {static MinJoint joint; return joint;} 1274 Joint& Model::getMaxJoint() {static MaxJoint joint; return joint;} 1275 Joint& Model::getDefJoint() {static Joint joint; return joint;} 1276 Neuro& Model::getMinNeuro() {static MinNeuro neuro; return neuro;} 1277 Neuro& Model::getMaxNeuro() {static MaxNeuro neuro; return neuro;} 1278 Neuro& Model::getDefNeuro() {static Neuro neuro; return neuro;} -
cpp/gdk/model.def
r5 r64 93 93 94 94 95 prop:id=r,name="Range",type="f 0.0 1.0 1.0" 95 96 96 97 … … 129 130 130 131 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 131 151 neuro: id=Sti,name="Sticky [EXPERIMENTAL!]",info="",inputs=1,output=0,location=1 ,vhints=32 132 152 133 153 134 154 135 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 136 156 137 157 prop:id=p,name="power",type="f 0.01 1.0 1.0" -
cpp/gdk/model.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _MODEL_H_ … … 408 408 /////////////////////////// 409 409 410 static constPart& getMinPart();411 static constPart& getMaxPart();412 static constPart& getDefPart();413 static constJoint& getMinJoint();414 static constJoint& getMaxJoint();415 static constJoint& getDefJoint();416 static constNeuro& getMinNeuro();417 static constNeuro& getMaxNeuro();418 static constNeuro& getDefNeuro();410 static Part& getMinPart(); 411 static Part& getMaxPart(); 412 static Part& getDefPart(); 413 static Joint& getMinJoint(); 414 static Joint& getMaxJoint(); 415 static Joint& getDefJoint(); 416 static Neuro& getMinNeuro(); 417 static Neuro& getMaxNeuro(); 418 static Neuro& getDefNeuro(); 419 419 }; 420 420 -
cpp/gdk/modelparts.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include <stdlib.h> … … 21 21 #include "multirange.h" 22 22 #include "extvalue.h" 23 24 #include "neuroclsobject.h" 23 25 24 26 template<> … … 524 526 } 525 527 528 void Neuro::get_classObject(PARAMGETARGS) 529 { 530 NeuroClassExt::makeStaticObject(ret,getClass()); 531 } 532 526 533 /////// old items 527 534 #ifdef MODEL_V1_COMPATIBLE -
cpp/gdk/modelparts.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _MODELPARTS_H_ … … 241 241 /** draw the neuron at the second part when attached to joint (default is in the middle) */ 242 242 AtSecondPart=8, 243 /** use musclecolour for this neuro unit */244 MuscleClass=16,243 /** use effector colour for this neuro unit */ 244 EffectorClass=16, 245 245 /** use receptor colour for this neuro unit */ 246 246 ReceptorClass=32, 247 247 V1BendMuscle=64, 248 V1RotMuscle=128 248 V1RotMuscle=128, 249 249 }; 250 250 … … 349 349 PARAMPROCDEF(p_getInputNeuroIndex); 350 350 PARAMPROCDEF(p_getInputWeight); 351 PARAMGETDEF(classObject); 351 352 #undef STATRICKCLASS 352 353 -
cpp/gdk/multimap.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "multimap.h" -
cpp/gdk/multimap.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _MULTIMAP_H_ -
cpp/gdk/multiparamload.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "multiparamload.h" … … 105 105 { 106 106 lastclass->load(file); 107 if ( maybeBreak(AfterObject))107 if ((status!=Finished) && maybeBreak(AfterObject)) 108 108 break; 109 109 continue; … … 144 144 continue; 145 145 } 146 else if ( maybeBreak(OnComment))146 else if ((status!=Finished) && maybeBreak(OnComment)) 147 147 { 148 148 lastcomment=t+1; -
cpp/gdk/multiparamload.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _MULTIPARAMLOAD_H_ -
cpp/gdk/multirange.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "multirange.h" -
cpp/gdk/multirange.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _MULTIRANGE_H_ -
cpp/gdk/neuroclasses.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 CLASS(StdNeuron,"N","Neuron",`"Standard Framsticks Neuron, compatible with 1.0"',-1,1,0,0,0) -
cpp/gdk/neurocls-factory.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams.alife.pl/ for further information.4 5 1 6 2 // do not edit - generated automatically from "f0.def" … … 39 35 #define FIELDSTRUCT NI_Touch 40 36 ParamEntry NI_Touch_tab []={ 41 {"Touch",1, 0 ,"T",}, 37 {"Touch",1, 1 ,"T",}, 38 {"r",1,0,"Range","f 0.0 1.0 1.0",FIELD(range),}, 42 39 {0,0,0,},}; 43 40 #undef FIELDSTRUCT … … 85 82 {0,0,0,},}; 86 83 #undef FIELDSTRUCT 84 85 #define FIELDSTRUCT NI_VectorEye 86 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 FIELDSTRUCT 99 100 #define FIELDSTRUCT NI_VisualMotorNeuron 101 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 FIELDSTRUCT 87 108 88 109 #define FIELDSTRUCT NI_Sticky … … 144 165 #undef FIELDSTRUCT 145 166 167 146 168 #define SETIMPLEMENTATION \ 147 169 setImplementation("N",new NI_StdNeuron); \ … … 155 177 setImplementation("D",new NI_Diff); \ 156 178 setImplementation("Fuzzy",new NI_FuzzyNeuro); \ 179 setImplementation("VEye",new NI_VectorEye); \ 180 setImplementation("VMotor",new NI_VisualMotorNeuron); \ 157 181 setImplementation("Sti",new NI_Sticky); \ 158 182 setImplementation("LMu",new NI_LinearMuscle); \ -
cpp/gdk/neurocls-library.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams.alife.pl/ for further information.4 5 1 6 2 // do not edit - generated automatically from "f0.def" … … 45 41 static int Touch_xy[]={43,2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50}; 46 42 static ParamEntry NI_Touch_tab[]={ 47 {"Touch",1, 0 ,"T",}, 48 49 43 {"Touch",1, 1 ,"T",}, 44 45 46 {"r",1,0,"Range","f 0.0 1.0 1.0",}, 50 47 51 48 {0,0,0,},}; … … 61 58 addClass(new NeuroClass(NI_Smell_tab,"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)",0,1,1, Smell_xy,0,32)); 62 59 63 static int Const_xy[]={2 6,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};60 static int Const_xy[]={29,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}; 64 61 static ParamEntry NI_Const_tab[]={ 65 62 {"Constant",1, 0 ,"*",}, … … 91 88 addClass(new NeuroClass(NI_RotMuscle_tab,"",1,0,2, RotMuscle_xy,0,2+16+128+4)); 92 89 93 90 static int Diff_xy[]={24,3,3,25,0,25,100,75,50,25,0,1,75,50,100,50,3,44,42,51,57,36,57,44,42}; 94 91 static ParamEntry NI_Diff_tab[]={ 95 92 {"Differentiate",1, 0 ,"D",}, 96 97 {0,0,0,},}; 98 addClass(new NeuroClass(NI_Diff_tab,"Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights",-1,1,0, 0,0)); 93 94 95 {0,0,0,},}; 96 addClass(new NeuroClass(NI_Diff_tab,"Calculate the difference between the current and previous input value. Multiple inputs are aggregated with respect to their weights",-1,1,0, Diff_xy,0,0)); 99 97 100 98 static int FuzzyNeuro_xy[]={44,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}; … … 108 106 109 107 {0,0,0,},}; 110 addClass(new NeuroClass(NI_FuzzyNeuro_tab,"Refer to publications to learn about this neuron",-1,1,0, FuzzyNeuro_xy,0,0)); 108 addClass(new NeuroClass(NI_FuzzyNeuro_tab,"Refer to publications to learn more about this neuron.",-1,1,0, FuzzyNeuro_xy,0,0)); 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)); 111 136 112 137 … … 116 141 117 142 {0,0,0,},}; 118 addClass(new NeuroClass(NI_Sticky_tab,"",1,0,1, 0, 32));143 addClass(new NeuroClass(NI_Sticky_tab,"",1,0,1, 0,16)); 119 144 120 145 … … 143 168 addClass(new NeuroClass(NI_Energy_tab,"The current energy level divided by the initial energy level.\nUsually falls from initial 1.0 down to 0.0 and then the creature dies. It can rise above 1.0 if enough food is ingested",0,1,0, 0,32)); 144 169 145 170 static int Channelize_xy[]={57,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}; 146 171 static ParamEntry NI_Channelize_tab[]={ 147 172 {"Channelize",1, 0 ,"Ch",}, 148 149 {0,0,0,},}; 150 addClass(new NeuroClass(NI_Channelize_tab,"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.",-1,1,0, 0,0)); 151 152 173 174 175 {0,0,0,},}; 176 addClass(new NeuroClass(NI_Channelize_tab,"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.",-1,1,0, Channelize_xy,0,0)); 177 178 static int ChMux_xy[]={52,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}; 153 179 static ParamEntry NI_ChMux_tab[]={ 154 180 {"Channel multiplexer",1, 0 ,"ChMux",}, 155 156 {0,0,0,},}; 157 addClass(new NeuroClass(NI_ChMux_tab,"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)",2,1,0, 0,0)); 158 159 181 182 183 {0,0,0,},}; 184 addClass(new NeuroClass(NI_ChMux_tab,"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)",2,1,0, ChMux_xy,0,0)); 185 186 static int ChSel_xy[]={41,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 187 static ParamEntry NI_ChSel_tab[]={ 161 188 {"Channel selector",1, 1 ,"ChSel",}, 189 162 190 {"ch",0,0,"channel","d ",}, 163 191 164 192 {0,0,0,},}; 165 addClass(new NeuroClass(NI_ChSel_tab,"Outputs a single channel (selected by the \"ch\" parameter) from multichannel input",1,1,0, 0,0));193 addClass(new NeuroClass(NI_ChSel_tab,"Outputs a single channel (selected by the \"ch\" parameter) from multichannel input",1,1,0, ChSel_xy,0,0)); 166 194 167 195 … … 181 209 {0,0,0,},}; 182 210 addClass(new NeuroClass(NI_Sinus_tab,"Output frequency = f0+input",1,1,0, Sinus_xy,0,0)); 211 -
cpp/gdk/neurocls-library.m4
r5 r64 15 15 define(`AtSecondPart',`8') 16 16 define(`InTheMiddle',`12') 17 define(` MuscleClass',`16')17 define(`EffectorClass',`16') 18 18 define(`ReceptorClass',`32') 19 19 define(`V1BendMuscle',`64') -
cpp/gdk/neurofactory.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "neurofactory.h" … … 17 17 NeuroImpl* ni=(NeuroImpl*)nc->impl; 18 18 if (!ni) return 0; 19 return ni->makeNew(); 19 ni=ni->makeNew(); 20 if (ni) ni->neuroclass=nc; 21 return ni; 20 22 } 21 23 -
cpp/gdk/neurofactory.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _NEUROFACTORY_H_ -
cpp/gdk/neuroimpl-body-gdk.h
r5 r64 1 // This file is a part of Framsticks GDK library. 2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details. 3 // Refer to http://www.frams.alife.pl/ for further information. 4 5 // This file is a part of Framsticks GDK library. 6 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details. 7 // Refer to http://www.frams.alife.pl/ for further information. 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. 8 4 9 5 #ifndef _NEUROIMPLBODY_H_ -
cpp/gdk/neuroimpl-channels.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "neuroimpl-channels.h" -
cpp/gdk/neuroimpl-channels.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _NEUROIMPLCHANNELS_H -
cpp/gdk/neuroimpl-fuzzy-f0.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 /// this is a module included into neuroimpl-fuzzy -
cpp/gdk/neuroimpl-fuzzy-f0.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 /// this is a modul included into neuroimpl-fuzzy -
cpp/gdk/neuroimpl-fuzzy.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "neuroimpl-fuzzy.h" -
cpp/gdk/neuroimpl-fuzzy.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _NEUROIMPLFUZZY_H_ -
cpp/gdk/neuroimpl-simple.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "neuroimpl-simple.h" -
cpp/gdk/neuroimpl-simple.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _NEUROIMPLSIMPLE_H_ -
cpp/gdk/neuroimpl.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "neuroimpl.h" … … 23 23 { 24 24 {"Creature: Neurons",1,2,"nnsim",}, 25 {"randinit",1,0,"Random initialization","f 0 10 0.01",FIELD(randominit)," Initialize all neuron states with uniform distribution random numbers"},25 {"randinit",1,0,"Random initialization","f 0 10 0.01",FIELD(randominit),"Allowed range for initializing all neuron states with uniform distribution random numbers and zero mean. Set 0 for deterministic initialization."}, 26 26 {"touchrange",1,0,"T receptor range","f 0 100 1",FIELD(touchrange),}, 27 27 {0,0,0,}, … … 277 277 ParamEntry neuroimpl_tab[]= 278 278 { 279 {"Neuro",1,2 6+NEUROIMPL_SIGNAL_PROPS,"Neuro","Live Neuron object."},280 281 {"getInputState",0,0," get input signal","p f(d input)",PROCEDURE(p_get),},282 {"getInputWeight",0,0," get input weight","p f(d input)",PROCEDURE(p_getweight),},283 {"getWeightedInputState",0,0," get weighted input signal","p f(d input)",PROCEDURE(p_getw),},284 {"getInputSum",0,0," get signal sum","p f(d input)",PROCEDURE(p_getsum),},285 {"getWeightedInputSum",0,0," get weighted signal sum","p f(d input)",PROCEDURE(p_getwsum),"uses any number of inputs starting with the specified input. getWeightedInputSum(0)=weightedInputSum"},286 {"getInputCount",0,0," get input count","d",GETONLY(count),},287 {"inputSum",0,0," full signal sum","f",GETONLY(sum),},288 {"weightedInputSum",0,0," full weighted signal sum","f",GETONLY(wsum),},289 {"getInputChannelCount",0,0," get channel count for input","p d(d input)",PROCEDURE(p_getchancount),},290 {"getInputStateChannel",0,0," get input signal from channel","p f(d input,d channel)",PROCEDURE(p_getchan),},291 {"getWeightedInputStateChannel",0,0," get weighted input signal from channel","p f(d input,d channel)",PROCEDURE(p_getwchan),},292 {"state",0,0," neuron state (channel 0)","f",GETSET(state),"when read, returns the current neuron state.\nWhen written, sets the next neuron state (for use in the neuron definition)"},293 {"channelCount",0,0," number of output channels","d",GETSET(channels),},294 {"getStateChannel",0,0," get output state for channel","p f(d channel)",PROCEDURE(p_getstate),},295 {"setStateChannel",0,0," set output state for channel","p(d channel,f value)",PROCEDURE(p_setstate),},296 {"hold",0,0,"Hold state","d 0 1",GETSET(hold)," ",},297 {"currState",0,0," neuron state (channel 0)","f",GETSET(cstate),"the only difference from the \"state\" field is that currState, when written, changes the internal neuron state immediately (which disturbs the regular synchronous NN operation). This feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition.",},298 {"setCurrStateChannel",0,0," set neuron for channel","p(d channel,f value)",PROCEDURE(p_setcstate),"like \"currState\""},299 {"position_x",0,0," position x","f",GETONLY(position_x),},300 {"position_y",0,0," position y","f",GETONLY(position_y),},301 {"position_z",0,0," position z","f",GETONLY(position_z),},302 {"creature",0,0," getowner creature","o Creature",GETONLY(creature),},303 {"part",0,0," the Part object where this neuron is located","o MechPart",GETONLY(part),},304 {"joint",0,0," the Joint object where this neuron is located","o MechJoint",GETONLY(joint),},305 {"fields",0,0," custom neuron fields","o Fields",GETONLY(fields),279 {"Neuro",1,27+NEUROIMPL_SIGNAL_PROPS,"Neuro","Live Neuron object."}, 280 281 {"getInputState",0,0,"Get input signal","p f(d input)",PROCEDURE(p_get),}, 282 {"getInputWeight",0,0,"Get input weight","p f(d input)",PROCEDURE(p_getweight),}, 283 {"getWeightedInputState",0,0,"Get weighted input signal","p f(d input)",PROCEDURE(p_getw),}, 284 {"getInputSum",0,0,"Get signal sum","p f(d input)",PROCEDURE(p_getsum),}, 285 {"getWeightedInputSum",0,0,"Get weighted signal sum","p f(d input)",PROCEDURE(p_getwsum),"Uses any number of inputs starting with the specified input. getWeightedInputSum(0)=weightedInputSum"}, 286 {"getInputCount",0,0,"Get input count","d",GETONLY(count),}, 287 {"inputSum",0,0,"Full signal sum","f",GETONLY(sum),}, 288 {"weightedInputSum",0,0,"Full weighted signal sum","f",GETONLY(wsum),}, 289 {"getInputChannelCount",0,0,"Get channel count for input","p d(d input)",PROCEDURE(p_getchancount),}, 290 {"getInputStateChannel",0,0,"Get input signal from channel","p f(d input,d channel)",PROCEDURE(p_getchan),}, 291 {"getWeightedInputStateChannel",0,0,"Get weighted input signal from channel","p f(d input,d channel)",PROCEDURE(p_getwchan),}, 292 {"state",0,0,"Neuron state (channel 0)","f",GETSET(state),"When read, returns the current neuron state.\nWhen written, sets the next neuron state (for use in the neuron definition)"}, 293 {"channelCount",0,0,"Number of output channels","d",GETSET(channels),}, 294 {"getStateChannel",0,0,"Get output state for channel","p f(d channel)",PROCEDURE(p_getstate),}, 295 {"setStateChannel",0,0,"Set output state for channel","p(d channel,f value)",PROCEDURE(p_setstate),}, 296 {"hold",0,0,"Hold state","d 0 1",GETSET(hold),"\"Holding\" means keeping the neuron state as is, blocking the regular neuron operation. This is useful when your script needs to inject some control signals into the NN. Without \"holding\", live neurons would be constantly overwriting your changes, and the rest of the NN could see inconsistent states, depending on the connections. Setting hold=1 ensures the neuron state will be only set by you, and not by the neuron. The enforced signal value can be set using Neuro.currState before or after setting hold=1. Set hold=0 to resume normal operation.",}, 297 {"currState",0,0,"Neuron state (channel 0)","f",GETSET(cstate),"The only difference from the \"state\" field is that currState, when written, changes the internal neuron state immediately (which disturbs the regular synchronous NN operation). This feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition. See also: Neuro.hold",}, 298 {"setCurrStateChannel",0,0,"Set neuron for channel","p(d channel,f value)",PROCEDURE(p_setcstate),"Analogous to \"currState\"."}, 299 {"position_x",0,0,"Position x","f",GETONLY(position_x),}, 300 {"position_y",0,0,"Position y","f",GETONLY(position_y),}, 301 {"position_z",0,0,"Position z","f",GETONLY(position_z),}, 302 {"creature",0,0,"Gets owner creature","o Creature",GETONLY(creature),}, 303 {"part",0,0,"The Part object where this neuron is located","o MechPart",GETONLY(part),}, 304 {"joint",0,0,"The Joint object where this neuron is located","o MechJoint",GETONLY(joint),}, 305 {"fields",0,0,"Custom neuron fields","o Fields",GETONLY(fields), 306 306 "Neurons can have different fields depending on their class. Script neurons have their fields defined using the \"prop:\" syntax. If you develop a custom neuron script you should use the Fields object for accessing your own neuron fields. The Neuro.fields property is meant for accessing the neuron fields from the outside script.\n" 307 307 "Examples:\n" 308 "var c= LiveLibrary.createFromString(\"X[N]\");\n"308 "var c=Populations.createFromString(\"X[N]\");\n" 309 309 "Simulator.print(\"standard neuron inertia=\"+c.getNeuro(0).fields.in);\n" 310 "c= LiveLibrary.createFromString(\"X[Nn,e:0.1]\");\n"310 "c=Populations.createFromString(\"X[Nn,e:0.1]\");\n" 311 311 "Simulator.print(\"noisy neuron error rate=\"+c.getNeuro(0).fields.e);\n" 312 312 "\n" 313 313 "The Interface object can be used to discover which fields are available for a certain neuron object:\n" 314 "c= LiveLibrary.createFromString(\"X[N]\");\n"314 "c=Populations.createFromString(\"X[N]\");\n" 315 315 "var iobj=Interface.makeFrom(c.getNeuro(0).fields);\n" 316 316 "var i;\n" … … 318 318 " Simulator.print(iobj.getId(i)+\" (\"+iobj.getName(i)+\")\");",}, 319 319 {"def",0,0,"Neuron definition from which this live neuron was built","o NeuroDef",GETONLY(neurodef),}, 320 {"classObject",0,0,"Neuron class for this neuron","o NeuroClass",GETONLY(classObject),}, 320 321 #ifdef NEURO_SIGNALS 321 322 {"signals",0,PARAM_READONLY,"Signals","o NeuroSignals",FIELD(sigs_obj),}, … … 332 333 333 334 #define FIELDSTRUCT NeuroSignals 334 {"add",0,PARAM_NOSTATIC," add","p(s channel)",PROCEDURE(p_add),"Create a new signal"},335 {"receive",0,PARAM_NOSTATIC," receive","p f(s channel)",PROCEDURE(p_receive),"Receive the aggregated signal power in a given channel."},336 {"receiveSet",0,PARAM_NOSTATIC," receive","p oVector(s channel,f max distance)",PROCEDURE(p_receiveSet),"Get all signals in the specified range. Returns a readonly vector object containing Signal objects (individual signals can be accessed as result[0] throught result[result.size-1])."},335 {"add",0,PARAM_NOSTATIC,"Add","p(s channel)",PROCEDURE(p_add),"Create a new signal"}, 336 {"receive",0,PARAM_NOSTATIC,"Receive","p f(s channel)",PROCEDURE(p_receive),"Receive the aggregated signal power in a given channel."}, 337 {"receiveSet",0,PARAM_NOSTATIC,"Receive","p oVector(s channel,f max distance)",PROCEDURE(p_receiveSet),"Get all signals in the specified range. Returns a readonly vector object containing Signal objects (individual signals can be accessed as result[0] throught result[result.size-1])."}, 337 338 {"receiveFilter",0,PARAM_NOSTATIC,"receive","p f(s channel,f max distance,f flavor,f filter)",PROCEDURE(p_receiveFilter),"Receive the aggregated signal power in a given channel.\n\nAdditional filtering options:\n- Max distance only receives the neighbor signals (based on their physical location)\n- Flavor filtering: only signals having the flavor close to the specified one will be received. The filter value is the maximum allowed difference."}, 338 {"receiveSingle",0,PARAM_NOSTATIC," receive","p oSignal(s channel,f range)",PROCEDURE(p_receiveSingle),"Find the signal source having the highest signal power (including the distance)"},339 {"receiveSingle",0,PARAM_NOSTATIC,"Receive","p oSignal(s channel,f range)",PROCEDURE(p_receiveSingle),"Find the signal source having the highest signal power (including the distance)"}, 339 340 #undef FIELDSTRUCT 340 341 341 342 #define FIELDSTRUCT SignalSet 342 {"get",0,PARAM_NOSTATIC," get","p oSignal(d index)",PROCEDURE(p_get),},343 {"size",0,1+PARAM_NOSTATIC," size","d",GETONLY(size),},344 {"clear",0,1+PARAM_NOSTATIC," clear","p()",PROCEDURE(p_clear),},343 {"get",0,PARAM_NOSTATIC,"Get","p oSignal(d index)",PROCEDURE(p_get),}, 344 {"size",0,1+PARAM_NOSTATIC,"Size","d",GETONLY(size),}, 345 {"clear",0,1+PARAM_NOSTATIC,"Clear","p()",PROCEDURE(p_clear),}, 345 346 #undef FIELDSTRUCT 346 347 {0,0,0,}, … … 383 384 void NeuroSignals::p_add(PARAMPROCARGS) 384 385 { 385 if (!owner->owner->channels) {ret->setEmpty();return;}386 SigChannel *ch=owner->owner->channels->getChannel(args->getString(),true);387 386 SigSource *s=new NeuroSigSource(owner,getCreature()); 388 ch->addSource(s); 387 if (owner->owner->channels) 388 { 389 SigChannel *ch=owner->owner->channels->getChannel(args->getString(),true); 390 ch->addSource(s); 391 } 392 else 393 SigChannel::dummy_channel.addSource(s); 389 394 sigs+=s; 390 395 s->setupObject(ret); … … 522 527 } 523 528 529 void NeuroImpl::get_classObject(ExtValue *ret) 530 { 531 NeuroClassExt::makeStaticObject(ret,neuroclass); 532 } 533 524 534 NeuroImpl::~NeuroImpl() 525 535 { -
cpp/gdk/neuroimpl.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _NEUROIMPL_H_ … … 195 195 /** originating neuron object (from the model) */ 196 196 Neuro *neuro; 197 NeuroClass *neuroclass; 197 198 /** don't access directly */ 198 199 double newstate; … … 294 295 PARAMGETDEF(fields); 295 296 PARAMGETDEF(neurodef); 297 PARAMGETDEF(classObject); 296 298 #undef STATRICKCLASS 297 299 }; -
cpp/gdk/neuroimplfiles.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "neuroimpl-simple.h" -
cpp/gdk/neurolibrary.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "neurolibrary.h" -
cpp/gdk/neurolibrary.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _NILIBRARY_H_ -
cpp/gdk/neurotest.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "geno.h" -
cpp/gdk/nonstd.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams.alife.pl/ for further information.4 5 1 //Define rnd01, rnd0N, and randomN so that they 6 2 //work in your C++ environment. … … 96 92 #endif 97 93 94 #ifdef DEFINE_STRICMP_AS_STRCASECMP 95 #define stricmp(a,b) strcasecmp(a,b) 98 96 #endif 97 98 #endif -
cpp/gdk/nonstd_io.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams.alife.pl/ for further information.4 5 1 // int access(const char *pathname, int mode); 6 2 #ifdef _Windows 7 3 #include <dir.h> 8 #include <io.h> //include io.h przed dir.h powoduje ze w simul.h nie poznaje klasy SimWorld - szokujacy i niewyjasniony blad. 4 #include <io.h> //include io.h przed dir.h powoduje ze w simul.h nie poznaje klasy SimWorld - szokujacy i niewyjasniony blad. co wiecej w projekcie GUI go nie ma a w CLI jest - moze wplyw tych globalnych definicji typu NOVCL, NO_STRICT itp? 9 5 #define makeDirectory(name) mkdir(name) 10 6 #else -
cpp/gdk/param.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include <stdio.h> -
cpp/gdk/param.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _PARAM_H_ -
cpp/gdk/paramobj.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "paramobj.h" -
cpp/gdk/paramobj.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _PARAMOBJ_H_ -
cpp/gdk/paramtabobj.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "paramtabobj.h" -
cpp/gdk/paramtabobj.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _PARAMTABOBJ_H_ -
cpp/gdk/printconvmap.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "printconvmap.h" -
cpp/gdk/printconvmap.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _PRINTCONVMAP_H_ -
cpp/gdk/sstring.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 -
cpp/gdk/sstring.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _SSTRING_H_ -
cpp/gdk/sstringutils.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "sstringutils.h" … … 233 233 } 234 234 235 SString trim(SString& s) 236 { 237 const unsigned char*b=(const unsigned char*)(const char*)s; 238 const unsigned char*e=b+s.len(); 239 while((b<e)&&(*b<=' ')) b++; 240 while((b<e)&&(e[-1]<=' ')) e--; 241 if ((e-b)==s.len()) return s; 242 SString newstring; 243 char* t=newstring.directWrite(); 244 memmove(t,b,e-b); 245 newstring.endWrite(e-b); 246 return newstring; 247 } -
cpp/gdk/sstringutils.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _SSTRINGUTILS_H_ … … 25 25 void strSetField(SString& txt,const SString& name,const SString& value); 26 26 27 SString trim(SString& s); //remove leading/trailing whitespace 28 27 29 #endif 28 30 -
cpp/gdk/statrick.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _STATRICK_H_ -
cpp/gdk/stdiofile-autoinit.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "stdiofile.h" -
cpp/gdk/stdiofile.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "stdiofile.h" -
cpp/gdk/stdiofile.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _STDIOFILE_H_ -
cpp/gdk/stdouterr.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "stdouterr.h" -
cpp/gdk/stdouterr.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _STDOUTERRORHANDLER_H_ -
cpp/gdk/syntparam.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "nonstd.h" -
cpp/gdk/syntparam.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _SYNTPATAM_H_ -
cpp/gdk/usertags.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _USERTAGS_H_ -
cpp/gdk/virtfile.cpp
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #include "virtfile.h" -
cpp/gdk/virtfile.h
r5 r64 1 // This file is a part of Framsticks GDK library.2 // Copyright (C) 2002-20 06Szymon Ulatowski. See LICENSE.txt for details.3 // Refer to http://www.frams .alife.pl/ for further information.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 4 5 5 #ifndef _VIRTFILE_H_ -
cpp/geno_fx/geno_ftest.cpp
r3 r64 1 // This file is a part of Framsticks GenoFX library.2 // Copyright (C) 2002-20 09Maciej Komosinski. See LICENSE.txt for details.1 // This file is a part of the Framsticks GenoFX library. 2 // Copyright (C) 2002-2011 Maciej Komosinski. See LICENSE.txt for details. 3 3 // Refer to http://www.framsticks.com/ for further information. 4 4 -
cpp/geno_fx/geno_ftest.h
r3 r64 1 // This file is a part of Framsticks GenoFX library.2 // Copyright (C) 2002-20 09Maciej Komosinski. See LICENSE.txt for details.1 // This file is a part of the Framsticks GenoFX library. 2 // Copyright (C) 2002-2011 Maciej Komosinski. See LICENSE.txt for details. 3 3 // Refer to http://www.framsticks.com/ for further information. 4 4 -
cpp/geno_fx/geno_fx.cpp
r31 r64 1 // This file is a part of Framsticks GenoFX library.2 // Copyright (C) 2002-20 09Maciej Komosinski. See LICENSE.txt for details.1 // This file is a part of the Framsticks GenoFX library. 2 // Copyright (C) 2002-2011 Maciej Komosinski. See LICENSE.txt for details. 3 3 // Refer to http://www.framsticks.com/ for further information. 4 4 … … 55 55 double Geno_fx::mutateNeuProperty(double current,Neuro *n,int i) 56 56 { 57 if (i==-1) return mutateCreepNoLimit('f',current,-10,10); 57 if (i==-1) return mutateCreepNoLimit('f',current,-10,10); //i==-1: mutating weight of neural connection 58 58 ParamInterface *pi; 59 59 if (i>=100) {i-=100; pi=&n->getClass()->getProperties();} -
cpp/geno_fx/geno_fx.h
r31 r64 1 // This file is a part of Framsticks GenoFX library.2 // Copyright (C) 2002-20 09Maciej Komosinski. See LICENSE.txt for details.1 // This file is a part of the Framsticks GenoFX library. 2 // Copyright (C) 2002-2011 Maciej Komosinski. See LICENSE.txt for details. 3 3 // Refer to http://www.framsticks.com/ for further information. 4 4
Note: See TracChangeset
for help on using the changeset viewer.