本文整理汇总了C#中Problem.HeurGraph方法的典型用法代码示例。如果您正苦于以下问题:C# Problem.HeurGraph方法的具体用法?C# Problem.HeurGraph怎么用?C# Problem.HeurGraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Problem
的用法示例。
在下文中一共展示了Problem.HeurGraph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Expand
/// <summary>
/// Return nodes after expanding
/// </summary>
/// <param name="prob">Problem that generates successors</param>
public List<Node> Expand(Problem prob)
{
List<Node> childNodes = new List<Node> ();
//Get successors for this state
State origin = this.State;
List<KeyValuePair<Vector2,State>> successors = prob.Successor (origin);
//Create a node with each posibility
foreach (var successor in successors) {
Vector2 action = successor.Key;
State destination = successor.Value;
int cost = prob.PathCost(this.State,successor.Key,successor.Value);
int heurtree = prob.HeurTree(destination);
int heurgraph = prob.HeurGraph(destination);
double utility = prob.Utility(destination);
//Node parent = this;
childNodes.Add(new Node(destination,this,action,cost,heurtree,heurgraph,utility));
}
return childNodes;
}