Esempio n. 1
0
 public AStarSearch(IAStarNode start, IAStarNode end, calcSpecialNodeCostFunc calcspecialcostfunc, getAdjacnentNodesFunc getadjacentnodesfunc, isOpenRouteFunc isopenroutefunc,calcScoreHeuristicFunc calcscoreheuristaic)
 {
     //Debug.Log("Init AStar!!");
     SpecialNodeCostFunc = calcspecialcostfunc != null ? calcspecialcostfunc : this.defaultSpecialNodeCost;
     //Debug.Log(string.Format("isNull: {0}:{1}",SpecialNodeCostFunc !=null,calcspecialcostfunc !=null));
     GetAdjacentNodesFunc = getadjacentnodesfunc != null? getadjacentnodesfunc : this.getAdjacentNodes;
     IsOpenRouteFunc = isopenroutefunc != null? isopenroutefunc : this.isOpenRoute;
     CalcScoreHeuristic = calcscoreheuristaic != null ? calcscoreheuristaic : this.defaultCalcScoreHeuristic;
     EndNode = end;
     start.Parent = Dummy;
     start.Score = calcScore(start);
     StartNode = start;
     init();
     search();
 }
Esempio n. 2
0
 public AStarSearch(IAStarNode start, IAStarNode end, calcSpecialNodeCostFunc calcspecialcostfunc, getAdjacnentNodesFunc getadjacentnodesfunc)
     : this(start,end,calcspecialcostfunc,getadjacentnodesfunc,null,null)
 {
     //IsOpenRouteFunc = isOpenRoute;
 }
Esempio n. 3
0
 public AStarSearch(IAStarNode start, IAStarNode end,calcSpecialNodeCostFunc calcspecialcostfunc)
     : this(start,end,calcspecialcostfunc,null)
 {
     //GetAdjacentNodesFunc = getAdjacentNodes;
 }