public static Agent LoadFromFile(string filePath) { AgentData ad = Save.ReadFromXmlFile <AgentData>(filePath); NeuralLayer.ActivationFunction af = NeuralLayer.GetActivitionFunction(ad.activationFunctionType); return(new Agent(ad.genotype, af, ad.useRNN, ad.topology)); }
public void CreateAgents(out List <Agent> agents, IEnumerable <Genotype> population) { //Create new agents from currentPopulation agents = new List <Agent>(); NeuralLayer.ActivationFunction af = NeuralLayer.GetActivitionFunction(activationFunctionType); foreach (Genotype genotype in population) { agents.Add(new Agent(genotype, af, useRNN, NNTopology)); } isNewAgents = true; }