Changeset 64


Ignore:
Timestamp:
01/28/11 23:29:40 (13 years ago)
Author:
Maciej Komosinski
Message:

a lot of minor fixes

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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#include <math.h>
  • cpp/gdk/3d.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _3D_H_
  • cpp/gdk/advlist.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.
     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.
    44
    55#include <stdlib.h>
  • cpp/gdk/advlist.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _ADVLIST_H_
  • cpp/gdk/callbacks.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.
     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.
    44
    55#include "callbacks.h"
  • cpp/gdk/callbacks.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _CALLBACKS_H_
  • cpp/gdk/conv_f1.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.
     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.
    44
    55#include "conv_f1.h"
     
    4848void addOrRememberInput(int n1,int n2,float w)
    4949                {
    50                 if (!addInput(n1,n2,w,false))
    51                         connections+=Connection(n1,n2,w);
     50                //if (!addInput(n1,n2,w,false))
     51                connections+=Connection(n1,n2,w);
    5252                }
    5353bool addInput(int n1,int n2,float w,bool final)
     
    270270}
    271271
    272 // remove leading & trailing whitespaces
    273 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 
    285272const char* Builder::growNeuro(const char* t, F1Props& props,int &hasmuscles)
    286273{
     
    346333                                haveclass=1;
    347334                                SString clsname(begin,t-begin);
    348                                 trim(clsname);
     335                                clsname=trim(clsname);
    349336                                last_f1_neuro->setClassName(clsname);
    350337                                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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _CONV_F1_H
     
    6464GenoConv_F1()
    6565        {
    66         name="f1 converter";
     66        name="Recursive encoding";
    6767        in_format='1';
    6868        mapsupport=1;
    69         info="Original Framsticks genotype format";
    7069        }
    7170SString 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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55
  • cpp/gdk/defassign-f0_neuro.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55
  • cpp/gdk/defassign-f0_neuroconn.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55
  • cpp/gdk/defassign-f0_part.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55
  • 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 
    51#include "defgenoconv.h"
    62
     
    3228#endif
    3329#ifdef USE_GENCONV_F81
    34 #include "conv_f8.h"
     30#include "conv_f8tof1.h"
    3531#endif
    3632
     
    6258#endif
    6359#ifdef USE_GENCONV_F81
    64 addConverter(new GenoConv_F81);
     60GenoConv_F8ToF1 *gc81=new GenoConv_F8ToF1();
     61GenoConv_F8ToF1::staticpar=gc81->par; //a trick so that the simulator can see this parama
     62addConverter(gc81);
    6563#endif
    6664
  • cpp/gdk/defgenoconv.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _DEFGENOCONV_H_
  • cpp/gdk/errmanager.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.
     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.
    44
    55#include "errmanager.h"
     
    9090{
    9191if (w>maxlevel) maxlevel=w;
     92if (w>=FMLV_INFO) infocount++;
    9293if (w>=FMLV_WARN) warncount++;
    9394if (w>=FMLV_ERROR) errcount++;
  • cpp/gdk/errmanager.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _ERRMANAGER_H_
     
    6464{
    6565  protected:
    66 int maxlevel,errcount,warncount,storlevel,storcount;
     66int maxlevel,errcount,warncount,storlevel,storcount,infocount;
    6767SString msgs;
    6868
    6969  public:
    7070
    71 void reset() {maxlevel=FMLV_INFO-1; errcount=warncount=storcount=0; msgs=0;}
     71void reset() {maxlevel=FMLV_INFO-1; errcount=warncount=storcount=infocount=0; msgs=0;}
    7272
    7373enum Options2
     
    7676int getErrorCount()       {return errcount;}
    7777int getWarningCount()     {return warncount;}
     78int getInfoCount()        {return infocount;}
    7879int getStoredCount()      {return storcount;}
    7980int getErrorLevel()       {return maxlevel;}
  • cpp/gdk/extvalue.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.
     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.
    44
    55#include "extvalue.h"
     
    2020        SString tmp("<");
    2121        tmp+=p->getName();
    22         sprintf(tmp.directAppend(30)," object at %p>",object);
     22        sprintf(tmp.directAppend(30)," object at %p>",
     23                (object?object:paraminterface));
    2324        tmp.endAppend();
    2425        return tmp;
     
    3637        case TDouble: setd(src.ddata()); break;
    3738        case TObj: seto(src.odata()); break;
     39        case TInvalid: type=TInvalid; break;
    3840        }
    3941}
     
    284286        case TObj:
    285287                return odata().toString();
     288        case TInvalid:
     289                return SString("undefined");
    286290        default:
    287291                return SString("null");
  • cpp/gdk/extvalue.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _EXTVALUE_H_
     
    1313
    1414enum ExtPType
    15 {TUnknown=0,TInt,TDouble,TString,TObj};
     15{TUnknown=0,TInt,TDouble,TString,TObj,TInvalid};
    1616
    1717/**
     
    114114        :type(TUnknown) {set(src);}
    115115void setEmpty();
     116void setInvalid() {setEmpty();type=TInvalid;}
    116117ExtPType getType() {return type;}
    117118void *getObjectTarget(const char* classname) {return (type==TObj)?getObject().getTarget(classname):0;}
  • cpp/gdk/f0-modeldef.m4

    r5 r64  
    66define(`AtSecondPart',`8')
    77define(`InTheMiddle',`12')
    8 define(`MuscleClass',`16')
     8define(`EffectorClass',`16')
    99define(`ReceptorClass',`32')
    1010define(`V1BendMuscle',`64')
  • cpp/gdk/f0.def

    r5 r64  
    6666PROP(getInputNeuroIndex,0,1+2,`get input neuron index',p d(d),,,,p_getInputNeuroIndex,PROCEDURE)
    6767PROP(getInputWeight,0,1+2,`get input weight',p f(d),,,,p_getInputWeight,PROCEDURE)
     68PROP(classObject,0,1+2,`neuron class',o NeuroClass,,,,classObject,GETONLY)
    6869ENDCLASS
    6970
     
    100101VISUALHINTS(ReceptorClass)
    101102SYMBOL(`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')
     103NEUROPROP(r,1,0,Range,f,0.0,1.0,1.0,range)
    102104ENDNEUROCLASS
    103105
     
    109111NEUROCLASS(Const,*,Constant,Constant value,0,1,0)
    110112VISUALHINTS(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')
     113SYMBOL(`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')
    112114ENDNEUROCLASS
    113115
    114116NEUROCLASS(BendMuscle,|,Bend muscle,,1,0,2)
    115 VISUALHINTS(DontShowClass+MuscleClass+V1BendMuscle+AtFirstPart)
     117VISUALHINTS(DontShowClass+EffectorClass+V1BendMuscle+AtFirstPart)
    116118SYMBOL(`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')
    117119NEUROPROP(p,0,0,power,f,0.01,1.0,0.25,power)
     
    120122
    121123NEUROCLASS(RotMuscle,@,Rotation muscle,,1,0,2)
    122 VISUALHINTS(DontShowClass+MuscleClass+V1RotMuscle+AtFirstPart)
     124VISUALHINTS(DontShowClass+EffectorClass+V1RotMuscle+AtFirstPart)
    123125SYMBOL(`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')
    124126NEUROPROP(p,0,0,power,f,0.01,1.0,1.0,power)
     
    126128
    127129NEUROCLASS(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)
     130SYMBOL(`3,3,25,0,25,100,75,50,25,0,1,75,50,100,50,3,44,42,51,57,36,57,44,42')
    128131ENDNEUROCLASS
    129132
    130 NEUROCLASS(FuzzyNeuro,Fuzzy,Fuzzy system [EXPERIMENTAL!],Refer to publications to learn about this neuron,-1,1,0)
     133NEUROCLASS(FuzzyNeuro,Fuzzy,Fuzzy system [EXPERIMENTAL!],Refer to publications to learn more about this neuron.,-1,1,0)
    131134SYMBOL(`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')
    132135NEUROPROP(ns,0,0,number of fuzzy sets,d,1,,,fuzzySetsNr)
     
    136139ENDNEUROCLASS
    137140
     141NEUROCLASS(VectorEye,VEye,Vector Eye [EXPERIMENTAL!],Refer to publications to learn more about this neuron.,1,1,1)
     142SYMBOL(`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')
     143NEUROPROP(tx,0,0,target.x,f,,,,target.x)
     144NEUROPROP(ty,0,0,target.y,f,,,,target.y)
     145NEUROPROP(tz,0,0,target.z,f,,,,target.z)
     146NEUROPROP(ts,0,0,target shape,s,0,-1,0,targetShape)
     147NEUROPROP(p,0,0,perspective,f,0.1,10.0,1.0,perspz)
     148NEUROPROP(s,0,0,scale,f,0.1,100.0,1.0,perspscale)
     149NEUROPROP(h,0,0,show hidden lines,d,0,1,0,showhidden)
     150NEUROPROP(o,0,0,`output lines count (each line needs four channels)',d,0,99,0,outputcount)
     151NEUROPROP(d,0,0,debug,d,0,1,0,showdebug)
     152ENDNEUROCLASS
     153
     154NEUROCLASS(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)
     155NEUROPROP(noIF,0,0,number of basic features,d,,,,noIF)
     156NEUROPROP(noDim,0,0,number of degrees of freedom,d,,,,noDim)
     157NEUROPROP(params,0,0,parameters,s,,,,params)
     158ENDNEUROCLASS
     159
    138160NEUROCLASS(Sticky,Sti,Sticky [EXPERIMENTAL!],,1,0,1)
    139 VISUALHINTS(ReceptorClass)
     161VISUALHINTS(EffectorClass)
    140162ENDNEUROCLASS
    141163
    142164NEUROCLASS(LinearMuscle,LMu,Linear muscle [EXPERIMENTAL!],,1,0,2)
    143 VISUALHINTS(MuscleClass)
     165VISUALHINTS(EffectorClass)
    144166NEUROPROP(p,0,0,power,f,0.01,1.0,1.0,power)
    145167ENDNEUROCLASS
     
    154176
    155177NEUROCLASS(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)
     178SYMBOL(`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')
    156179ENDNEUROCLASS
    157180
    158181NEUROCLASS(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)
     182SYMBOL(`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')
    159183ENDNEUROCLASS
    160184
    161185NEUROCLASS(ChSel,ChSel,Channel selector,`Outputs a single channel (selected by the \"ch\" parameter) from multichannel input',1,1,0)
     186SYMBOL(`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')
    162187NEUROPROP(ch,0,0,channel,d,,,,ch)
    163188ENDNEUROCLASS
     
    171196NEUROPROP(t,0,0,time,f,0,6.283185307,0,t)
    172197ENDNEUROCLASS
     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 
    51
    62#define FIELDSTRUCT Part
     
    10096ParamEntry f0_neuro_paramtab[]=
    10197{
    102  {"Connections",3,9,"n" },
     98 {"Connections",3,10,"n" },
    10399 {"Other",},
    104100 {"Visual",},
     
    112108 {"getInputNeuroIndex",0,1+2,"get input neuron index","p d(d)",PROCEDURE(p_getInputNeuroIndex),},
    113109 {"getInputWeight",0,1+2,"get input weight","p f(d)",PROCEDURE(p_getInputWeight),},
     110 {"classObject",0,1+2,"neuron class","o NeuroClass",GETONLY(classObject),},
    114111 {0,0,0,}
    115112};
     
    159156
    160157
     158
     159
     160
  • cpp/gdk/f0def.xml

    r5 r64  
    5757  <PROP ID="getInputNeuroIndex" NAME="get input neuron index" GROUP="0" FLAGS="1+2" TYPE="p d(d)" />
    5858  <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" />
    5960 </CLASS>
    6061
     
    9192
    9293
     94  <NEUROPROP ID="r" NAME="Range" TYPE="f" MIN="0.0" MAX="1.0" DEF="1.0" />
    9395 </NEUROCLASS>
    9496
     
    98100 </NEUROCLASS>
    99101
    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"  >
    101103
    102104
     
    116118 </NEUROCLASS>
    117119
    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
    119122 </NEUROCLASS>
    120123
    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"  >
    122125
    123126  <NEUROPROP ID="ns" NAME="number of fuzzy sets" TYPE="d" MIN="1" MAX="" DEF="" />
     
    127130 </NEUROCLASS>
    128131
    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"  >
    130152
    131153 </NEUROCLASS>
     
    144166 </NEUROCLASS>
    145167
    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
    147170 </NEUROCLASS>
    148171
    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
    150174 </NEUROCLASS>
    151175
    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
    153178  <NEUROPROP ID="ch" NAME="channel" TYPE="d" MIN="" MAX="" DEF="" />
    154179 </NEUROCLASS>
     
    163188 </NEUROCLASS>
    164189
     190
    165191</F0CLASSES>
  • cpp/gdk/f0defxml.m4

    r5 r64  
    66define(`AtSecondPart',`8')
    77define(`InTheMiddle',`12')
    8 define(`MuscleClass',`16')
     8define(`EffectorClass',`16')
    99define(`ReceptorClass',`32')
    1010define(`V1BendMuscle',`64')
  • cpp/gdk/framsg.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.
     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.
    44
    55#include "nonstd.h"
  • cpp/gdk/framsg.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _FRAMSG_H_
  • cpp/gdk/gdktest.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.
     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.
    44
    55#include <stdlib.h>
     
    249249}
    250250
     251void findingConverters()
     252{
     253GenoConverter *gc=gcm.findConverters(0,'1');
     254if (gc) printf("found converter accepting f1: \"%s\"\n",gc->name);
     255SListTempl<GenoConverter*> found;
     256gcm.findConverters(&found,-1,'0');
     257printf("found %d converter(s) producing f0\n",found.size());
     258}
     259
    251260int main(int argc,char*argv[])
    252261{
    253262srand(time(0));
    254263printNiceBanner("Welcome to GDK test application!");
     264
     265findingConverters();
    255266
    256267//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.
    43
    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.
    74
    85/**
  • cpp/gdk/geno.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.
     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.
    44
    55#include "geno.h"
     
    173173        else
    174174                out+="/*";
    175         out+=format;
     175        if (format==0)
     176                out+="invalid";
     177        else
     178                out+=format;
    176179        if (multiline)
    177180                out+="\n";
  • cpp/gdk/geno.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _GENO_H_
  • cpp/gdk/genoconv.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.
     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.
    44
    55#include "nonstd.h"
     
    4949tab[0].flags=ile;
    5050tab[0].name="gkparam:";
     51gcnames.clear();
    5152for (i=0,pe=tab+1;gk=(GenoConverter *)gcm->converters(i);pe++,i++)
    5253        {
     
    5455        pe->group=0;
    5556        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();
    5765        pe->type="d 0 1";
    5866        pe->help=gk->info;
     
    96104converters-=gc;
    97105param.updatetab();
     106}
     107
     108GenoConverter *GenoConvManager::findConverters(SListTempl<GenoConverter*>* result,char in,char out,int enabled,char* name)
     109{
     110GenoConverter *gk,*retval=0;
     111int i=0;
     112for (;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        }
     121return retval;
    98122}
    99123
  • cpp/gdk/genoconv.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _GENCONV_H_
     
    1111#include "sstring.h"
    1212
     13#include <string>
     14#include <vector>
     15
    1316
    1417class GenoConvManager;
     
    1720{
    1821GenoConvManager *gcm;
     22std::vector<std::string> gcnames;
    1923void freetab();
    2024public:
     
    8993char *getPath(char in,char out,char *path,int maxlen,int *mapavailable=0);
    9094char *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
     98GenoConverter *findConverters(SListTempl<GenoConverter*>* result=0,char in=-1,char out=-1,int enabled=-1,char* name=0);
    9199};
    92100
  • cpp/gdk/genotest.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.
     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.
    44
    55#include "geno.h"
  • cpp/gdk/genotypeloader.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.
     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.
    44
    55#include "genotypeloader.h"
  • cpp/gdk/genotypeloader.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _GENOTYPELOADER_H_
  • cpp/gdk/list.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.
     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.
    44
    55#include <stdlib.h>
  • cpp/gdk/list.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _LIST_H_
  • cpp/gdk/loadertest.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.
     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.
    44
    55#include "genotypeloader.h"
  • cpp/gdk/model.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.
     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.
    44
    55#include "nonstd.h"
     
    960960                        }
    961961                        }
    962                 if (final) if (j->d()>getMaxJoint().d.x)
     962                if (final)
     963                        {
     964                        if (j->d()>getMaxJoint().d.x)
    963965                        {
    964966                        ret=0;
    965967                        FMprintf("Model","internalCheck",FMLV_ERROR,"delta too big in joint #%d (%s)",
    966968                                 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                        }
    967976                        }
    968977                }
     
    12591268class MaxNeuro: public Neuro {public: MaxNeuro() {Param par(f0_neuro_paramtab,this);par.setMax();}};
    12601269
    1261 const Part& Model::getMinPart() {static MinPart part; return part;}
    1262 const Part& Model::getMaxPart() {static MaxPart part; return part;}
    1263 const Part& Model::getDefPart() {static Part part; return part;}
    1264 const Joint& Model::getMinJoint() {static MinJoint joint; return joint;}
    1265 const Joint& Model::getMaxJoint() {static MaxJoint joint; return joint;}
    1266 const Joint& Model::getDefJoint() {static Joint joint; return joint;}
    1267 const Neuro& Model::getMinNeuro() {static MinNeuro neuro; return neuro;}
    1268 const Neuro& Model::getMaxNeuro() {static MaxNeuro neuro; return neuro;}
    1269 const Neuro& Model::getDefNeuro() {static Neuro neuro; return neuro;}
     1270Part& Model::getMinPart() {static MinPart part; return part;}
     1271Part& Model::getMaxPart() {static MaxPart part; return part;}
     1272Part& Model::getDefPart() {static Part part; return part;}
     1273Joint& Model::getMinJoint() {static MinJoint joint; return joint;}
     1274Joint& Model::getMaxJoint() {static MaxJoint joint; return joint;}
     1275Joint& Model::getDefJoint() {static Joint joint; return joint;}
     1276Neuro& Model::getMinNeuro() {static MinNeuro neuro; return neuro;}
     1277Neuro& Model::getMaxNeuro() {static MaxNeuro neuro; return neuro;}
     1278Neuro& Model::getDefNeuro() {static Neuro neuro; return neuro;}
  • cpp/gdk/model.def

    r5 r64  
    9393
    9494
     95prop:id=r,name="Range",type="f 0.0 1.0 1.0"
    9596
    9697
     
    129130
    130131
     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
    131151neuro: id=Sti,name="Sticky [EXPERIMENTAL!]",info="",inputs=1,output=0,location=1  ,vhints=32
    132152
    133153
    134154
    135 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
    136156
    137157prop: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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _MODEL_H_
     
    408408///////////////////////////
    409409
    410 static const Part& getMinPart();
    411 static const Part& getMaxPart();
    412 static const Part& getDefPart();
    413 static const Joint& getMinJoint();
    414 static const Joint& getMaxJoint();
    415 static const Joint& getDefJoint();
    416 static const Neuro& getMinNeuro();
    417 static const Neuro& getMaxNeuro();
    418 static const Neuro& getDefNeuro();
     410static Part& getMinPart();
     411static Part& getMaxPart();
     412static Part& getDefPart();
     413static Joint& getMinJoint();
     414static Joint& getMaxJoint();
     415static Joint& getDefJoint();
     416static Neuro& getMinNeuro();
     417static Neuro& getMaxNeuro();
     418static Neuro& getDefNeuro();
    419419};
    420420
  • cpp/gdk/modelparts.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.
     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.
    44
    55#include <stdlib.h>
     
    2121#include "multirange.h"
    2222#include "extvalue.h"
     23
     24#include "neuroclsobject.h"
    2325
    2426template<>
     
    524526}
    525527
     528void Neuro::get_classObject(PARAMGETARGS)
     529{
     530NeuroClassExt::makeStaticObject(ret,getClass());
     531}
     532
    526533/////// old items
    527534#ifdef MODEL_V1_COMPATIBLE
  • cpp/gdk/modelparts.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _MODELPARTS_H_
     
    241241        /** draw the neuron at the second part when attached to joint (default is in the middle) */
    242242   AtSecondPart=8,
    243         /** use muscle colour for this neuro unit */
    244    MuscleClass=16,
     243        /** use effector colour for this neuro unit */
     244   EffectorClass=16,
    245245        /** use receptor colour for this neuro unit */
    246246   ReceptorClass=32,
    247247   V1BendMuscle=64,
    248    V1RotMuscle=128
     248   V1RotMuscle=128,
    249249 };
    250250
     
    349349PARAMPROCDEF(p_getInputNeuroIndex);
    350350PARAMPROCDEF(p_getInputWeight);
     351PARAMGETDEF(classObject);
    351352#undef STATRICKCLASS
    352353
  • cpp/gdk/multimap.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.
     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.
    44
    55#include "multimap.h"
  • cpp/gdk/multimap.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _MULTIMAP_H_
  • cpp/gdk/multiparamload.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.
     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.
    44
    55#include "multiparamload.h"
     
    105105                {
    106106                lastclass->load(file);
    107                 if (maybeBreak(AfterObject))
     107                if ((status!=Finished) && maybeBreak(AfterObject))
    108108                        break;
    109109                continue;
     
    144144                        continue;
    145145                        }
    146                 else if (maybeBreak(OnComment))
     146                else if ((status!=Finished) && maybeBreak(OnComment))
    147147                        {
    148148                        lastcomment=t+1;
  • cpp/gdk/multiparamload.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _MULTIPARAMLOAD_H_
  • cpp/gdk/multirange.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.
     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.
    44
    55#include "multirange.h"
  • cpp/gdk/multirange.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _MULTIRANGE_H_
  • cpp/gdk/neuroclasses.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55CLASS(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 
    51
    62// do not edit - generated automatically from "f0.def"
     
    3935#define FIELDSTRUCT NI_Touch
    4036ParamEntry 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),},
    4239 {0,0,0,},};
    4340#undef FIELDSTRUCT
     
    8582 {0,0,0,},};
    8683#undef FIELDSTRUCT
     84
     85#define FIELDSTRUCT NI_VectorEye
     86ParamEntry 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
     101ParamEntry 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
    87108
    88109#define FIELDSTRUCT NI_Sticky
     
    144165#undef FIELDSTRUCT
    145166
     167
    146168#define SETIMPLEMENTATION \
    147169setImplementation("N",new NI_StdNeuron); \
     
    155177setImplementation("D",new NI_Diff); \
    156178setImplementation("Fuzzy",new NI_FuzzyNeuro); \
     179setImplementation("VEye",new NI_VectorEye); \
     180setImplementation("VMotor",new NI_VisualMotorNeuron); \
    157181setImplementation("Sti",new NI_Sticky); \
    158182setImplementation("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 
    51
    62// do not edit - generated automatically from "f0.def"
     
    4541     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};   
    4642static 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",},
    5047 
    5148{0,0,0,},};
     
    6158addClass(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));
    6259
    63      static int Const_xy[]={26,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};   
    6461static ParamEntry NI_Const_tab[]={
    6562{"Constant",1, 0 ,"*",},
     
    9188addClass(new NeuroClass(NI_RotMuscle_tab,"",1,0,2, RotMuscle_xy,0,2+16+128+4));
    9289
    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};   
    9491static ParamEntry NI_Diff_tab[]={
    9592{"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,},};
     96addClass(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));
    9997
    10098     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};   
     
    108106 
    109107{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));
     108addClass(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};   
     111static 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,},};
     125addClass(new NeuroClass(NI_VectorEye_tab,"Refer to publications to learn more about this neuron.",1,1,1, VectorEye_xy,0,0));
     126
     127     
     128static 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,},};
     135addClass(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));
    111136
    112137     
     
    116141 
    117142{0,0,0,},};
    118 addClass(new NeuroClass(NI_Sticky_tab,"",1,0,1, 0,32));
     143addClass(new NeuroClass(NI_Sticky_tab,"",1,0,1, 0,16));
    119144
    120145     
     
    143168addClass(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));
    144169
    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};   
    146171static ParamEntry NI_Channelize_tab[]={
    147172{"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,},};
     176addClass(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};   
    153179static ParamEntry NI_ChMux_tab[]={
    154180{"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,},};
     184addClass(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};   
    160187static ParamEntry NI_ChSel_tab[]={
    161188{"Channel selector",1, 1 ,"ChSel",},
     189
    162190{"ch",0,0,"channel","d   ",},
    163191 
    164192{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));
     193addClass(new NeuroClass(NI_ChSel_tab,"Outputs a single channel (selected by the \"ch\" parameter) from multichannel input",1,1,0, ChSel_xy,0,0));
    166194
    167195     
     
    181209{0,0,0,},};
    182210addClass(new NeuroClass(NI_Sinus_tab,"Output frequency = f0+input",1,1,0, Sinus_xy,0,0));
     211
  • cpp/gdk/neurocls-library.m4

    r5 r64  
    1515define(`AtSecondPart',`8')
    1616define(`InTheMiddle',`12')
    17 define(`MuscleClass',`16')
     17define(`EffectorClass',`16')
    1818define(`ReceptorClass',`32')
    1919define(`V1BendMuscle',`64')
  • cpp/gdk/neurofactory.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.
     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.
    44
    55#include "neurofactory.h"
     
    1717NeuroImpl* ni=(NeuroImpl*)nc->impl;
    1818if (!ni) return 0;
    19 return ni->makeNew();
     19ni=ni->makeNew();
     20if (ni) ni->neuroclass=nc;
     21return ni;
    2022}
    2123
  • cpp/gdk/neurofactory.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#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.
    84
    95#ifndef _NEUROIMPLBODY_H_
  • cpp/gdk/neuroimpl-channels.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.
     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.
    44
    55#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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55/// 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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55/// 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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _NEUROIMPLFUZZY_H_
  • cpp/gdk/neuroimpl-simple.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.
     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.
    44
    55#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-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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _NEUROIMPLSIMPLE_H_
  • cpp/gdk/neuroimpl.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.
     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.
    44
    55#include "neuroimpl.h"
     
    2323{
    2424{"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."},
    2626{"touchrange",1,0,"T receptor range","f 0 100 1",FIELD(touchrange),},
    2727{0,0,0,},
     
    277277ParamEntry neuroimpl_tab[]=
    278278{
    279 {"Neuro",1,26+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,"get 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),
     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),
    306306"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"
    307307"Examples:\n"
    308 "var c=LiveLibrary.createFromString(\"X[N]\");\n"
     308"var c=Populations.createFromString(\"X[N]\");\n"
    309309"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"
    311311"Simulator.print(\"noisy neuron error rate=\"+c.getNeuro(0).fields.e);\n"
    312312"\n"
    313313"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"
    315315"var iobj=Interface.makeFrom(c.getNeuro(0).fields);\n"
    316316"var i;\n"
     
    318318" Simulator.print(iobj.getId(i)+\" (\"+iobj.getName(i)+\")\");",},
    319319{"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),},
    320321#ifdef NEURO_SIGNALS
    321322{"signals",0,PARAM_READONLY,"Signals","o NeuroSignals",FIELD(sigs_obj),},
     
    332333
    333334#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])."},
    337338{"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)"},
    339340#undef FIELDSTRUCT
    340341
    341342#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),},
    345346#undef FIELDSTRUCT
    346347{0,0,0,},
     
    383384void NeuroSignals::p_add(PARAMPROCARGS)
    384385{
    385 if (!owner->owner->channels) {ret->setEmpty();return;}
    386 SigChannel *ch=owner->owner->channels->getChannel(args->getString(),true);
    387386SigSource *s=new NeuroSigSource(owner,getCreature());
    388 ch->addSource(s);
     387if (owner->owner->channels)
     388        {
     389        SigChannel *ch=owner->owner->channels->getChannel(args->getString(),true);
     390        ch->addSource(s);
     391        }
     392else
     393        SigChannel::dummy_channel.addSource(s);
    389394sigs+=s;
    390395s->setupObject(ret);
     
    522527}
    523528
     529void NeuroImpl::get_classObject(ExtValue *ret)
     530{
     531NeuroClassExt::makeStaticObject(ret,neuroclass);
     532}
     533
    524534NeuroImpl::~NeuroImpl()
    525535{
  • cpp/gdk/neuroimpl.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _NEUROIMPL_H_
     
    195195/** originating neuron object (from the model) */
    196196Neuro *neuro;
     197NeuroClass *neuroclass;
    197198/** don't access directly */
    198199double newstate;
     
    294295PARAMGETDEF(fields);
    295296PARAMGETDEF(neurodef);
     297PARAMGETDEF(classObject);
    296298#undef STATRICKCLASS
    297299};
  • cpp/gdk/neuroimplfiles.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#include "neuroimpl-simple.h"
  • cpp/gdk/neurolibrary.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.
     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.
    44
    55#include "neurolibrary.h"
  • cpp/gdk/neurolibrary.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _NILIBRARY_H_
  • cpp/gdk/neurotest.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.
     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.
    44
    55#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 
    51//Define rnd01, rnd0N, and randomN so that they
    62//work in your C++ environment.
     
    9692#endif
    9793
     94#ifdef DEFINE_STRICMP_AS_STRCASECMP
     95#define stricmp(a,b) strcasecmp(a,b)
    9896#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 
    51// int access(const char *pathname, int mode);
    62#ifdef _Windows
    73 #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?
    95 #define makeDirectory(name) mkdir(name)
    106#else
  • cpp/gdk/param.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.
     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.
    44
    55#include <stdio.h>
  • cpp/gdk/param.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _PARAM_H_
  • cpp/gdk/paramobj.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.
     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.
    44
    55#include "paramobj.h"
  • cpp/gdk/paramobj.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _PARAMOBJ_H_
  • cpp/gdk/paramtabobj.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.
     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.
    44
    55#include "paramtabobj.h"
  • cpp/gdk/paramtabobj.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _PARAMTABOBJ_H_
  • cpp/gdk/printconvmap.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.
     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.
    44
    55#include "printconvmap.h"
  • cpp/gdk/printconvmap.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _PRINTCONVMAP_H_
  • cpp/gdk/sstring.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.
     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.
    44
    55
  • cpp/gdk/sstring.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _SSTRING_H_
  • cpp/gdk/sstringutils.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.
     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.
    44
    55#include "sstringutils.h"
     
    233233}
    234234
     235SString trim(SString& s)
     236{
     237const unsigned char*b=(const unsigned char*)(const char*)s;
     238const unsigned char*e=b+s.len();
     239while((b<e)&&(*b<=' ')) b++;
     240while((b<e)&&(e[-1]<=' ')) e--;
     241if ((e-b)==s.len()) return s;
     242SString newstring;
     243char* t=newstring.directWrite();
     244memmove(t,b,e-b);
     245newstring.endWrite(e-b);
     246return newstring;
     247}
  • cpp/gdk/sstringutils.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _SSTRINGUTILS_H_
     
    2525void strSetField(SString& txt,const SString& name,const SString& value);
    2626
     27SString trim(SString& s); //remove leading/trailing whitespace
     28
    2729#endif
    2830
  • cpp/gdk/statrick.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _STATRICK_H_
  • cpp/gdk/stdiofile-autoinit.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.
     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.
    44
    55#include "stdiofile.h"
  • cpp/gdk/stdiofile.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.
     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.
    44
    55#include "stdiofile.h"
  • cpp/gdk/stdiofile.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _STDIOFILE_H_
  • cpp/gdk/stdouterr.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.
     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.
    44
    55#include "stdouterr.h"
  • cpp/gdk/stdouterr.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _STDOUTERRORHANDLER_H_
  • cpp/gdk/syntparam.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.
     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.
    44
    55#include "nonstd.h"
  • cpp/gdk/syntparam.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _SYNTPATAM_H_
  • cpp/gdk/usertags.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#ifndef _USERTAGS_H_
  • cpp/gdk/virtfile.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.
     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.
    44
    55#include "virtfile.h"
  • cpp/gdk/virtfile.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.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#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-2009  Maciej 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.
    33// Refer to http://www.framsticks.com/ for further information.
    44
  • cpp/geno_fx/geno_ftest.h

    r3 r64  
    1 // This file is a part of Framsticks GenoFX library.
    2 // Copyright (C) 2002-2009  Maciej 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.
    33// Refer to http://www.framsticks.com/ for further information.
    44
  • cpp/geno_fx/geno_fx.cpp

    r31 r64  
    1 // This file is a part of Framsticks GenoFX library.
    2 // Copyright (C) 2002-2009  Maciej 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.
    33// Refer to http://www.framsticks.com/ for further information.
    44
     
    5555double Geno_fx::mutateNeuProperty(double current,Neuro *n,int i)
    5656{
    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
    5858   ParamInterface *pi;
    5959   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-2009  Maciej 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.
    33// Refer to http://www.framsticks.com/ for further information.
    44
Note: See TracChangeset for help on using the changeset viewer.