示例#1
0
        static void comRunQ()
        {
            Console.WriteLine("Q is player..?");
            byte temp3 = byte.Parse(Console.ReadLine());

            Console.WriteLine("How many games?");
            int temp1 = int.Parse(Console.ReadLine());

            Console.WriteLine("Board size?");
            int temp4 = int.Parse(Console.ReadLine());

            Console.WriteLine("Which opponent?");
            string        command = Console.ReadLine();
            StreamReader  reader  = new StreamReader("qdatafiles.txt");
            List <String> files   = new List <string>();

            while (reader.Peek() != -1)
            {
                files.Add(reader.ReadLine());
            }
            reader.Close();
            foreach (String s in files)
            {
                Console.WriteLine("Using file " + s);
                QAgent qagentm = new QAgent(temp3);
                qagentm.Load(s);
                qagentm.TurnOffExploration();
                qagentm.TurnOffLearning();
                RunQ(temp3, qagentm, command, temp1, temp4);
            }
        }
示例#2
0
        static void comTrainMadQ()
        {
            Console.WriteLine("Q is player..?");
            byte   temp3  = byte.Parse(Console.ReadLine());
            QAgent qagent = new QAgent(temp3);

            qagent.Load("qmad");
            qagent.MinLearning = 0.05;
            Console.WriteLine("How many iterations?");
            int temp1 = int.Parse(Console.ReadLine());

            TrainMadQ(temp3, qagent, "qmadlog", "qmad", temp1);
        }
示例#3
0
        static void comTrainQ(bool load)
        {
            Console.WriteLine("Q is player..?");
            byte   temp3  = byte.Parse(Console.ReadLine());
            QAgent qagent = new QAgent(temp3);

            if (load)
            {
                qagent.Load("TrainingData");
            }
            Console.WriteLine("How many iterations?");
            int temp1 = int.Parse(Console.ReadLine());

            Console.WriteLine("Save how often?");
            int temp2 = int.Parse(Console.ReadLine());

            Console.WriteLine("Board size?");
            int temp4 = int.Parse(Console.ReadLine());

            Console.WriteLine("Which opponent?");
            string command = Console.ReadLine();

            TrainQ(temp4, temp3, qagent, command, "log", "TrainingData", temp1, temp2);
        }