示例#1
0
        public override List <Action> Think(IEnumerable <Percept> percepts)
        {
            /* Actions (that we can decide):
             * move to target block (Inherit from seekerMind?)
             * pick target block (based on what?)
             * Clean area ()
             */
            var actions = base.Think(percepts);

            /* We clean when we have a tile that is dirt and it has certain amount of dirt */
            if (ChooseCleanTile(percepts))
            {
                var cleanAction
                    = new CleanAction
                    {
                    cleaningEfficiency = this.desiredCleaningEfficiency,
                    desiredCleanliness = this.desiredCleanliness,
                    completionStatus   = CompletionsStates.InProgress,
                    timeToLive         = moveTimeToLive * 1000
                    };
                actions.Add(cleanAction);
            }
            return(actions);
        }
示例#2
0
 public Cat ChangeClean(CleanAction action)
 {
     _cat.ApplyAction(action);
     return(_cat);
 }
 protected void ToggleTurbo(float preDirtiness, float postDirtiness, float dirtCleaned, CleanAction cleanAction)
 {
     if (postDirtiness <= cleanAction.desiredCleanliness)
     {
         cleanAction.completionStatus = CompletionsStates.Complete;
         turbo = false;
     }
     else
     {
         cleanAction.completionStatus = CompletionsStates.InProgress;
     }
     /* TODO: find a better cutoff point for going turbo */
     /* Go turbo when we know we have dirt but we didn't collect any dirt */
     if (dirtCleaned == minDirtPerSecond || preDirtiness > postDirtiness)
     {
         if (!turbo)
         {
             Debug.LogWarning("Going Turbo !!!!!!!!!");
         }
         turbo = true;
     }
 }