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); } } }
public double DistanceTo(GISVertex anotherLocation) { double distance = location.DistanceTo(anotherLocation); return(distance); }
internal double DistanceTo(GISVertex anotherLocation) { return(Math.Sqrt((x - anotherLocation.x) * (x - anotherLocation.x) + (y - anotherLocation.y) * (y - anotherLocation.y))); }
public DemandPoint(GISVertex _location, int carNumber, int objectid) { location = _location; CarNumber = carNumber; objectID = objectid; }
public Car(GISVertex _location, CarState _State, int carID) { CarLocation = _location; State = _State; CarID = carID; }