Пример #1
0
        public FishNet(GISVertex _bottomleft, GISVertex _upright, double edgeLen)
        {
            bottomLeft = _bottomleft;
            upRight    = _upright;

            int xEdgeCount = (int)Math.Ceiling((upRight.x - bottomLeft.x) / edgeLen);
            int yEdgeCount = (int)Math.Ceiling((upRight.y - bottomLeft.y) / edgeLen);

            //i -> row, j ->column
            for (int i = 0; i < xEdgeCount; i++)
            {
                //i = 0; j = 1
                for (int j = 0; j < yEdgeCount; j++)
                {
                    double     x         = bottomLeft.x + edgeLen * j + edgeLen / 2;
                    double     y         = bottomLeft.y + edgeLen * i + edgeLen / 2;
                    CellCenter oneCenter = new CellCenter(x, y);
                    CellCenters.Add(oneCenter);
                }
            }
        }
Пример #2
0
        public double DistanceTo(GISVertex anotherLocation)
        {
            double distance = location.DistanceTo(anotherLocation);

            return(distance);
        }
Пример #3
0
 internal double DistanceTo(GISVertex anotherLocation)
 {
     return(Math.Sqrt((x - anotherLocation.x) * (x - anotherLocation.x) + (y - anotherLocation.y) * (y - anotherLocation.y)));
 }
Пример #4
0
 public DemandPoint(GISVertex _location, int carNumber, int objectid)
 {
     location  = _location;
     CarNumber = carNumber;
     objectID  = objectid;
 }
Пример #5
0
 public Car(GISVertex _location, CarState _State, int carID)
 {
     CarLocation = _location;
     State       = _State;
     CarID       = carID;
 }