Exemplo n.º 1
0
        public void 後にエネルギーがあるときはちゃんとそちらに向かう()
        {
            var decisionMaker = createDummy();
            var tmpState      = TempState();

            for (var y = -1; y <= 1; y++)
            {
                tmpState[State.BasicKeys.TotalFoodEnergyEachDirection][4] = 1f;
                var action = decisionMaker.DecideAction(tmpState);
                Assert.AreEqual(
                    LocomotionAction.GoBack().Name,
                    action.Name
                    );
            }
        }
Exemplo n.º 2
0
        public void 後に餌があるときはちゃんとそちらに向かう()
        {
            var decisionMaker = createDummy();
            var tmpState      = new State();

            for (var y = -1; y <= 1; y++)
            {
                tmpState[State.BasicKeys.RelativeFoodPosition] = new DenseVector(new double[] { 0.5f, y * 100, -2 });
                var action = decisionMaker.DecideAction(tmpState);
                Assert.AreEqual(
                    LocomotionAction.GoBack().Name,
                    action.Name
                    );
            }
        }
Exemplo n.º 3
0
        public void 反対側をちゃんと選ぶ()
        {
            var decisionMaker = createDummy(isNegative: true);
            var tmpState      = TempState();

            for (var y = -1; y <= 1; y++)
            {
                tmpState[State.BasicKeys.TotalFoodEnergyEachDirection][0] = 1f;
                var action = decisionMaker.DecideAction(tmpState);
                Assert.AreEqual(
                    LocomotionAction.GoBack().Name,
                    action.Name
                    );
            }
        }