基本信息
源码名称:a星寻路 算法示例源码
源码大小:0.05M
文件格式:.zip
开发语言:C#
更新时间:2018-08-18
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AStar
{
    class Program
    {
        static void Main(string[] args)
        {
            matrix Matrix = new matrix(7, 3);
            Node startNode = new Node(2,2,0,new Node());
            Node endNode = new Node(6, 2, 0, new Node());
            Node obstalNode1 = new Node(4, 1, 0, new Node());
            Node obstalNode2 = new Node(4, 2, 0, new Node());
            Node obstalNode3 = new Node(4, 3, 0, new Node());
            Dictionary<string, Node> obstalDic = new Dictionary<string,Node>();
            obstalDic.Add(obstalNode1.getKey(), obstalNode1);
            obstalDic.Add(obstalNode2.getKey(), obstalNode1);
            obstalDic.Add(obstalNode3.getKey(), obstalNode1);
            Astar astar = new Astar(startNode, endNode, Matrix, obstalDic);
            astar.AStar();
            astar.getShortCutRoute();
            Console.Read();
        }
    }
}