/// <summary> /// Returns a list of outgoing edges for a given node. /// </summary> /// <param name="node">The node object.</param> /// <param name="actor">The name of the current actor.</param> /// <returns>A list of outgoing edges.</returns> public List <GameTreeEdge> GetOutgoingEdges(GameTreeNode node, string actor) { // Initialize the list of outgoing edges. List <GameTreeEdge> outgoing = new List <GameTreeEdge>(); // Iterate through the actions enabled for the input actor in the current node's state. foreach (Operator action in StateSpaceTools.GetActions(actor, node.Domain, node.Problem, node.State)) { // Add an outgoing edge for each of these actions to the list. outgoing.Add(new GameTreeEdge(action, node.ID)); } // Return the list of outgoing edges. return(outgoing); }
public void StateSpaceToolsGetAllPossibleSamActionsTest() { Assert.AreEqual(1, StateSpaceTools.GetActions("sam", testDomain, testProblem, testState).Count); }