public void MultiRoute() { DateTime startTime = DateTime.Now; var problem = new Problem(new DefaultCost { MilesPerGallon = 10, PricePerGallon = 4, HourlyWage = 50 }, 1000); var tasks = Tools.GetTasks(Tools.GetCoordinates(10), problem); var result = problem.Calculate(tasks, 2); Trace.WriteLine(String.Format("Total Seconds {0}", DateTime.Now.Subtract(startTime).TotalSeconds)); }
/// <summary> /// Create tasks for a problem from a set of coordinates /// </summary> public static List<Task> GetTasks(IEnumerable<Coordinate> coordinates, Problem problem) { var tasks = new List<Task>(); int id = 0; foreach (var coordinate in coordinates) { var newTask = new Task(id, coordinate.lat, coordinate.lon) { Time = 30 * 60, Problem = problem }; tasks.Add(newTask); id++; } return tasks; }
public Optimizer(Problem p, Configuration config) { Problem = p; Create(config); }