getResultFunction() public method

public getResultFunction ( ) : ResultFunction
return ResultFunction
Example #1
0
        public List <Node> expandNode(Node node, Problem problem)
        {
            List <Node> childNodes = new List <Node>();

            ActionsFunction  actionsFunction  = problem.getActionsFunction();
            ResultFunction   resultFunction   = problem.getResultFunction();
            StepCostFunction stepCostFunction = problem.getStepCostFunction();

            foreach (Action action in actionsFunction.actions(node.getState()))
            {
                System.Object successorState = resultFunction.result(node.getState(),
                                                                     action);

                double stepCost = stepCostFunction.c(node.getState(), action,
                                                     successorState);
                childNodes.Add(new Node(successorState, node, action, stepCost));
            }
            metrics.set(METRIC_NODES_EXPANDED, metrics
                        .getInt(METRIC_NODES_EXPANDED) + 1);

            return(childNodes);
        }
Example #2
0
        public List<Node> expandNode(Node node, Problem problem)
        {
            List<Node> childNodes = new List<Node>();

            ActionsFunction actionsFunction = problem.getActionsFunction();
            ResultFunction resultFunction = problem.getResultFunction();
            StepCostFunction stepCostFunction = problem.getStepCostFunction();

            foreach (Action action in actionsFunction.actions(node.getState()))
            {
                System.Object successorState = resultFunction.result(node.getState(),
                        action);

                double stepCost = stepCostFunction.c(node.getState(), action,
                        successorState);
                childNodes.Add(new Node(successorState, node, action, stepCost));
            }
            metrics.set(METRIC_NODES_EXPANDED, metrics
                    .getInt(METRIC_NODES_EXPANDED) + 1);

            return childNodes;
        }