home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / MISC / NERVES.ZIP / 87 / NSDATA.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-05  |  9.4 KB  |  196 lines

  1. #ifndef EXTERN
  2. #define EXTERN extern
  3. #endif
  4. EXTERN enum asc_val {CTRLD=4,TAB=9,CR=13,CTRLS=19,ESC=27,SPACE=32};
  5. EXTERN enum ext_val {F1=59,F2,F3,F4,F5,F6,F7,F8,F9,F10,
  6.              UP=72,LEFT=75,RIGHT=77,DOWN=80};
  7. EXTERN char neurfname[39];      /* current neuron filename */
  8. EXTERN char envfname[39];       /* current environment filename */
  9. EXTERN struct Iint {        /* intrinsic current structure */
  10.        int type;        /* type: 0=Vinf; 1=rand */
  11.        float IL;        /* low intrinsic current, Ae-9 */
  12.        float pL[3];        /* parameters for LIC function */
  13.        float IH;        /* high intrinsic current, Ae-9 */
  14.        float pH[2];        /* parameters for HIC function */
  15.        int H;                   /* TRUE if high intrinsic current on */
  16.        float tint;        /* time since intrinsic current changed */
  17.        float tmax;              /* maximum time since current changed */
  18.        };
  19. EXTERN struct Iint *Iinta;    /* intrinsic current structure area pointer */
  20. EXTERN int ni;            /* number of intrinsic current blocks */
  21. EXTERN struct con {        /* neuron connections structure */
  22.        char sname[7];           /* sending neuron name */
  23.        int s;            /* sending neuron index */
  24.        float Isr;        /* current multiplier from s */
  25.        int ctype;        /* connection type: 0=reg; 1=gate; 2=mod */
  26.        char cname[7];           /* compound synapse neuron name */
  27.        int c;            /* compound synapse neuron index */
  28.        float Icr;        /* compound current constant */
  29.        int U;            /* ungated state, 0 or 1 */
  30.        struct con *next;    /* next connection */
  31.        };
  32. EXTERN struct con *cona;    /* connections area pointer */
  33. EXTERN int nc;            /* number of connections */
  34. EXTERN enum senst {NONE=0,LAF,LAB,AC,OS,EC,MC};
  35. EXTERN struct neuron {        /* basic neuron structure */
  36.        char name[7];        /* name of neuron */
  37.        float Gmem;        /* membrane conductance, Se-6=(1/ohm)e-6 */
  38.        float Cmem;        /* membrane capacitance, pF=Fe-9 */
  39.        float Vt;        /* threshold voltage, mV=Ve-3 */
  40.        float Fmin;        /* minimum firing frequency, dimensionless */
  41.        float Gain;        /* firing frequency gain, 1/mV = 1/(Ve-3) */
  42.        struct Iint *Iint;    /* pointer to intrinsic current parameters */
  43.        enum senst Isens;    /* sensory current function name */
  44.        float pI[2];             /* sensory current parameters */
  45.        int mtype;        /* motor type: 0=none; 1=force; 2=state */
  46.        int mname;        /* mtr name: 0=fwd|foot; 1=bck|mouth; 2=lat */
  47.        float mconst;        /* motor constant */
  48.        struct con *con;        /* neuron interconnections */
  49.        };
  50. EXTERN struct neuron *ns;    /* pointer to neuron list */
  51. EXTERN int nn;            /* number of neurons */
  52. EXTERN struct neurcalc {    /* calculated quantities for neurons */
  53.        double V;        /* voltage */
  54.        double Vlast;            /* last voltage */
  55.        double F;        /* firing frequency */
  56.        double Flast;
  57.        double I;                /* current */
  58.        };
  59. EXTERN struct neurcalc *nsc;    /* pointer to neuron calculation list */
  60. EXTERN float attang[6];         /* leg attachment angle */
  61. EXTERN float attl[6];           /* leg attachment length */
  62. EXTERN float legl[6];           /* leg length when up */
  63. EXTERN float legang[6];         /* leg angles */
  64. EXTERN int lfoot[6];            /* last foot state */
  65. EXTERN int antenna[2];          /* antenna contact */
  66. EXTERN float antcang[2];        /* antenna contact angle */
  67. EXTERN float antang[2];         /* antenna angle to bug, constant */
  68. EXTERN float antl;              /* antenna length from bug center, constant */
  69. EXTERN int cercus[2];           /* cercus contact */
  70. EXTERN float cercang[2];        /* cercus angle to bug, constant */
  71. EXTERN float cercl;             /* cercus length from bug center, constant */
  72. EXTERN float mouthodor;         /* odor strength at mouth */
  73. EXTERN float odor[2];           /* odor strength at each antenna */
  74. EXTERN float energy;            /* energy capacity */
  75. EXTERN int mouth;               /* mouth contact */
  76. EXTERN float maxlegang[6];      /* maximum leg angles */
  77. EXTERN float minlegang[6];      /* minimum leg angles */
  78. EXTERN float DT;                /* time step */
  79. EXTERN float AspR;              /* aspect ratio */
  80. EXTERN float hdsang[2];
  81. EXTERN float hdsl;
  82. EXTERN float hdtang;
  83. EXTERN float hdtl;
  84. EXTERN float hdbang;
  85. EXTERN float hdbl;
  86. EXTERN float btang[2];
  87. EXTERN float btl;
  88. EXTERN float bmang[2];
  89. EXTERN float bml;
  90. EXTERN float bbang[2];
  91. EXTERN float bbl;
  92. EXTERN float cerbang[2];
  93. EXTERN float cerbl;
  94. EXTERN float antbang[2];
  95. EXTERN float antbl;
  96. EXTERN int nfood;               /* number of food patches */
  97. EXTERN int foodx[NFOOD];        /* food x coordinates */
  98. EXTERN int foody[NFOOD];        /* food y coordinates */
  99. EXTERN int foodsize[NFOOD];     /* food sizes */
  100. EXTERN float foodr[NFOOD];      /* radius of food */
  101. EXTERN float ofoodr[NFOOD];     /* old food radius */
  102. EXTERN int nblock;              /* number of blocks */
  103. EXTERN int blockx[NBLOCK];      /* block x coordinates */
  104. EXTERN int blocky[NBLOCK];      /* block y coordinates */
  105. EXTERN struct graph {           /* graph structure */
  106.        int gtype;               /* graph types: 0-none, 1-var, 2-gait */
  107.        char gneur[7];           /* graph neuron name */
  108.        int g;                   /* graph neuron index */
  109.        int gvar;                /* graph variable: 0-V, 1-F, 2-I */
  110.        int gscale;              /* graph scale */
  111.        } gr[5];
  112. EXTERN int Iextgr;              /* graph whose neuron has external current */
  113. EXTERN int Iextind;             /* index of neuron for external current */
  114. EXTERN float Iextint;           /* external current/10E-9 */
  115. EXTERN struct bug {             /* bug location, etc. */
  116.        float x;                 /* bug x */
  117.        float y;                 /* bug y */
  118.        float ang;               /* bug angle */
  119.        int foot[6];             /* foot states */
  120.        float footx[6];          /* foot x's */
  121.        float footy[6];          /* foot y's */
  122.        antx[2];                 /* antenna x's */
  123.        anty[2];                 /* antenna y's */
  124.        cercx[2];                /* cercus x's */
  125.        cercy[2];                /* cercus y's */
  126.        mouthx;                  /* mouth x */
  127.        mouthy;                  /* mouth y */
  128.        mouthst;                 /* mouth state: 0-closed, 1-open */
  129.        };
  130. EXTERN struct bug bug;          /* bug data */
  131. EXTERN struct bug obug;         /* old bug data */
  132. EXTERN int drawmult;            /* multiple of steps, before draws bug */
  133. EXTERN int edget[2];            /* time left for edge turning */
  134. EXTERN float edgecang[2];       /* angle of bug to edge while turning */
  135. EXTERN int plottype;            /* plot type: 0=graphs; 1=neuron activity */
  136. EXTERN struct bugpts {        /* structure of calculted bug pts */
  137.        int head[8];        /* points of head */
  138.        int body[12];        /* points of body */
  139.        int footx[6];        /* foot x's */
  140.        int footy[6];        /* foot y's */
  141.        int legx[6];        /* leg attachment x's */
  142.        int legy[6];        /* leg attachment y's */
  143.        int antx[2];        /* antenna x's */
  144.        int anty[2];        /* antenna y's */
  145.        int antax[2];        /* antenna attachment x's */
  146.        int antay[2];        /* antenna attachment y's */
  147.        int cercx[2];        /* cercus x's */
  148.        int cercy[2];        /* cercus x's */
  149.        int cercax[2];        /* cercus attachment x's */
  150.        int cercay[2];        /* cercus attachment y's */
  151.        };
  152. EXTERN struct bugpts bugp;    /* bug pts */
  153. EXTERN char recpath[39];    /* path for recording file */
  154. EXTERN int recnum;        /* if 1-10, recording */
  155. EXTERN int reccnt;        /* record being filled */
  156. EXTERN struct recbug {        /* record for one bug recording */
  157.        char Iextname[7];    /* external current name, if changed */
  158.        int Iext;        /* external current, if changed */
  159.        int energy;        /* energy */
  160.        char graphx;        /* graph x pos */
  161.        char graphy1[5];        /* 1st graph y pos */
  162.        char graphy2[5];        /* 2nd graph y pos */
  163.        char footst;        /* foot states */
  164.        char mouthfood;        /* mouth & food states */
  165.        int x;            /* x pos of front of bug */
  166.        int y;            /* y pos of front of bug */
  167.        signed char head[6];    /* points of head */
  168.        signed char body[12];    /* points of body */
  169.        signed char footx[6];    /* foot x's */
  170.        signed char footy[6];    /* foot y's */
  171.        signed char legx[6];    /* leg attachment x's */
  172.        signed char legy[6];    /* leg attachment y's */
  173.        signed char antx[2];    /* antenna x's */
  174.        signed char anty[2];    /* antenna y's */
  175.        signed char antax[2];    /* antenna attachment x's */
  176.        signed char antay[2];    /* antenna attachment y's */
  177.        signed char cercx[2];    /* cercus x's */
  178.        signed char cercy[2];    /* cercus x's */
  179.        signed char cercax[2];    /* cercus attachment x's */
  180.        signed char cercay[2];    /* cercus attachment y's */
  181.        } rc[NREC];
  182. EXTERN struct recgraph {    /* graph structure for recording */
  183.        int gtype;               /* graph types: 0-none, 1-var, 2-gait */
  184.        char gneur[7];           /* graph neuron name */
  185.        int gvar;                /* graph variable: 0-V, 1-F, 2-I */
  186.        int gscale;              /* graph scale */
  187.        } rgr[5];
  188. EXTERN struct recinit {        /* initial data structure for recording */
  189.        int foodr[NFOOD];    /* initial food radius */
  190.        int foodx[NFOOD];    /* initial food x's */
  191.        int foody[NFOOD];    /* initial food y's */
  192.        int nblock;        /* number of blocks */
  193.        int blockx[NBLOCK];    /* block x's */
  194.        int blocky[NBLOCK];    /* block y's */
  195.        } rin;
  196.