public static bool Test() { Evolutions evolution = new Evolutions(); evolution.SetParameters("Parameters.xml"); evolution.Evaluator = new EvaluateGenome(Evaluator.NormalXor); evolution.Initialise(); evolution.AllGenerations(); return(Enumerable.Last <NetworkGenome>((IEnumerable <NetworkGenome>)evolution.Champions).Fitness == 4.0); }
static void Main(string[] args) { #region Initialization timer.AddReferee(kref); config = KeepawayConfig.Load("KeepawayConfig.xml"); HyperNEATKeepawayPlayer.config = config; evo.SetParameters("Parameters.xml"); evo.Evaluator = new EvaluateGenome(HyperNEATKeepaway); evo.Initialise(); sub.GenerateNodes(NodeGeneration); sub.GenerateLinks(LinkCreation); std.Realtime = false; for (int i = 0; i < config.NumKeepers; i++) { players.Add(new HyperNEATKeepawayPlayer(std, "keepers", i + 1, "l", config.NumKeepers, config.NumTakers)); } for (int i = 0; i < config.NumTakers; i++) { players.Add(new HyperNEATKeepawayPlayer(std, "takers", i + 1, "r", config.NumKeepers, config.NumTakers)); } for (int i = 0; i < players.Count; i++) { std.addPlayer(players[i]); } evo.AllGenerations(); #endregion }