/*
 *  sl_globals.c
 *
 *  globals for jimslide
 *  copyright Jim Leonard 1999
 */


/* baseBoard stores the wall structure of the board */
unsigned char baseBoard[LARGEST_BOARD_SIZE];
unsigned char workBoard[LARGEST_BOARD_SIZE];




/* the following are puzzle defining globals */
      PieceDef *piece;
      WinList winList;
      WallList wallList;

      int numPiece;
      int numSpace;
      int numType;
      int bitsPerType;
      int compressedPuzSize;
      int xsize;
      int ysize;
      int startLoc;
      int endLoc;
      int totSize;
      int concurrent = 0;
      int winOnly = 0;
      int useLetters = 0;
      int noGraph = 0;
      int useLabels = 0;
      int bigStorage = 0;
      int bigmem = 16000000;
      int smallmem = 2000000;

/* end puzzle defining globals */

/* the following are used by ProcessGen() engine        */
/* including everything it calls underneath             */
/* I just don't like passing so many parameters so much */
/* Also used by DoInits()                               */
      Generation *prevGen = NULL;
      Generation *curGen = NULL;
      Generation *nextGen = NULL;

/* end process gen globals */

/* the following are to allow concurrent processing */
   int processForward = 1;
   Generation *fNextGen;
   Generation *fCurGen;
   Generation *fPrevGen;

   Generation *rNextGen;
   Generation *rCurGen;
   Generation *rPrevGen;
/* end concurrent globals */


time_t startTime;

unsigned int curMove = 1;

FILE *workFile[MAX_WORK_FILES];

BTree *newPosList;      /* potential (unchecked) new positions */
SList *goodPosSL;       /* previous positions being checked against */
                        /* and already checked new positions */
SList *getNextBoardSL;  /* list that GetNextBoard pulls from */
SList *mergeListSL;
unsigned char *gnbCompressed;  /* blob that holds compressed data */
                               /* to be put on getNextBoardSL     */    

/*
int maxNewPos = 1048576;
int maxEntriesPerSl = 32768;
*/
int maxNewPos = 500000;
int maxEntriesPerSl = 200000;

/* the following are used by directed searches */
unsigned int directed = 0;
int *distList;  /* distance list to determine cut off points for directed searches */
int maxDist;
int cutoffDist;
int checkFullTree = 0;

unsigned int cutoffStep = 0; /* move number at which the solver will stop at no solve */
int numWorkFiles = 6;
int minWorkFile; /* these represent which work files can be written to at any */
int numCurWorkFiles; /* given time */
int writeNum = 0; /* a means to pick which work file to choose */
        /* currently writeNum % numCurWorkFiles + minWorkFile */

unsigned int lastEntriesWritten = 0;
int curMoveNum;
