示例#1
0
        //TODO modify this to look over the list of the top actions for each objective not just the best action
        public void ChooseNewActions()
        {
            List <Objective> objectives = brain.GetSortedObjectives(this);

            if (objectives.Count == 0)
            {
                Debug.Break();
            }
            while (HasAvailableResources() && HasDoableActions())
            {
                foreach (var objective in objectives)
                {
                    if (action2Objective.ContainsValue(objective))
                    {
                        continue;
                    }
                    EventComponent action = GetBestDoableAction(objective);
                    if (action != null)
                    {
                        if (action is PickUpEvent)
                        {
                            Math.Sqrt(2);
                        }
                        if (action is MoveEvent && objective is FullySpecifiedObjective)
                        {
                            FullySpecifiedObjective fso = (FullySpecifiedObjective)objective;
                            if (fso.wayToDoObjective is PickUpEvent)
                            {
                                Math.Sqrt(2);
                            }
                        }
                        action2Objective.Add(action, objective);
                        AllocateResources(action);
                    }
                    else
                    {
                        Debug.Log("No best doable action");
                        Debug.Break();
                    }
                }
            }
        }
示例#2
0
 public void AllocateResources(EventComponent action)
 {
     action.Initialize();
     //currentEvents.Add (action);
     //ProceduralWorldSimulator.instance.ongoingEvents.Add (action);
 }
示例#3
0
 public FullySpecifiedObjective(EventComponent wayToDoObjective)
 {
     this.wayToDoObjective = wayToDoObjective;
 }