示例#1
0
        /**
         * @brief Sets the ai agent into a given hidding place
         * @param hiddingPlace The hidding place where hide this agent
         */
        public void SetOnRandomHiddingPlace(ArtificialIntelligence.HiddingPlace hiddingPlace)
        {
            currentHiddingPlace = hiddingPlace;
            currentRoom         = hiddingPlace.GetOwnerRoom();

            var component = locomotor.GetNavMeshAgent();

            component.enabled = false;

            transform.position = hiddingPlace.transform.position;

            component.enabled = true;

            //locomotor.GetNavMeshAgent().Warp(hiddingPlace.transform.position);
            locomotor.SetDestination(transform.position);
            Hide();
            locomotor.Activate();
        }
示例#2
0
 /**
  * @brief Calculate the heuristic value of the action
  * @return The heuristic value
  */
 public override float CalculateHeuristic()
 {
     return(weights.originOccupation * origin.GetOccupationRate() +
            weights.destinyOccupation * destiny.GetOccupationRate() +
            weights.distanceToGoalFromOrigin * (origin.GetDistanceToExitRoom() + origin.GetOwnerRoom().GetDistanceToGoal()) +
            weights.distanceToGoalFromDestiny * (destiny.GetDistanceToExitRoom() + destiny.GetOwnerRoom().GetDistanceToGoal()) +
            weights.chanceToRevealPositionOrigin * origin.GetChanceToRevealPosition() +
            weights.chanceToRevealPositionDestiny * destiny.GetChanceToRevealPosition());
 }