Beispiel #1
0
 public MCTSkyNet(IGame game, bool playerOne)
 {
     hashAndSlasher  = ZobristKiller.GetTheKiller();
     shortTermMemory = new Dictionary <string, List <SkyNetNode> > ();
     localBoard      = game.getBoard();
     localBString    = game.getBoardAsString(localBoard, playerOne);
     rootNode        = new SkyNetNode(hashAndSlasher.HashIt(localBString), playerOne);
 }
 public static bool Load()
 {
     ZobristKiller.fileMut.WaitOne();
     if (File.Exists("./SkyNetData/zobristHash.dat"))
     {
         BinaryFormatter bf   = new BinaryFormatter();
         FileStream      file = File.Open("./SkyNetData/zobristHash.dat", FileMode.Open);
         hashAndSlasher = (ZobristKiller)bf.Deserialize(file);
         file.Close();
         ZobristKiller.fileMut.ReleaseMutex();
         return(true);
     }
     ZobristKiller.fileMut.ReleaseMutex();
     return(false);
 }