コード例 #1
0
    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));
    }
コード例 #2
0
ファイル: GameData.cs プロジェクト: yoellevy/ArtificialRoyal
    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;
    }