⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adjoindatastructure.cs

📁 实现A*算法的C#源代码
💻 CS
字号:

/*
    作者:Tom Xu(tsing_feng@163.com)
    创建时间:2006-11-03 13:40
    内容描述:生成邻接矩阵的所需要的数据结构
*/  
using System;
using System.Collections.Generic;
using System.Text;

namespace Iaspec.GIS.Common
{
    /// <summary>
    /// 邻接结点
    /// </summary>
    public struct AdjoinNode : IEquatable<AdjoinNode> 
    {
        public double X;
        public double Y;
        public AdjoinNode(double xValue, double yValue)
        {
            X = xValue;
            Y = yValue;
        }

        #region IEquatable<AdjoinNode> 成员

        public bool Equals(AdjoinNode other)
        {
            return this.X == other.X && this.Y == other.Y;
        }

        #endregion
    }

    /// <summary>
    /// 邻接结点间的距离
    /// </summary>
    public struct AdjoinDistance : IEquatable<AdjoinDistance>
    {
        public int ID1;
        public int ID2;
        public int ArcID;
        public double Length;

        public AdjoinDistance(int id1, int id2, int arcID, double len)
        {
            ID1 = id1;
            ID2 = id2;
            ArcID = arcID;
            Length = len;
        }

        #region IEquatable<AdjoinDistance> 成员

        public bool Equals(AdjoinDistance other)
        {
            return (this.ID1 == other.ID1 && this.ID2 == other.ID2 && this.ArcID == other.ArcID)
            || (this.ID1 == other.ID2 && this.ID2 == other.ID1 && this.ArcID == other.ArcID);
        }

        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -