コード例 #1
0
        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));
        }
コード例 #2
0
ファイル: Tools.cs プロジェクト: FoundOPS/TaskOptimizer
        /// <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;
        }
コード例 #3
0
ファイル: Optimizer.cs プロジェクト: FoundOPS/TaskOptimizer
 public Optimizer(Problem p, Configuration config)
 {
     Problem = p;
     Create(config);
 }