home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / TIERRA40.ZIP / TIERRA / DECLARE.H < prev    next >
C/C++ Source or Header  |  1992-09-09  |  6KB  |  128 lines

  1. /* declare.h   9-9-92  Artificial Life simulator */
  2. /* Tierra Simulator V4.0: Copyright (c) 1991, 1992 Tom Ray & Virtual Life */
  3.  
  4. /*
  5.  * sccsid: @(#)declare.h    1.37    12/8/91
  6.  */
  7.  
  8. #include "license.h"
  9.  
  10. #ifndef  LDECLAR_H
  11. #define  LDECLAR_H
  12.  
  13. FILE *oufr;
  14. HpInst soup;
  15. I32s BitBucket; /* place to dump return values */
  16. I32s AverageSize;    /* average size of cells in soup */
  17. Pcells BottomReap; /* cell at bottom of reaper queue, last to die */
  18. Pcells BottomDummy; /* dummy cell at bottom of reaper queue */
  19. I32s BrkupCou; /* count of output files break.n */
  20. I32s BrkupCum; /* cumulative count of bytes output to break.n */
  21. I8s  Buff[120]; /* nice global text buff for all sorts of messages */
  22. I32s pos; /* file pointer for position in break.X files */
  23. I32s CelArSiz; /* size of each cells array */
  24. I32s CellsSize;  /* total size of cells arrays of structures */
  25. I32s CountFlaw;/* counter for flaw random number */
  26. I32s CountMovMut;    /* keep track of time since last mov_mut */
  27. I32s CountMutRate;    /* keep track of time since last mut */
  28. I32s debug_switch;
  29. Event DistNext;    /* time of next disturbance */
  30. Event Disturb;    /* time of disturbance */
  31. CellInd extr;     /* which cell to isolate */
  32. I8s ExtrG[20];    /* last geno extracted */
  33. I32s ExtractCount;    /* count of cells manually extracted */
  34. I32s FirstOutDisk;    /* has OutDisk been called */
  35. I32s fe_lines = 20;        /* approx hight in chars of screen, default 20 */
  36. I32s fe_width = 60;        /* approx width in chars of screen, default 60 */
  37. I32s FreeBlocks;    /* number of free blocks of memory */
  38. double Generations;/*count of elapsed generations * (AvgPop/TimeBirth-Death)*/
  39. I8s **GenInList;    /* pointers to soup_in genome names */
  40. HistType *Hist = NULL;/* pointer to struct for histograms */
  41. I32s HistSize = 0; /* Num of elements alloced in Hist */
  42. float HistNStars = 0.0; /* ratio of counts to stars */
  43. I8s *GenInBuf; /* buffer containing soup_in genome names */
  44. I32s GFormat = -1; /* select genebank format style, -1 = first file = format */
  45. indx_t  GIndx;     /* global index structure */
  46. I8s  GoDown = 0;   /* flag to bring system down to defragment memory */
  47. I32s HistPrint = 0; /* boolean to tell us weather to print hists, to log */
  48. I8s IMode;    /* info display (plan,histo_size,histo_geno etc) */
  49. I32s InstD[33]; /* data structure for freq dist. of instructions */
  50. Event InstExe;    /* counter of instructions executed */
  51. PInst is;/* structure for passing info between parse and execute */
  52. I32s isolate;  /* isolate the genome of the cell extr */
  53. Event LastDiv;    /* instructions executed at last divide */
  54. I8s mes[10][80];/* array of strings for message passing to front end */
  55. I32s MalLimit;  /* search limit for memory allocation */
  56. I32s Max_hits;    /* cardinality of most populous size class */
  57. I32s  Nop0 = 0;  /* instruct num corresponding to nop0 */
  58. I32s  Nop1 = 1;  /* instruct num corresponding to nop1 */
  59. I32s  NopS = 1;  /* Nop0 + Nop1 sum of Nops for template search */
  60. I32s NumCelAr; /* number of cells arrays */
  61. I32s NumGenDG; /* present # of permanent genotypes saved to disk */
  62. I32s NumGenDM; /* present # of temporary genotypes swapped out to disk */
  63. I32s NumGenRQ; /* present # of genotypes in RAM genequeue */
  64. I32s NumGenotypes; /* # of genotypes of adult cells extant in soup */
  65. I32s NumSizes; /* # of sizes of adult cells extant in soup */
  66. I32s PhotonSize;    /* number of instructions in photon */
  67. I32s RandIx1, RandIx2, RandIx3;    /* for trand() */
  68. I32s RateFlaw; /* frequency of flaws */
  69. I32s RateMovMut;    /* 1 / frequency of mutations per mov event */
  70. I32s RateMut;  /* number of instructions per mutations */
  71. I32s reaped;   /* 0 = reaper has not killed, 1 = reaper has killed */
  72. I32s SigBlockSet; /* mask to block sig int in unix, for certain calls */
  73. I32s siz_sl;   /* allocated size of *sl array */
  74. I8s soup_fn[85];    /* place for soup_in filename */
  75. I32s SoupBot;  /* index of FreeMem struct for bottom of soup memory */
  76. I32s SoupTop;  /* index of FreeMem struct for top of soup memory */
  77. I8s Swap=1;   /* DOS flag whether to gq_swap or not */
  78. FILE *tfp_log = NULL; /* file pointer for log */
  79. I8s  TC_Menu = 0;    /* flag unix sigint, to do a menu */
  80. Pcells ThisSlice;/* index of cell that is currently active */
  81. I32s TimeBirth;/* count of births in each million instruction */
  82. I32s TimeDeath;/* count of deaths in each million instruction */
  83. double TimePop;/* sum of ttime * NumCells for each million instructions */
  84. Pcells TopDummy; /* dummy cell at top of reaper queue */
  85. Pcells TopReap; /* index of cell at top of reaper queue, next to die */
  86. I32s TotFlaw;  /* total number of flaws in this run */
  87. I32s TotMemUse; /* total memory use by soup, cells, and genebank */
  88. I32s TotMovMut;/* total number of move mutations in this run */
  89. I32s TotMut;   /* total number of background mutations in this run */
  90. Instruction PhotonInst[80];    /* instructional representation of photon */
  91. I32s FreeMemCurrent;    /* current amount of free memory in soup */
  92. I32s Search_limit;/* limit on how far address instructions will search */
  93. I32s Put_limit; /* limit on intercellular communications distance */
  94. Pcells Fp cells;  /* cells array */
  95. Pmf FreeMem;   /* free memory array */
  96. SList **sl;    /* list of unique size classes, number of gts */
  97. double TrandArray[98];    /* for trand() */
  98. LastOut lo;    /* last data output to disk */
  99. GList *gq_bot;    /* bottom of gene queue */
  100. GList *gq_top;    /* top of gene queue */
  101. void (*slicer) ();
  102.  
  103. #ifdef ALCOMM
  104. I16s           AL_run_flag; 
  105. I16s           VPORT; 
  106. #endif    /* ALCOMM */
  107.  
  108. I8u MSG_X = 1;
  109. I8u MSG_Y = 1;
  110. I8u ERR_X = 1;
  111. I8u ERR_Y = 1;
  112. I8u PLN_X = 1;
  113. I8u PLN_Y = 1;
  114. I8u HLP_X = 1;
  115. I8u HLP_Y = 1;
  116.  
  117. #ifdef MICRO
  118. I32s MC_step = -1L;
  119. Pcells MicroSlice = 0;/* index of cell that is currently active */
  120. #endif
  121.  
  122. #ifdef __TURBOC__
  123. extern unsigned _stklen = 32767;
  124. I16s FE_DV_Mode= 0;
  125. #endif
  126.  
  127. #endif
  128.