Пример #1
0
        private FollowHighestDensityDecisionMaker createDummy(bool isNegative = false)
        {
            var decisionMaker = new FollowHighestDensityDecisionMaker(State.BasicKeys.TotalFoodEnergyEachDirection, isNegative);

            decisionMaker.Init(_actions);
            return(decisionMaker);
        }
Пример #2
0
        public void コピーコンストラクタでつくられた親子は同じDecisionをする()
        {
            var decisionMaker = createDummy();
            var tmpState      = TempState();

            tmpState[State.BasicKeys.TotalFoodEnergyEachDirection][6] = 1f;
            var decisionMakerClone = new FollowHighestDensityDecisionMaker(State.BasicKeys.TotalFoodEnergyEachDirection);

            decisionMakerClone.Init(decisionMaker);

            var action1 = decisionMaker.DecideAction(tmpState);
            var action2 = decisionMakerClone.DecideAction(tmpState);

            Assert.AreEqual(
                action1.Name,
                action2.Name
                );
        }