public JumpPointParam(BaseGrid iGrid, bool iAllowEndNodeUnWalkable = true, bool iCrossCorner = true, bool iCrossAdjacentPoint = true, HeuristicMode iMode = HeuristicMode.EUCLIDEAN) { switch (iMode) { case HeuristicMode.MANHATTAN: m_heuristic = new HeuristicDelegate(Heuristic.Manhattan); break; case HeuristicMode.EUCLIDEAN: m_heuristic = new HeuristicDelegate(Heuristic.Euclidean); break; case HeuristicMode.CHEBYSHEV: m_heuristic = new HeuristicDelegate(Heuristic.Chebyshev); break; default: m_heuristic = new HeuristicDelegate(Heuristic.Euclidean); break; } m_allowEndNodeUnWalkable = iAllowEndNodeUnWalkable; m_crossAdjacentPoint = iCrossAdjacentPoint; m_crossCorner = iCrossCorner; openList = new List <Node>(); m_searchGrid = iGrid; m_startNode = null; m_endNode = null; m_useRecursive = false; }
public JumpPointParam(BaseGrid iGrid, bool iAllowEndNodeUnWalkable = true, bool iCrossCorner = true, bool iCrossAdjacentPoint=true, HeuristicMode iMode = HeuristicMode.EUCLIDEAN) { switch (iMode) { case HeuristicMode.MANHATTAN: m_heuristic = new HeuristicDelegate(Heuristic.Manhattan); break; case HeuristicMode.EUCLIDEAN: m_heuristic = new HeuristicDelegate(Heuristic.Euclidean); break; case HeuristicMode.CHEBYSHEV: m_heuristic = new HeuristicDelegate(Heuristic.Chebyshev); break; default: m_heuristic = new HeuristicDelegate(Heuristic.Euclidean); break; } m_allowEndNodeUnWalkable = iAllowEndNodeUnWalkable; m_crossAdjacentPoint = iCrossAdjacentPoint; m_crossCorner = iCrossCorner; openList = new List<Node>(); m_searchGrid = iGrid; m_startNode = null; m_endNode = null; m_useRecursive = false; }
public JumpPointParam(BaseGrid grid, EndNodeUnWalkableTreatment allowEndNodeUnWalkable = EndNodeUnWalkableTreatment.Allow, DiagonalMovement diagonalMovement = DiagonalMovement.Always, HeuristicMode mode = HeuristicMode.Euclidean) : base(grid, diagonalMovement, mode) { CurEndNodeUnWalkableTreatment = allowEndNodeUnWalkable; OpenList = new IntervalHeap <Node>(); CurIterationType = IterationType.Loop; }
public ParamBase(BaseGrid iGrid, HeuristicMode iMode) { SetHeuristic(iMode); m_searchGrid = iGrid; m_startNode = null; m_endNode = null; }
public ParamBase(BaseGrid iGrid, DiagonalMovement iDiagonalMovement, HeuristicMode iMode) { SetHeuristic(iMode); m_searchGrid = iGrid; DiagonalMovement = iDiagonalMovement; m_startNode = null; m_endNode = null; }
public JumpPointParam(BaseGrid iGrid, bool iAllowEndNodeUnWalkable = true, bool iCrossCorner = true, bool iCrossAdjacentPoint = true, HeuristicMode iMode = HeuristicMode.EUCLIDEAN) : base(iGrid, iMode) { m_allowEndNodeUnWalkable = iAllowEndNodeUnWalkable; m_crossAdjacentPoint = iCrossAdjacentPoint; m_crossCorner = iCrossCorner; openList = new IntervalHeap <Node>(); m_useRecursive = false; }
public ParamBase(BaseGrid iGrid, GridPos iStartPos, GridPos iEndPos, DiagonalMovement iDiagonalMovement, HeuristicMode iMode) : this(iGrid, iDiagonalMovement, iMode) { m_startNode = m_searchGrid.GetNodeAt(iStartPos.x, iStartPos.y); m_endNode = m_searchGrid.GetNodeAt(iEndPos.x, iEndPos.y); if (m_startNode == null) { m_startNode = new Node(iStartPos.x, iStartPos.y, true); } if (m_endNode == null) { m_endNode = new Node(iEndPos.x, iEndPos.y, true); } }
public SearchGridForm() { InitializeComponent(); this.DoubleBuffered = true; m_resultBox = new List <ResultBox>(); this.Width = (width + 1) * 20; this.Height = (height + 1) * 20 + 100; this.MaximumSize = new Size(this.Width, this.Height); this.MaximizeBox = false; m_rectangles = new GridBox[width][]; for (int widthTrav = 0; widthTrav < width; widthTrav++) { m_rectangles[widthTrav] = new GridBox[height]; for (int heightTrav = 0; heightTrav < height; heightTrav++) { if (widthTrav == (width / 3) && heightTrav == (height / 2)) { m_rectangles[widthTrav][heightTrav] = new GridBox(widthTrav * 20, heightTrav * 20 + 50, BoxType.Start); } else if (widthTrav == 41 && heightTrav == (height / 2)) { m_rectangles[widthTrav][heightTrav] = new GridBox(widthTrav * 20, heightTrav * 20 + 50, BoxType.End); } else { m_rectangles[widthTrav][heightTrav] = new GridBox(widthTrav * 20, heightTrav * 20 + 50, BoxType.Normal); } } } m_resultLine = new List <GridLine>(); searchGrid = new StaticGrid(width, height); // searchGrid = new DynamicGrid(); //searchGrid = new DynamicGridWPool(SingletonHolder<NodePool>.Instance); jumpParam = new JumpPointParam(searchGrid, true, cbCrossCorners.Checked, cbCrossAdjacentPoint.Checked, HeuristicMode.EUCLIDEAN);//new JumpPointParam(searchGrid, startPos, endPos, cbCrossCorners.Checked, HeuristicMode.EUCLIDEANSQR); jumpParam.UseRecursive = cbUseRecursive.Checked; }
public void Reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null) { openList.Clear(); m_startNode = null; m_endNode = null; if (iSearchGrid != null) { m_searchGrid = iSearchGrid; } m_searchGrid.Reset(); m_startNode = m_searchGrid.GetNodeAt(iStartPos.x, iStartPos.y); m_endNode = m_searchGrid.GetNodeAt(iEndPos.x, iEndPos.y); if (m_startNode == null) { m_startNode = new Node(iStartPos.x, iStartPos.y, true); } if (m_endNode == null) { m_endNode = new Node(iEndPos.x, iEndPos.y, true); } }
internal override void _reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null) { }
internal override void _reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null) { openList = new IntervalHeap <Node>(); //openList.Clear(); }
public AStarParam(BaseGrid iGrid, float iweight, DiagonalMovement iDiagonalMovement = DiagonalMovement.Always, HeuristicMode iMode = HeuristicMode.EUCLIDEAN) : base(iGrid, iDiagonalMovement, iMode) { Weight = iweight; }
internal abstract void _reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null);
internal override void ResetInternal(GridPos startPos, GridPos endPos, BaseGrid searchGrid = null) => OpenList = new IntervalHeap <Node>(); //openList.Clear();
public void Reset(GridPos iStartPos, GridPos iEndPos, BaseGrid iSearchGrid = null) { openList.Clear(); m_startNode = null; m_endNode = null; if (iSearchGrid != null) m_searchGrid = iSearchGrid; m_searchGrid.Reset(); m_startNode = m_searchGrid.GetNodeAt(iStartPos.x, iStartPos.y); m_endNode = m_searchGrid.GetNodeAt(iEndPos.x, iEndPos.y); if (m_startNode == null) m_startNode = new Node(iStartPos.x, iStartPos.y, true); if (m_endNode == null) m_endNode = new Node(iEndPos.x, iEndPos.y, true); }
public BaseGrid(BaseGrid b) { m_gridRect = new GridRect(b.m_gridRect); width = b.width; height = b.height; }
public JumpPointParam(JumpPointParam b) { m_heuristic = b.m_heuristic; m_allowEndNodeUnWalkable = b.m_allowEndNodeUnWalkable; m_crossAdjacentPoint = b.m_crossAdjacentPoint; m_crossCorner = b.m_crossCorner; openList = new List<Node>(b.openList); m_searchGrid = b.m_searchGrid; m_startNode = b.m_startNode; m_endNode = b.m_endNode; m_useRecursive = b.m_useRecursive; }
protected BaseGrid(BaseGrid b) { gridRect = new GridRect(b.gridRect); Width = b.Width; Height = b.Height; }
public AStarParam(BaseGrid grid, GridPos startPos, GridPos endPos, float weight, DiagonalMovement diagonalMovement = DiagonalMovement.Always, HeuristicMode mode = HeuristicMode.Euclidean) : base(grid, startPos, endPos, diagonalMovement, mode) => Weight = weight;
public SearchGridForm() { InitializeComponent(); this.DoubleBuffered = true; m_resultBox = new List<ResultBox>(); this.Width = (width+1) * 20; this.Height = (height+1) * 20 +100; this.MaximumSize = new Size(this.Width, this.Height); this.MaximizeBox = false; m_rectangles = new GridBox[width][]; for (int widthTrav = 0; widthTrav < width; widthTrav++) { m_rectangles[widthTrav] = new GridBox[height]; for (int heightTrav = 0; heightTrav < height; heightTrav++) { if(widthTrav==(width/3) && heightTrav==(height/2)) m_rectangles[widthTrav][heightTrav] = new GridBox(widthTrav * 20, heightTrav * 20 + 50, BoxType.Start); else if (widthTrav == 41 && heightTrav == (height / 2)) m_rectangles[widthTrav][heightTrav] = new GridBox(widthTrav * 20 , heightTrav * 20 + 50, BoxType.End); else m_rectangles[widthTrav][heightTrav] = new GridBox(widthTrav * 20, heightTrav * 20 + 50, BoxType.Normal); } } m_resultLine = new List<GridLine>(); searchGrid = new StaticGrid(width, height); // searchGrid = new DynamicGrid(); //searchGrid = new DynamicGridWPool(SingletonHolder<NodePool>.Instance); jumpParam = new JumpPointParam(searchGrid, true, cbCrossCorners.Checked, cbCrossAdjacentPoint.Checked, HeuristicMode.EUCLIDEAN);//new JumpPointParam(searchGrid, startPos, endPos, cbCrossCorners.Checked, HeuristicMode.EUCLIDEANSQR); jumpParam.UseRecursive = cbUseRecursive.Checked; }