Exemplo n.º 1
0
        static public AgentAlgorithm CreateAlgorithm(string name, double h_trg)
        {
            IAATBasedAgent algo = creators[name]();

            //信念など
            if (algo is SubOpinion) //今はまだ場合分けが少ないからいいけどいずれはFactory Methodになるかも。
            {
                algo.Thought = new ThoughtTwin(RandomPool.Get("envset").NextNormal(0.5, 0.1));
            }
            else
            {
                algo.Thought = new Thought(RandomPool.Get("envset").NextNormal(0.5, 0.1));
            }

            //候補集合
            algo.CandidateSelector = new CandidateUpdaterSelector();

            algo.TargetAwarenessRate = h_trg;

            //最後に初期化
            algo.Initialize();

            return(algo as AgentAlgorithm);
        }