public static List <ViaLocation> RandomLocationsFromOrigin(Location origin, double radius) { List <ViaLocation> viaLocations = new List <ViaLocation>(); for (int i = 0; i < 2; i++) { double lat = WPF.RandomDouble(origin.Latitude - (radius / 110.567), origin.Latitude + (radius / 110.567)); double lon = WPF.RandomDouble(origin.Longitude - (radius / 111.321), origin.Longitude + (radius / 111.321)); viaLocations.Add(new ViaLocation(lat.ToString(CultureInfo.InvariantCulture) + "," + lon.ToString(CultureInfo.InvariantCulture), i)); } return(viaLocations); }
public TaxiDriver(double currentl, double currentlo) { currentLocation = new Location(currentl, currentlo); id = globalid++; faulCost = WPF.RandomDouble(1.0, 100); startCost = WPF.RandomDouble(0.0, faulCost * 2); workSpan = WPF.RandomDouble(1.0, 10.0); workLeft = workSpan; costPerKm = WPF.RandomDouble(faulCost, faulCost * 10.0); minEarning = WPF.RandomDouble(faulCost, faulCost * 5.0); }