static void Main(string[] args) { Forest D = new Forest(1, 2000, GenerateData, 4); Console.WriteLine(D); int Correct = 0; for (int c = 0; c < 500000; ++c) { AttributeValue[] E = GenerateEntry(); AttributeValue Decision = D.MakeDecision(E); E[4] = Decision; /* * Console.ForegroundColor = ConsoleColor.Red; * Console.WriteLine("DOWN IS {0}", DataToCardAlt(E[0], E[1])); * Console.ForegroundColor = ConsoleColor.Cyan; * Console.WriteLine("I HAVE"); * Console.ForegroundColor = ConsoleColor.Green; * for (int i = 0; i < 3; ++i) Console.WriteLine(DataToCardAlt(E[i * 2 + 2], E[i * 2 + 3])); * Console.ForegroundColor = ConsoleColor.Magenta; * int p = Convert.ToInt32(E[8].ToString()); * Console.WriteLine("I PLAY {0}", (p > -1 ? DataToCardAlt(E[p * 2 + 2], E[p * 2 + 3]) : "DRAW")); */ Correct += Validator(E) ? 1 : 0; //if (!Validator(E)) D.MakeDecision(E, true); } Console.WriteLine("{0}/{1} {2}", Correct, 500000, (double)Correct / 500000); Console.ReadLine(); }
static void Main(string[] args) { Forest D = new Forest(1, 2000, GenerateData, 4); Console.WriteLine(D); int Correct = 0; for(int c=0;c<500000; ++c) { AttributeValue[] E = GenerateEntry(); AttributeValue Decision = D.MakeDecision(E); E[4] = Decision; /* Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("DOWN IS {0}", DataToCardAlt(E[0], E[1])); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("I HAVE"); Console.ForegroundColor = ConsoleColor.Green; for (int i = 0; i < 3; ++i) Console.WriteLine(DataToCardAlt(E[i * 2 + 2], E[i * 2 + 3])); Console.ForegroundColor = ConsoleColor.Magenta; int p = Convert.ToInt32(E[8].ToString()); Console.WriteLine("I PLAY {0}", (p > -1 ? DataToCardAlt(E[p * 2 + 2], E[p * 2 + 3]) : "DRAW")); */ Correct += Validator(E) ? 1 : 0; //if (!Validator(E)) D.MakeDecision(E, true); } Console.WriteLine("{0}/{1} {2}", Correct, 500000, (double)Correct / 500000); Console.ReadLine(); }