示例#1
0
        public Som(int height, int width, int fvSize, int pvSize)
        {
            Total        = height * width;
            Height       = height;
            Width        = width;
            Radius       = (height + width) / 2;
            LearningRate = 0.05;
            FvSize       = fvSize;
            PvSize       = pvSize;
            Nodes        = new SNode[Total];

            for (int i = 0; i < Height; i++)
            {
                for (int j = 0; j < Width; j++)
                {
                    Nodes[i * Width + j] = new SNode(fvSize, pvSize, i, j);
                }
            }
        }
示例#2
0
 public double Distance(SNode node1, SNode node2) => Math.Sqrt(Math.Pow((double)(node1.X - node2.X), 2) + Math.Pow((double)(node1.Y - node2.Y), 2));