public void agent_creation()
        {
            var initialPosition = new Vector3(0, 0, 0);
            var moveSpeed       = 1f;

            var agent = FlyingAgent.Create(position: initialPosition, target: initialPosition, speed: moveSpeed);

            Assert.AreEqual(initialPosition, agent.position);
            Assert.AreEqual(moveSpeed, agent.speed);
        }
示例#2
0
        public void inside_area()
        {
            var target = new Vector3(0, 3, 0);
            var agent  = FlyingAgent.Create(position: new Vector3(0, 2.999f, 0));
            var area   = FlyingArea.Create(agent, target);

            var result = FlyingArea.IsInsideArea(area);

            Assert.IsTrue(result);
        }
        public void agent_step()
        {
            var initialPosition = new Vector3(0, 0, 0);
            var moveSpeed       = 1f;
            var agent           = FlyingAgent.Create(position: initialPosition, target: initialPosition, speed: moveSpeed);

            var result = FlyingAgent.Update(agent, initialPosition + Vector3.up, velocity: Vector3.zero);

            Assert.AreEqual(new Vector3(0, 1, 0), result.position);
        }
        private void Initialize()
        {
            step = 0;
            stepsInsideTarget = 0;
            levelParameters   = LevelParameters.Create(100, 30f, 1f);

            var initialPosition = spawnPosition.localPosition;
            var targetPosition  = target.localPosition;

            agent = FlyingAgent.Create(initialPosition, target: targetPosition, speed: moveSpeed);
            area  = FlyingArea.Create(agent, targetPosition, doneReward: 2f, failReward: -2f);
            ResetUnityEntities(initialPosition, targetPosition);
        }