Ejemplo n.º 1
0
        public void ForceReevaluation()
        {
            relevantGoals = from relevanceKvp in from evalKvp in evaluators
                            select new KeyValuePair <Goal, double>(evalKvp.Key, evalKvp.Value())
                            where relevanceKvp.Value > 0
                            orderby relevanceKvp.Value descending
                            select relevanceKvp.Key;

            reevaluationTimer.Reset(false);
        }
Ejemplo n.º 2
0
    //Run test case and log results
    private static void SingleRun(string name, IPlanner planner, WorldState state,
                                  HashSet <PlanningAction> availableActions, Goal goal, IResettableTimer timer, bool resetExperience = false)
    {
        print($"-----------------{name}---------------------------");
        if (resetExperience)
        {
            planner.ClearExperience();
        }
        timer.Reset(false);
        var plan = planner.FormulatePlan(state, availableActions, goal);

        print(
            $"{planner.GetType()} has found a plan of length {plan.Length} and cost {plan.Cost} to satisfy \"{goal.Name}\" in {timer.ElapsedSeconds} seconds"
            );
        // print(plan.ToString());
    }