資源簡(jiǎn)介
A*尋路算法實(shí)現(xiàn)(C#源碼)
經(jīng)典的尋路算法
A*尋路算法實(shí)現(xiàn)(C#源碼)
經(jīng)典的尋路算法
A*尋路算法實(shí)現(xiàn)(C#源碼)
經(jīng)典的尋路算法

代碼片段和文件信息
//
//??THIS?CODE?AND?INFORMATION?IS?PROVIDED?“AS?IS“?WITHOUT?WARRANTY?OF?ANY
//??KIND?EITHER?EXPRESSED?OR?IMPLIED?INCLUDING?BUT?NOT?LIMITED?TO?THE
//??IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND/OR?FITNESS?FOR?A?PARTICULAR
//??PURPOSE.?IT?CAN?BE?DISTRIBUTED?FREE?OF?CHARGE?AS?LONG?AS?THIS?HEADER?
//??REMAINS?UNCHANGED.
//
//??Email:??gustavo_franco@hotmail.com
//
//??Copyright?(C)?2006?Franco?Gustavo?
//
using?System;
using?System.Data;
using?System.Text;
using?System.Drawing;
using?System.Windows.Forms;
using?System.ComponentModel;
using?System.Collections.Generic;
using?Algorithms;
namespace?PathFinderApp
{
????#region?Enums
????[Author(“Franco?Gustavo“)]
????public?enum?DrawModeSetup
????{
????????None????=?0
????????Start???=?1
????????End?????=?2
????????Block???=?3
????}
????#endregion
????[Author(“Franco?Gustavo“)]
????public?partial?class?PanelPathFinder?:?UserControl
????{
????????#region?Variables?Declaration
????????private?byte????????????????mNodeWeight?????=?1;
????????private?int?????????????????mGridSize???????=?20;
????????private?byte[]?????????????mMatrix?????????=?new?byte[10241024];
????????private?Point???????????????mStart??????????=?Point.Empty;
????????private?Point???????????????mEnd????????????=?Point.Empty;
????????private?DrawModeSetup???????mDrawMode???????=?DrawModeSetup.None;
????????private?HeuristicFormula????mFormula????????=?HeuristicFormula.Manhattan;
????????#endregion
????????#region?Constructors
????????public?PanelPathFinder()
????????{
????????????InitializeComponent();
????????????ResetMatrix();
????????}
????????#endregion
????????#region?Properties
????????public?byte[]?Matrix
????????{
????????????get?{?return?mMatrix;?}
????????}
????????public?int?GridSize
????????{
????????????get?{?return?mGridSize;?}
????????????set?
????????????{?
????????????????mGridSize?=?value;?
????????????????Invalidate();
????????????}
????????}?
????????public?DrawModeSetup?DrawModeSetup
????????{
????????????get?{?return?mDrawMode;?}
????????????set?{?mDrawMode?=?value;?}
????????}
????????public?byte?NodeWeight
????????{
????????????get?{?return?mNodeWeight;?}
????????????set?{?mNodeWeight?=?value;?}
????????}
????????public?Point?Start
????????{
????????????get?{?return?mStart;?}
????????????set?{?mStart?=?value;?}
????????}
????????public?Point?End
????????{
????????????get?{?return?mEnd;?}
????????????set?{?mEnd?=?value;?}
????????}
????????public?HeuristicFormula?Formula
????????{
????????????get?{?return?mFormula;?}
????????????set?{?mFormula?=?value;?}
????????}
????????#endregion
????????#region?Methods
????????public?void?ResetMatrix()
????????{
????????????for(int?y=0;y ????????????????for(int?x=0;x ????????????????????mMatrix[xy]?=?1;
????????????
????????????mStart????=?Point.Empty;
????????????mEnd??????=?Point.Empt
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????45659??2006-08-28?17:11??PathFinderDemo.resx
?????文件?????????962??2006-08-24?00:06??Program.cs
?????文件?????????611??2006-08-24?00:06??Algorithms\AuthorAttribute.cs
?????文件????????1233??2006-08-26?17:58??Algorithms\HighResolutionTime.cs
?????文件????????1461??2006-08-29?09:33??Algorithms\IPathFinder.cs
?????文件???????15347??2006-08-31?12:09??Algorithms\PathFinder.cs
?????文件???????20323??2006-08-31?12:22??Algorithms\PathFinderFast.cs
?????文件????????4882??2006-08-28?03:26??Algorithms\PriorityQueueB.cs
?????目錄???????????0??2006-08-31?12:47??Algorithms\
?????目錄???????????0??2006-08-31?12:47??bin\Debug\
?????文件?????1000020??2006-08-31?12:39??bin\Debug\HardToGet.astar
?????文件?????1000020??2006-08-31?12:40??bin\Debug\HeavyDiagonals.astar
?????文件?????1000020??2006-08-31?12:41??bin\Debug\Maze.astar
?????文件?????1000020??2006-08-31?12:40??bin\Debug\Maze2.astar
?????文件?????1000020??2006-08-31?12:40??bin\Debug\Maze3.astar
?????文件???????86016??2006-08-31?12:20??bin\Debug\PathFinderApp.exe
?????文件?????1000020??2006-08-31?12:41??bin\Debug\RelativeCost.astar
?????文件?????1000020??2006-08-31?12:41??bin\Debug\RelativeCost2.astar
?????文件?????1000020??2006-08-31?12:41??bin\Debug\Sample1.astar
?????文件?????1000020??2006-08-31?12:41??bin\Debug\Sample2.astar
?????文件?????1000020??2006-08-31?12:41??bin\Debug\Sample3.astar
?????文件?????1000020??2006-08-31?12:43??bin\Debug\SmallIslands.astar
?????目錄???????????0??2006-08-31?13:03??bin\Release\
?????文件?????1000020??2006-08-31?12:39??bin\Release\HardToGet.astar
?????文件?????1000020??2006-08-31?12:40??bin\Release\HeavyDiagonals.astar
?????文件?????1000020??2006-08-31?12:41??bin\Release\Maze.astar
?????文件?????1000020??2006-08-31?12:40??bin\Release\Maze2.astar
?????文件?????1000020??2006-08-31?12:40??bin\Release\Maze3.astar
?????文件???????81920??2006-08-31?13:01??bin\Release\PathFinderApp.exe
?????文件?????1000020??2006-08-31?12:41??bin\Release\RelativeCost.astar
?????文件?????1000020??2006-08-31?12:41??bin\Release\RelativeCost2.astar
............此處省略18個(gè)文件信息
評(píng)論
共有 條評(píng)論