- Timestamp:
- 06/19/12 13:17:29 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/CVRPInterpreter.cs
r7881 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Data; 26 23 using HeuristicLab.Problems.Instances; 27 using HeuristicLab.Problems.VehicleRouting. Interfaces;24 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 28 25 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 29 using HeuristicLab.Data;30 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;31 26 32 27 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 33 public class CVRPInterpreter : IVRPDataInterpreter<CVRPData> {28 public class CVRPInterpreter : IVRPDataInterpreter<CVRPData> { 34 29 public VRPInstanceDescription Interpret(IVRPData data) { 35 30 CVRPData cvrpData = data as CVRPData; … … 40 35 41 36 CVRPProblemInstance problem = new CVRPProblemInstance(); 42 if (cvrpData.Coordinates != null)37 if (cvrpData.Coordinates != null) 43 38 problem.Coordinates = new DoubleMatrix(cvrpData.Coordinates); 44 39 if (cvrpData.MaximumVehicles != null) … … 58 53 PotvinEncoding solution = new PotvinEncoding(problem); 59 54 60 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) {55 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) { 61 56 Tour tour = new Tour(); 62 57 solution.Tours.Add(tour); … … 66 61 } 67 62 } 68 63 69 64 result.BestKnownSolution = solution; 70 65 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/CVRPTWInterpreter.cs
r7881 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Data; 26 23 using HeuristicLab.Problems.Instances; 27 using HeuristicLab.Problems.VehicleRouting. Interfaces;24 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 28 25 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 29 using HeuristicLab.Data;30 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;31 26 32 27 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 33 public class CVRPTWInterpreter : IVRPDataInterpreter<CVRPTWData> {28 public class CVRPTWInterpreter : IVRPDataInterpreter<CVRPTWData> { 34 29 public VRPInstanceDescription Interpret(IVRPData data) { 35 30 CVRPTWData cvrpData = data as CVRPTWData; … … 40 35 41 36 CVRPTWProblemInstance problem = new CVRPTWProblemInstance(); 42 if (cvrpData.Coordinates != null)37 if (cvrpData.Coordinates != null) 43 38 problem.Coordinates = new DoubleMatrix(cvrpData.Coordinates); 44 39 if (cvrpData.MaximumVehicles != null) … … 61 56 PotvinEncoding solution = new PotvinEncoding(problem); 62 57 63 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) {58 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) { 64 59 Tour tour = new Tour(); 65 60 solution.Tours.Add(tour); … … 69 64 } 70 65 } 71 66 72 67 result.BestKnownSolution = solution; 73 68 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/IVRPDataInterpreter.cs
r7871 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 22 using HeuristicLab.Problems.Instances; 27 23 using HeuristicLab.Problems.VehicleRouting.Interfaces; … … 35 31 public IVRPEncoding BestKnownSolution { get; set; } 36 32 } 37 38 public interface IVRPDataInterpreter 33 34 public interface IVRPDataInterpreter { 39 35 VRPInstanceDescription Interpret(IVRPData data); 40 36 } 41 37 42 public interface IVRPDataInterpreter<T> : IVRPDataInterpreter where T : IVRPData {38 public interface IVRPDataInterpreter<T> : IVRPDataInterpreter where T : IVRPData { 43 39 } 44 40 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/MDCVRPTWInterpreter.cs
r7881 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Data; 26 23 using HeuristicLab.Problems.Instances; 27 using HeuristicLab.Problems.VehicleRouting. Interfaces;24 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 28 25 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 29 using HeuristicLab.Data;30 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;31 26 32 27 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 33 public class MDCVRPTWInterpreter : IVRPDataInterpreter<MDCVRPTWData> {28 public class MDCVRPTWInterpreter : IVRPDataInterpreter<MDCVRPTWData> { 34 29 public VRPInstanceDescription Interpret(IVRPData data) { 35 30 MDCVRPTWData cvrpData = data as MDCVRPTWData; … … 40 35 41 36 MDCVRPTWProblemInstance problem = new MDCVRPTWProblemInstance(); 42 if (cvrpData.Coordinates != null)37 if (cvrpData.Coordinates != null) 43 38 problem.Coordinates = new DoubleMatrix(cvrpData.Coordinates); 44 39 if (cvrpData.MaximumVehicles != null) … … 65 60 PotvinEncoding solution = new PotvinEncoding(problem); 66 61 67 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) {62 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) { 68 63 Tour tour = new Tour(); 69 64 solution.Tours.Add(tour); … … 73 68 } 74 69 } 75 70 76 71 result.BestKnownSolution = solution; 77 72 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/PDPTWInterpreter.cs
r7881 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Data; 26 23 using HeuristicLab.Problems.Instances; 27 using HeuristicLab.Problems.VehicleRouting. Interfaces;24 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 28 25 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 29 using HeuristicLab.Data;30 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;31 26 32 27 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 33 public class PDPTWInterpreter : IVRPDataInterpreter<PDPTWData> {28 public class PDPTWInterpreter : IVRPDataInterpreter<PDPTWData> { 34 29 public VRPInstanceDescription Interpret(IVRPData data) { 35 30 PDPTWData cvrpData = data as PDPTWData; … … 40 35 41 36 CVRPPDTWProblemInstance problem = new CVRPPDTWProblemInstance(); 42 if (cvrpData.Coordinates != null)37 if (cvrpData.Coordinates != null) 43 38 problem.Coordinates = new DoubleMatrix(cvrpData.Coordinates); 44 39 if (cvrpData.MaximumVehicles != null) … … 62 57 PotvinEncoding solution = new PotvinEncoding(problem); 63 58 64 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) {59 for (int i = 0; i < cvrpData.BestKnownTour.GetLength(0); i++) { 65 60 Tour tour = new Tour(); 66 61 solution.Tours.Add(tour); … … 70 65 } 71 66 } 72 67 73 68 result.BestKnownSolution = solution; 74 69 }
Note: See TracChangeset
for help on using the changeset viewer.