Beispiel #1
0
 private void LogClusterDecision(CommandCenter c, CommandCArgs e)
 {
     if (Enabled && Started)
     {
         StrW.WriteLine(e.GetStringData());
     }
 }
 private void LogHumanMove(CommandCArgs e)
 {
     if (PlayerMode != 0)
     {
         CCLog(this, e);
     }
 }
Beispiel #3
0
 private void LogCommand(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
     }
     if (Started)
     {
     }
 }
Beispiel #4
0
 private void LogNodeDecision(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
     }
     if (Started)
     {
     }
 }
Beispiel #5
0
 private void LogStart(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
         RoundMoves = "";
         Started    = true;
         StrW       = new StreamWriter(path, true);
         StrW.WriteLine(Environment.NewLine + "Game Start");
     }
 }
Beispiel #6
0
 private void LogPlayer(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
         if (Started)
         {
             StrW.WriteLine("Player: " + e.GetIntArrayData()[0]);
         }
     }
 }
Beispiel #7
0
        private void LogGeneral(CommandCenter c, CommandCArgs e)
        {
            if (Enabled)
            {
                StreamWriter SW = new StreamWriter(path, true);

                SW.Write(CC.ToString() + Environment.NewLine);

                SW.Flush();
                SW.Close();
            }
        }
Beispiel #8
0
 private void LogString(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
         try
         {
             StreamWriter STemp = new StreamWriter(path, true);
             STemp.WriteLine(e.GetStringData());
             STemp.Flush();
             STemp.Close();
         }
         catch { }
     }
 }
Beispiel #9
0
        private void LogEnd(CommandCenter c, CommandCArgs e)
        {
            if (Enabled)
            {
                if (Started)
                {
                    RoundMoves = "";

                    StrW.WriteLine("Game End" + Environment.NewLine);
                    Started = false;
                    SwapState();
                    StrW.Flush();
                    StrW.Close();
                }
            }
        }
Beispiel #10
0
        private void LogWeights(CommandCenter c, CommandCArgs e)
        {
            if (Enabled && !Started)
            {
                StreamWriter SW = new StreamWriter(path, true);

                string[][] TempWeights = e.GetString2DArrayData();
                for (int i = 0; i < TempWeights.Length; i++)
                {
                    for (int k = 0; k < TempWeights[i].Length; k++)
                    {
                        SW.WriteLine(TempWeights[i][k]);
                    }
                }

                SW.Flush();
                SW.Close();
            }
        }
Beispiel #11
0
        private void LogMove(CommandCenter c, CommandCArgs e)
        {
            if (Enabled)
            {
                if (Started)
                {
                    if (RoundMoves.Length != 0)
                    {
                        RoundMoves += ", ";
                    }

                    try
                    {
                        RoundMoves += e.GetIntArrayData()[1] + ": " + CommandNames[e.GetIntArrayData()[0]];
                    }
                    catch (IndexOutOfRangeException)
                    {
                        StrW.WriteLine("Error: The Command Names array did not match with the decision numbers");
                    }
                }
            }
        }
Beispiel #12
0
        public void EndRound(int Score, int UnweightedScore)
        {
            Running = false;
            if (PlayMode == 0)
            {
                LC.FinalizeRound(Score);
            }
            CommandCArgs score = new CommandCArgs(new int[] { UnweightedScore });

            Result(this, score);
            EndGame(this, null);

            if (PlayMode == 0)
            {
                RunCount++;
                if (RunCount == LogLength)
                {
                    RunCount = 0;
                    LogNodes(false);
                }
            }
        }
Beispiel #13
0
 private void LogResult(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
         if (Started)
         {
             StrW.WriteLine(RoundMoves);
             int Res = e.GetIntArrayData()[0];
             if (Res > 0)
             {
                 StrW.WriteLine("Win: " + Res);
             }
             else if (Res < 0)
             {
                 StrW.WriteLine("Loss: " + Res);
             }
             else
             {
                 StrW.WriteLine("Tie: " + Res);
             }
         }
     }
 }
Beispiel #14
0
 private void LogMode(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
         if (Started)
         {
             StrW.Write("Mode: ");
             int mode = c.GetPlayMode();
             if (mode == 0)
             {
                 StrW.WriteLine("Learning");
             }
             else if (mode == 1)
             {
                 StrW.WriteLine("Playing");
             }
             else if (mode == 2)
             {
                 StrW.WriteLine("User Input");
             }
         }
     }
 }
Beispiel #15
0
 private void LogOperators(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
     }
 }
Beispiel #16
0
 private void LogDataSources(CommandCenter c, CommandCArgs e)
 {
     if (Enabled)
     {
     }
 }
Beispiel #17
0
 public void LogCommandNumber(CommunicationCenter c, CommandCArgs e)
 {
     ChosenMove(this, e);
 }