home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / xplatfrm / tierra / extern.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-26  |  7.1 KB  |  126 lines

  1. /* extern.h  4-10-91  external declarations of global variables */
  2. /** Tierra Simulator V3.0: Copyright (c) 1991 Thomas S. Ray **/
  3.  
  4. #include "license.h"
  5.  
  6. /*
  7. #ifndef lint
  8. static char     sccsid[] = "@(#)extern.h    1.30 10/6/91";
  9. #endif
  10. */
  11.  
  12. #ifndef LEXTERN_H
  13. #define LEXTERN_H
  14.  
  15. extern FILE  *oufr;
  16. extern HpInst  soup;
  17. extern I32s  alive;       /* run simulator alive * 1,000,000 instructions */
  18. extern I32s  AverageSize; /* average size of cells in soup */
  19. extern I32s  BottomReap; /* index of cell bottom reaper queue, last to die */
  20. extern I32s  BrkupCou; /* count of output files break.n */
  21. extern I32s  BrkupCum; /* cumulative count of bytes output to break.n */
  22. extern I32s  BrkupSiz; /* size of output files break.n in K */
  23. extern I32s  CellsSize;  /* number of allocated elements in cells array */
  24. extern I32s  comsoc;
  25. extern I32s  CountFlaw;  /* counter for flaw random number */
  26. extern I32s  CountMovMut;
  27. extern I32s  CountMutRate;
  28. extern I32s  debug;    /* output info to screen for debugging */
  29. extern I32s  debug_switch;
  30. extern I32s  DiskOut;  /* 0 = no output to disk, 1 = output to disk */
  31. extern struct event  Disturb;  /* time of disturbance */
  32. extern float DistFreq; /* freq. of disturbance, in multiples of recovery t */
  33. extern struct event  DistNext; /* time of next disturbance */
  34. extern float DistProp; /* proportion of cells killed in each disturbance */
  35. extern I32s  DivSameSiz;  /* 0 = off, 1 = daughter cell must be same size */
  36. extern I32s  DivSameGen;  /* 0 = off, 1 = daught cell must be same genotype */
  37. extern I32s  DropDead;  /* millions instruction since last divide till dead */
  38. extern I32s  extr;       /* which cell to isolate */
  39. extern I32s  ExtractCount;
  40. extern I32s  FirstOutDisk;
  41. extern I32s  fragment; /* 0 = memory not fragmented  1 = memory fragmented  */
  42. extern I32s  FreeBlocks;  /* number of free blocks of memory */
  43. extern I32s  GeneBnker; /* 0 = don't keep track genotyes, 1 = keep track */
  44. extern double Generations; /* elapsed generations (AvgPop/TimeBirth-Death) */
  45. extern I8s  **GenInList; /* pointers to soup_in genome names */
  46. extern I8s  *GenInBuf;   /* buffer containing soup_in genome names */
  47. extern float GenPerBkgMut; /* generations per background mutation */
  48. extern float GenPerFlaw; /* generations per flaw */
  49. extern float GenPerMovMut; /* generations per move mutation */
  50. extern I32s  hangup;/* 0 = exit on error, 1 = hangup on error, for debugging*/
  51. extern struct InstDef     id[32];
  52. extern struct ArgInstDef  aid[32];
  53. extern struct event  InstExe;  /* counter of instructions executed */
  54. extern struct inst  is; /* struct for passing info between parse & execute */
  55. extern I32s  isolate;  /* isolate the genome of the cell extr */
  56. extern struct event  LastDiv;  /* instructions executed at last divide */
  57. extern I32s  MaxFreeBlocks; /* number allocated elements in FreeMem array */
  58. extern float MaxMalMult; /* multiple of cell size allowed for mal() */
  59. extern I8s   mes[5][80];/* array of strings for message passing to frontend */
  60. extern I32s  MinCellSize; /* minimum cell size */
  61. extern I32s  MinTemplSize; /* minimum template size */
  62. extern float  MovPropThrDiv; /* min proportion of daught cell filled by mov */
  63. extern I32s  new_soup;  /* 0 = processed soup core, 1 = new soup core */
  64. extern I32s  NumCells;  /* present number of cells in soup */
  65. extern I32s  num_gen;    /* present number of genotypes saved to disk */
  66. extern I32s  num_genq;   /* present number of genotypes in RAM bank */
  67. extern I32s  num_genl;   /* present number of genotypes in *gl lists */
  68. extern I32s  NumSiz;    /* present number of sizes saved to disk */
  69. extern I32s  NumSizq;   /* present number of sizes in RAM bank */
  70. extern I32s  NumSizl;   /* present number of sizes in *sl list */
  71. extern I32u  ONE;         /* a constant */
  72. extern I32s  PhotonSize; /* number of instructions in photon */
  73. extern I32s  PhotonWidth; /* amount by which photons slide to determine fit */
  74. extern I32s  RamBankSiz; /* number of genotypes stored in RAM */
  75. extern I32s  RandIx1, RandIx2, RandIx3; /* for tsrand() */
  76. extern I32s  RateFlaw; /* frequency of flaws */
  77. extern I32s  RateMovMut;  /* 1 / frequency of mutations per mov event */
  78. extern I32s  RateMut;  /* number of instructions per mutations */
  79. extern I32s  reaped;    /* 0 = reaper has not killed, 1 = reaper has killed */
  80. extern I32s  runflag;
  81. extern I32s  SaveFreq; /* frequency of saving core_out, soup_out and list */
  82. extern I32s  seed;  /* seed for random number generator */
  83. extern I32s  SizDepSlice; /* 0 = slice constant, 1 = slice size dependent */
  84. extern I32s  siz_sl;  /* allocated size of *sl array */
  85. extern I8s   SLASH;  /* in DOS = \ = 92, in unix = / = 47 */
  86. extern I32s  SliceSize;  /* number of instructions executed in each slice */
  87. extern I32s  SliceStyle; /* select style of allocating slice size */
  88. extern I8s   soup_fn[85];  /* place for soup_in filename */ 
  89. extern I32s  SoupBot;  /* index FreeMem struct for bottom of soup memory */
  90. extern I32s  SoupTop;  /* index of FreeMem struct for top of soup memory */
  91. extern I32s  ThisSlice;  /* index of cell that is currently active */
  92. extern I32s  TimeBirth;  /* count of births in each million instruction */
  93. extern I32s  TimeDeath;  /* count of deaths in each million instruction */
  94. extern double TimePop;   /* sum of ttime * NumCells for each million */
  95. extern I32s  TopReap;    /* index of cell at top reaper queue, next to die */
  96. extern I32s  TotFlaw;  /* total number of flaws in this run */
  97. extern I32s  TotMovMut;  /* total number of move mutations in this run */
  98. extern I32s  TotMut;  /* total number of background mutations in this run */
  99. extern I32s  WatchExe; /* mark executed instructions in genome in genebank */
  100. extern I32s  WatchMov; /* set mov bits in genome in genebank */
  101. extern I32s  WatchTem; /* set template bits in genome in genebank */
  102. extern I8s   GenebankPath[80]; /* path for genebank */
  103. extern I8s   OutPath[80]; /* path for disk output */
  104. extern I8s   PhotonWord[80];  /* alphabetic representation of photon */
  105. extern Instruction  PhotonInst[80];/*instructional representation of photon */
  106. extern Ind   FreeMemCurrent;  /* current amount of free memory in soup */
  107. extern float SearchLimit;  /* limit on search, as multiple of average size */
  108. extern Ind   Search_limit;/* limit how far address instructions will search */
  109. extern Ind   SoupSize;  /* size of soup memory, measured in instructions */
  110. extern Pcells  cells;  /* cells array */
  111. extern Psl sl;        /* list of size classes for genebanker */
  112. extern Pmf FreeMem;  /* free memory array */
  113. extern double  PhotonPow;  /* power for photon match slice size */
  114. extern double  SlicePow;  /* power for size dependent slice */
  115. extern double  TrandArray[98]; /* for trand() */
  116. extern float  SavThrMem; /* thresh memory prop. to save genotype */
  117. extern float  SavThrPop; /* thresh population prop. to save genotype */
  118. extern float  SlicFixFrac; /* fixed fraction of slice size */
  119. extern float  SlicRanFrac; /* random fraction of slice size */
  120. extern struct gl_index  gq_bot;  /* bottom of gene queue */
  121. extern struct gl_index  gq_top;  /* top of gene queue */
  122. extern struct LastOut  lo;  /* last data output to disk */
  123. extern void (*slicer)();
  124.  
  125. #endif
  126.