Example #1
0
        protected override object FormulateGoal()
        {
            object goal;

            if (null == goalTests)
            {
                goal = map.RandomlyGenerateDestination();
            }
            else
            {
                goal = goalTests[goalTestPos];
                goalTestPos++;
            }
            notifier.NotifyViews("CurrentLocation=In("
                                 + state.GetAttribute(DynAttributeNames.AgentLocation)
                                 + "), Goal=In(" + goal + ")");

            return(goal);
        }
Example #2
0
        protected override object formulateGoal()
        {
            string goal = null;

            if (currGoalIdx < goals.Size() - 1)
            {
                goal = goals.Get(++currGoalIdx);
                if (hFnFactory != null && _search is IInformed <string, MoveToAction> )
                {
                    ((IInformed <string, MoveToAction>)_search)
                    .setHeuristicFunction(hFnFactory(goal));
                }

                if (notifier != null)
                {
                    notifier.NotifyViews("Current location: In(" + state.GetAttribute(DynAttributeNames.AGENT_LOCATION)
                                         + "), Goal: In(" + goal + ")");
                }
            }
            return(goal);
        }
Example #3
0
        protected override object formulateGoal()
        {
            object goal;

            if (goals == null)
            {
                goal = map.randomlyGenerateDestination();
            }
            else
            {
                goal = goals[goalTestPos];
                goalTestPos++;
            }
            if (notifier != null)
            {
                notifier.NotifyViews("CurrentLocation=In("
                                     + state.GetAttribute(DynAttributeNames.AGENT_LOCATION)
                                     + "), Goal=In(" + goal + ")");
            }
            return(goal);
        }