public void Save(Stream stream) { var collection = new SimulationBotCollection(); collection.AddRange(ByElo()); collection.Save(stream); }
public static Bots Load(Stream stream) { var collection = SimulationBotCollection.Load(stream); var bots = new Bots(); bots.AddRange(collection); return(bots); }
public void Save_OneBot_ToFile() { var collection = new SimulationBotCollection() { new BotData() { Id = 17, Locked = true, DefPars = EvaluatorParameters.GetDefault(), }, }; var file = new FileInfo("collection.xml"); collection.Save(file); }
public void Save_OneBot_ToFile() { var collection = new SimulationBotCollection() { new BotData() { Id = 17, Locked = true, DefPars = EvaluatorParameters.GetDefault(), }, }; var file = new FileInfo("collection.xml"); collection.Save(file); }
public void Run() { lock (lockList) { if (File.Exists) { Bots.AddRange(SimulationBotCollection.Load(File)); } if (Bots.Count < 2) { Bots.Clear(); Bots.Add(GetDef()); Bots.Add(GetDef()); BestBot = Bots.GetHighestElo(); } } var keepRunning = true; while (true) { LogRankings(); LogStatus(); if (!keepRunning) { break; } Bots.CloneBots(Randomizer); Bots.Shrink(); var pairings = Bots.GetPairings(Rnd); var copy = pairings.ToList(); if (InParallel) { keepRunning = SimulateParallel(copy); } else { keepRunning = Simulate(copy); } Bots.Process(Results); } }