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);
}