- Timestamp:
- 02/13/12 16:35:13 (13 years ago)
- Location:
- branches/GeneralizedQAP
- Files:
-
- 7 added
- 3 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/ProblemInstanceProviderView.cs
r7448 r7466 59 59 private void loadButton_Click(object sender, EventArgs e) { 60 60 var instance = (IInstanceDescriptor)instancesComboBox.SelectedItem; 61 Content.FeedConsumer(instance); 61 if (!Content.FeedConsumer(instance)) { 62 MessageBox.Show("Loading the problem instance " + instance.Name + " failed."); 63 } 62 64 } 63 65 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GeneralizedQuadraticAssignmentProblem.cs
r7448 r7466 38 38 [Creatable("Problems")] 39 39 [StorableClass] 40 public sealed class GeneralizedQuadraticAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<IGQAPEvaluator, IGQAPSolutionCreator>, IStorableContent, IProblemInstanceConsumer<IQAPInstance>, IProblemInstanceConsumer<ICTAPInstance> {40 public sealed class GeneralizedQuadraticAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<IGQAPEvaluator, IGQAPSolutionCreator>, IStorableContent, IProblemInstanceConsumer<IQAPInstance>, IProblemInstanceConsumer<ICTAPInstance>, IProblemInstanceConsumer<ITSPInstance>, IProblemInstanceConsumer<IATSPInstance> { 41 41 42 42 public override Image ItemImage { … … 206 206 } 207 207 208 public void LoadFrom(IQAPInstance instance) { 209 Name = instance.Name; 210 Description = instance.Description; 211 212 Weights = new DoubleMatrix(instance.Weights); 213 Distances = new DoubleMatrix(instance.Distances); 214 InstallationCosts = new DoubleMatrix(Weights.Rows, Distances.Columns); // all zero 215 Capacities = new DoubleArray(Enumerable.Range(0, Distances.Rows).Select(x => 1.0).ToArray()); 216 Demands = new DoubleArray(Enumerable.Range(0, Weights.Rows).Select(x => 1.0).ToArray()); 217 218 TransportationCosts.Value = 1; 219 220 if (instance.BestKnownAssignment != null) { 221 EvaluateAndLoadAssignment(instance.BestKnownAssignment); 222 } else { 223 BestKnownQuality = null; 224 BestKnownSolution = null; 225 BestKnownSolutions = null; 226 } 227 } 228 229 public void LoadFrom(ICTAPInstance instance) { 230 Name = instance.Name; 231 Description = instance.Description; 232 233 Capacities = new DoubleArray(instance.MemoryCapacities); 234 Demands = new DoubleArray(instance.MemoryRequirements); 235 Weights = new DoubleMatrix(instance.CommunicationCosts); 236 InstallationCosts = new DoubleMatrix(instance.ExecutionCosts.Transpose()); 237 Distances = new DoubleMatrix(Capacities.Length, Capacities.Length); // all one, except diagonal 238 for (int i = 0; i < Capacities.Length - 1; i++) 239 for (int j = i + 1; j < Capacities.Length; j++) { 240 Distances[i, j] = 1; 241 Distances[j, i] = 1; 242 } 243 244 TransportationCosts.Value = 1; 245 246 if (instance.BestKnownAssignment != null) { 247 EvaluateAndLoadAssignment(instance.BestKnownAssignment); 248 } else { 249 BestKnownQuality = null; 250 BestKnownSolution = null; 251 BestKnownSolutions = null; 252 } 208 public bool LoadFrom(IQAPInstance instance) { 209 try { 210 Name = instance.Name; 211 Description = instance.Description; 212 213 Weights = new DoubleMatrix(instance.Weights); 214 Distances = new DoubleMatrix(instance.Distances); 215 InstallationCosts = new DoubleMatrix(Weights.Rows, Distances.Columns); // all zero 216 Capacities = new DoubleArray(Enumerable.Range(0, Distances.Rows).Select(x => 1.0).ToArray()); 217 Demands = new DoubleArray(Enumerable.Range(0, Weights.Rows).Select(x => 1.0).ToArray()); 218 219 TransportationCosts.Value = 1; 220 221 if (instance.BestKnownAssignment != null) { 222 EvaluateAndLoadAssignment(instance.BestKnownAssignment); 223 } else { 224 BestKnownQuality = null; 225 BestKnownSolution = null; 226 BestKnownSolutions = null; 227 } 228 } catch { 229 return false; 230 } 231 return true; 232 } 233 234 public bool LoadFrom(ICTAPInstance instance) { 235 try { 236 Name = instance.Name; 237 Description = instance.Description; 238 239 Capacities = new DoubleArray(instance.MemoryCapacities); 240 Demands = new DoubleArray(instance.MemoryRequirements); 241 Weights = new DoubleMatrix(instance.CommunicationCosts); 242 InstallationCosts = new DoubleMatrix(instance.ExecutionCosts.Transpose()); 243 Distances = new DoubleMatrix(Capacities.Length, Capacities.Length); // all one, except diagonal 244 for (int i = 0; i < Capacities.Length - 1; i++) 245 for (int j = i + 1; j < Capacities.Length; j++) { 246 Distances[i, j] = 1; 247 Distances[j, i] = 1; 248 } 249 250 TransportationCosts.Value = 1; 251 252 if (instance.BestKnownAssignment != null) { 253 EvaluateAndLoadAssignment(instance.BestKnownAssignment); 254 } else { 255 BestKnownQuality = null; 256 BestKnownSolution = null; 257 BestKnownSolutions = null; 258 } 259 } catch { 260 return false; 261 } 262 return true; 263 } 264 265 public bool LoadFrom(ITSPInstance instance) { 266 try { 267 if (instance.Dimension > 1000) return false; 268 269 Name = instance.Name; 270 Description = instance.Description; 271 272 Capacities = new DoubleArray(instance.Dimension); 273 Demands = new DoubleArray(instance.Dimension); 274 for (int i = 0; i < instance.Dimension; i++) { 275 Capacities[i] = 1; 276 Demands[i] = 1; 277 } 278 InstallationCosts = new DoubleMatrix(instance.Dimension, instance.Dimension); 279 Weights = new DoubleMatrix(instance.Dimension, instance.Dimension); 280 for (int i = 0; i < instance.Dimension; i++) 281 Weights[i, (i + 1) % instance.Dimension] = 1; 282 Distances = new DoubleMatrix(instance.GetDistanceMatrix()); 283 284 TransportationCosts.Value = 1; 285 286 if (instance.BestKnownTour != null) { 287 EvaluateAndLoadAssignment(instance.BestKnownTour); 288 } else { 289 BestKnownQuality = null; 290 BestKnownSolution = null; 291 BestKnownSolutions = null; 292 } 293 } catch { 294 return false; 295 } 296 return true; 297 } 298 299 public bool LoadFrom(IATSPInstance instance) { 300 try { 301 Name = instance.Name; 302 Description = instance.Description; 303 304 Capacities = new DoubleArray(instance.Dimension); 305 Demands = new DoubleArray(instance.Dimension); 306 for (int i = 0; i < instance.Dimension; i++) { 307 Capacities[i] = 1; 308 Demands[i] = 1; 309 } 310 InstallationCosts = new DoubleMatrix(instance.Dimension, instance.Dimension); 311 Weights = new DoubleMatrix(instance.Dimension, instance.Dimension); 312 for (int i = 0; i < instance.Dimension; i++) 313 Weights[i, (i + 1) % instance.Dimension] = 1; 314 Distances = new DoubleMatrix(instance.Distances); 315 316 TransportationCosts.Value = 1; 317 318 if (instance.BestKnownTour != null) { 319 EvaluateAndLoadAssignment(instance.BestKnownTour); 320 } else { 321 BestKnownQuality = null; 322 BestKnownSolution = null; 323 BestKnownSolutions = null; 324 } 325 } catch { 326 return false; 327 } 328 return true; 253 329 } 254 330 -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.ElloumiCTAP/3.3/ElloumiCTAPInstance.cs
r7445 r7466 22 22 namespace HeuristicLab.Problems.Instances.ElloumiCTAP { 23 23 internal class ElloumiCTAPInstance : ICTAPInstance { 24 public string Name { get; internal set; } 25 public string Description { get; internal set; } 26 public double[,] ExecutionCosts { get; internal set; } 27 public double[,] CommunicationCosts { get; internal set; } 28 public double[] MemoryRequirements { get; internal set; } 29 public double[] MemoryCapacities { get; internal set; } 30 public int[] BestKnownAssignment { get; internal set; } 31 public double? BestKnownQuality { get; internal set; } 24 public string Name { get; set; } 25 public string Description { get; set; } 26 public int Processors { get; set; } 27 public int Tasks { get; set; } 28 public double[,] ExecutionCosts { get; set; } 29 public double[,] CommunicationCosts { get; set; } 30 public double[] MemoryRequirements { get; set; } 31 public double[] MemoryCapacities { get; set; } 32 public int[] BestKnownAssignment { get; set; } 33 public double? BestKnownQuality { get; set; } 32 34 } 33 35 } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.ElloumiCTAP/3.3/ElloumiCTAPInstanceProvider.cs
r7448 r7466 28 28 29 29 namespace HeuristicLab.Problems.Instances.ElloumiCTAP { 30 public class ElloumiCTAPInstanceProvider : IProblemInstanceProvider<ICTAPInstance> { 31 private IProblemInstanceConsumer<ICTAPInstance> consumer; 32 33 public string Name { 30 public class ElloumiCTAPInstanceProvider : ProblemInstanceProvider<ICTAPInstance> { 31 public override string Name { 34 32 get { return "Elloumi's CTAP instances"; } 35 33 } 36 34 37 public string Description {35 public override string Description { 38 36 get { return "CTAP instances published by Sourour Elloumi"; } 39 37 } 40 38 41 public Uri Link {39 public override Uri Link { 42 40 get { return new Uri("http://cedric.cnam.fr/oc/TAP/TAP.html"); } 43 41 } 44 42 45 public bool ConsumerCanBeFed { 46 get { return consumer != null; } 47 } 48 49 public void SetConsumer(IProblemInstanceConsumer consumer) { 50 if (consumer is IProblemInstanceConsumer<ICTAPInstance>) 51 this.consumer = (IProblemInstanceConsumer<ICTAPInstance>)consumer; 52 else this.consumer = null; 53 } 54 55 public void FeedConsumer(IInstanceDescriptor descriptor) { 56 consumer.LoadFrom(GetInstance(descriptor)); 57 } 58 59 public IEnumerable<IInstanceDescriptor> GetInstanceDescriptors() { 43 public override IEnumerable<IInstanceDescriptor> GetInstanceDescriptors() { 60 44 var solutions = Assembly.GetExecutingAssembly() 61 45 .GetManifestResourceNames() … … 70 54 } 71 55 72 public ICTAPInstance GetInstance(IInstanceDescriptor id) {56 public override ICTAPInstance GetInstance(IInstanceDescriptor id) { 73 57 var descriptor = (ElloumiCTAPInstanceDescriptor)id; 74 58 var instance = new ElloumiCTAPInstance(); … … 78 62 datParser.Parse(stream); 79 63 if (datParser.Error != null) throw datParser.Error; 64 instance.Processors = datParser.Processors; 65 instance.Tasks = datParser.Tasks; 80 66 instance.ExecutionCosts = datParser.ExecutionCosts; 81 67 instance.CommunicationCosts = datParser.CommunicationCosts; -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.QAPLIB/3.3
- Property svn:ignore
-
old new 1 1 *.user 2 2 obj 3 Plugin.cs
-
- Property svn:ignore
-
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.QAPLIB/3.3/QAPLIBInstance.cs
r7445 r7466 24 24 public string Name { get; set; } 25 25 public string Description { get; set; } 26 public int Dimension { get; set; } 26 27 public double[,] Distances { get; set; } 27 28 public double[,] Weights { get; set; } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.QAPLIB/3.3/QAPLIBInstanceProvider.cs
r7448 r7466 28 28 29 29 namespace HeuristicLab.Problems.Instances.QAPLIB { 30 public class QAPLIBInstanceProvider : IProblemInstanceProvider<IQAPInstance> { 31 IProblemInstanceConsumer<IQAPInstance> consumer; 32 33 public string Name { 30 public class QAPLIBInstanceProvider : ProblemInstanceProvider<IQAPInstance> { 31 public override string Name { 34 32 get { return "QAPLIB"; } 35 33 } 36 34 37 public string Description {35 public override string Description { 38 36 get { return "Quadratic Assignment Problem Library"; } 39 37 } 40 38 41 public Uri Link {39 public override Uri Link { 42 40 get { return new Uri("http://www.seas.upenn.edu/qaplib/"); } 43 41 } 44 42 45 public bool ConsumerCanBeFed { 46 get { return consumer != null; } 47 } 48 49 public void SetConsumer(IProblemInstanceConsumer consumer) { 50 if (consumer is IProblemInstanceConsumer<IQAPInstance>) 51 this.consumer = (IProblemInstanceConsumer<IQAPInstance>)consumer; 52 else this.consumer = null; 53 } 54 55 public void FeedConsumer(IInstanceDescriptor descriptor) { 56 consumer.LoadFrom(GetInstance(descriptor)); 57 } 58 59 public IEnumerable<IInstanceDescriptor> GetInstanceDescriptors() { 43 public override IEnumerable<IInstanceDescriptor> GetInstanceDescriptors() { 60 44 var solutions = Assembly.GetExecutingAssembly() 61 45 .GetManifestResourceNames() … … 70 54 } 71 55 72 public IQAPInstance GetInstance(IInstanceDescriptor id) {56 public override IQAPInstance GetInstance(IInstanceDescriptor id) { 73 57 var descriptor = (QAPLIBInstanceDescriptor)id; 74 58 var instance = new QAPLIBInstance(); … … 78 62 datParser.Parse(stream); 79 63 if (datParser.Error != null) throw datParser.Error; 64 instance.Dimension = datParser.Size; 80 65 instance.Distances = datParser.Distances; 81 66 instance.Weights = datParser.Weights; -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.TSPLIB/3.3/HeuristicLab.Problems.Instances.TSPLIB-3.3.csproj
r7465 r7466 45 45 </ItemGroup> 46 46 <ItemGroup> 47 <Compile Include="TSPLIBInstance.cs" /> 47 <Compile Include="TSPLIBATSPInstance.cs" /> 48 <Compile Include="TSPLIBATSPInstanceProvider.cs" /> 49 <Compile Include="TSPLIBCVRPInstance.cs" /> 50 <Compile Include="TSPLIBCVRPInstanceProvider.cs" /> 51 <Compile Include="TSPLIBTSPInstance.cs" /> 48 52 <Compile Include="TSPLIBInstanceDescriptor.cs" /> 49 53 <Compile Include="TSPLIBTSPInstanceProvider.cs" /> … … 192 196 <EmbeddedResource Include="Data\TSP\vm1084.tsp" /> 193 197 <EmbeddedResource Include="Data\TSP\vm1748.tsp" /> 198 <EmbeddedResource Include="Data\ATSP\br17.atsp" /> 199 <EmbeddedResource Include="Data\ATSP\ft53.atsp" /> 200 <EmbeddedResource Include="Data\ATSP\ft70.atsp" /> 201 <EmbeddedResource Include="Data\ATSP\ftv170.atsp" /> 202 <EmbeddedResource Include="Data\ATSP\ftv33.atsp" /> 203 <EmbeddedResource Include="Data\ATSP\ftv35.atsp" /> 204 <EmbeddedResource Include="Data\ATSP\ftv38.atsp" /> 205 <EmbeddedResource Include="Data\ATSP\ftv44.atsp" /> 206 <EmbeddedResource Include="Data\ATSP\ftv47.atsp" /> 207 <EmbeddedResource Include="Data\ATSP\ftv55.atsp" /> 208 <EmbeddedResource Include="Data\ATSP\ftv64.atsp" /> 209 <EmbeddedResource Include="Data\ATSP\ftv70.atsp" /> 210 <EmbeddedResource Include="Data\ATSP\kro124p.atsp" /> 211 <EmbeddedResource Include="Data\ATSP\p43.atsp" /> 212 <EmbeddedResource Include="Data\ATSP\rbg323.atsp" /> 213 <EmbeddedResource Include="Data\ATSP\rbg358.atsp" /> 214 <EmbeddedResource Include="Data\ATSP\rbg403.atsp" /> 215 <EmbeddedResource Include="Data\ATSP\rbg443.atsp" /> 216 <EmbeddedResource Include="Data\ATSP\ry48p.atsp" /> 217 <EmbeddedResource Include="Data\CVRP\att48.vrp" /> 218 <EmbeddedResource Include="Data\CVRP\eil13.vrp" /> 219 <EmbeddedResource Include="Data\CVRP\eil22.vrp" /> 220 <EmbeddedResource Include="Data\CVRP\eil23.vrp" /> 221 <EmbeddedResource Include="Data\CVRP\eil30.vrp" /> 222 <EmbeddedResource Include="Data\CVRP\eil31.vrp" /> 223 <EmbeddedResource Include="Data\CVRP\eil33.vrp" /> 224 <EmbeddedResource Include="Data\CVRP\eil51.vrp" /> 225 <EmbeddedResource Include="Data\CVRP\eil7.vrp" /> 226 <EmbeddedResource Include="Data\CVRP\eilA101.vrp" /> 227 <EmbeddedResource Include="Data\CVRP\eilA76.vrp" /> 228 <EmbeddedResource Include="Data\CVRP\eilB101.vrp" /> 229 <EmbeddedResource Include="Data\CVRP\eilB76.vrp" /> 230 <EmbeddedResource Include="Data\CVRP\eilC76.vrp" /> 231 <EmbeddedResource Include="Data\CVRP\eilD76.vrp" /> 232 <EmbeddedResource Include="Data\CVRP\gil262.vrp" /> 194 233 <None Include="Plugin.cs.frame" /> 195 234 <Compile Include="Plugin.cs" /> … … 206 245 </ProjectReference> 207 246 </ItemGroup> 208 <ItemGroup> 209 <Folder Include="Data\ATSP\" /> 210 <Folder Include="Data\CVRP\" /> 211 </ItemGroup> 247 <ItemGroup /> 212 248 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 213 249 <PropertyGroup> -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBParser.cs
r7465 r7466 525 525 || edgeWeightFormat == TSPLIBEdgeWeightFormats.UPPER_ROW; 526 526 527 int dim1 = ! upperTriangular ? (diagonal ? 0 : 1) : 0;528 int dim2 = upperTriangular ? (diagonal ? 0 : 1) : 0;527 int dim1 = !triangular && !upperTriangular ? (diagonal ? 0 : 1) : 0; 528 int dim2 = !triangular && upperTriangular ? (diagonal ? 0 : 1) : 0; 529 529 bool finished = false; 530 530 while (!finished) { -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBTSPInstanceProvider.cs
r7465 r7466 45 45 var solutions = Assembly.GetExecutingAssembly() 46 46 .GetManifestResourceNames() 47 .Where(x => Regex.Match(x, @".*\.Data\.TSP\..*").Success) 47 48 .Where(x => x.EndsWith(".opt.tour")) 48 49 .ToDictionary(x => x.Substring(0, x.Length - ".opt.tour".Length) + ".tsp", x => x); 49 50 50 51 return Assembly.GetExecutingAssembly() 51 .GetManifestResourceNames() 52 .Where(x => x.EndsWith(".tsp")) 53 .OrderBy(x => x) 54 .Select(x => new TSPLIBInstanceDescriptor(GetPrettyName(x), GetDescription(), x, solutions.ContainsKey(x) ? solutions[x] : String.Empty)); 52 .GetManifestResourceNames() 53 .Where(x => Regex.Match(x, @".*\.Data\.TSP\..*").Success) 54 .Where(x => x.EndsWith(".tsp")) 55 .OrderBy(x => x) 56 .Select(x => new TSPLIBInstanceDescriptor(GetPrettyName(x), GetDescription(), x, solutions.ContainsKey(x) ? solutions[x] : String.Empty)); 55 57 } 56 58 57 59 public override ITSPInstance GetInstance(IInstanceDescriptor id) { 58 60 var descriptor = (TSPLIBInstanceDescriptor)id; 59 var instance = new TSPLIB Instance();61 var instance = new TSPLIBTSPInstance(); 60 62 using (var stream = Assembly.GetExecutingAssembly() 61 63 .GetManifestResourceStream(descriptor.InstanceIdentifier)) { 62 var tspParser = new TSPLIBParser(stream); 63 tspParser.Parse(); 64 instance.Coordinates = tspParser.Vertices != null ? tspParser.Vertices : tspParser.DisplayVertices; 65 instance.Distances = tspParser.Distances; 64 var parser = new TSPLIBParser(stream); 65 parser.Parse(); 66 instance.Dimension = parser.Dimension; 67 instance.Coordinates = parser.Vertices != null ? parser.Vertices : parser.DisplayVertices; 68 instance.Distances = parser.Distances; 69 switch (parser.EdgeWeightType) { 70 case TSPLIBEdgeWeightTypes.ATT: 71 instance.DistanceMeasure = TSPDistanceMeasure.Att; break; 72 case TSPLIBEdgeWeightTypes.CEIL_2D: 73 instance.DistanceMeasure = TSPDistanceMeasure.UpperEuclidean; break; 74 case TSPLIBEdgeWeightTypes.EUC_2D: 75 instance.DistanceMeasure = TSPDistanceMeasure.RoundedEuclidean; break; 76 case TSPLIBEdgeWeightTypes.EUC_3D: 77 throw new InvalidDataException("3D coordinates are not supported."); 78 case TSPLIBEdgeWeightTypes.EXPLICIT: 79 instance.DistanceMeasure = TSPDistanceMeasure.Direct; break; 80 case TSPLIBEdgeWeightTypes.GEO: 81 instance.DistanceMeasure = TSPDistanceMeasure.Geo; break; 82 case TSPLIBEdgeWeightTypes.MAN_2D: 83 instance.DistanceMeasure = TSPDistanceMeasure.Manhattan; break; 84 case TSPLIBEdgeWeightTypes.MAN_3D: 85 throw new InvalidDataException("3D coordinates are not supported."); 86 case TSPLIBEdgeWeightTypes.MAX_2D: 87 instance.DistanceMeasure = TSPDistanceMeasure.Maximum; break; 88 case TSPLIBEdgeWeightTypes.MAX_3D: 89 throw new InvalidDataException("3D coordinates are not supported."); 90 default: 91 throw new InvalidDataException("The given edge weight is not supported by HeuristicLab."); 92 } 66 93 67 instance.Name = tspParser.Name;68 instance.Description = tspParser.Comment94 instance.Name = parser.Name; 95 instance.Description = parser.Comment 69 96 + Environment.NewLine + Environment.NewLine 70 97 + GetDescription(); … … 73 100 using (Stream solStream = Assembly.GetExecutingAssembly() 74 101 .GetManifestResourceStream(descriptor.SolutionIdentifier)) { 75 var slnParser = new TSPLIBParser(solStream);76 slnParser.Parse();77 instance.BestKnownTour = slnParser.Tour[0];102 var tourParser = new TSPLIBParser(solStream); 103 tourParser.Parse(); 104 instance.BestKnownTour = tourParser.Tour[0]; 78 105 } 79 106 } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3
- Property svn:ignore
-
old new 1 1 obj 2 2 bin 3 Plugin.cs
-
- Property svn:ignore
-
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj
r7465 r7466 52 52 <ItemGroup> 53 53 <None Include="Plugin.cs.frame" /> 54 <Compile Include="Instances\IATSPInstance.cs" /> 54 55 <Compile Include="Instances\ICTAPInstance.cs" /> 55 56 <Compile Include="IInstanceDescriptor.cs" /> 57 <Compile Include="Instances\ICVRPInstance.cs" /> 56 58 <Compile Include="Instances\IQAPInstance.cs" /> 57 59 <Compile Include="Instances\ITSPInstance.cs" /> -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs
r7448 r7466 24 24 25 25 public interface IProblemInstanceConsumer<TInstance> : IProblemInstanceConsumer { 26 voidLoadFrom(TInstance instance);26 bool LoadFrom(TInstance instance); 27 27 } 28 28 } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs
r7448 r7466 33 33 34 34 void SetConsumer(IProblemInstanceConsumer consumer); 35 voidFeedConsumer(IInstanceDescriptor descriptor);35 bool FeedConsumer(IInstanceDescriptor descriptor); 36 36 37 37 IEnumerable<IInstanceDescriptor> GetInstanceDescriptors(); -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/Instances/ICTAPInstance.cs
r7445 r7466 21 21 22 22 namespace HeuristicLab.Problems.Instances { 23 /// <summary> 24 /// Describes instances of the Capacitated Task Assignment Problem (CTAP). 25 /// </summary> 23 26 public interface ICTAPInstance { 24 27 /// <summary> … … 31 34 string Description { get; } 32 35 36 /// <summary> 37 /// The number M of processors 38 /// </summary> 39 int Processors { get; } 40 /// <summary> 41 /// The number N of tasks 42 /// </summary> 43 int Tasks { get; } 33 44 /// <summary> 34 45 /// An MxN Matrix with M = |Processors| and N = |Tasks| -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/Instances/IQAPInstance.cs
r7445 r7466 21 21 22 22 namespace HeuristicLab.Problems.Instances { 23 /// <summary> 24 /// Describes instances of the Quadratic Assignment Problem (QAP). 25 /// </summary> 23 26 public interface IQAPInstance { 24 27 /// <summary> … … 31 34 string Description { get; } 32 35 36 /// <summary> 37 /// The number of facilities (and also the number of locations) 38 /// </summary> 39 int Dimension { get; } 33 40 /// <summary> 34 41 /// An NxN Matrix with N = |Faciliies| -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/Instances/ITSPInstance.cs
r7465 r7466 22 22 23 23 namespace HeuristicLab.Problems.Instances { 24 public enum TSPDistanceMeasure { Direct, Euclidean, RoundedEuclidean, Geo};24 public enum TSPDistanceMeasure { Direct, Euclidean, RoundedEuclidean, UpperEuclidean, Geo, Manhattan, Maximum, Att }; 25 25 26 /// <summary> 27 /// Describes instances of the Traveling Salesman Problem (TSP). 28 /// </summary> 26 29 public interface ITSPInstance { 27 30 /// <summary> … … 35 38 36 39 /// <summary> 40 /// The number of cities. 41 /// </summary> 42 int Dimension { get; } 43 /// <summary> 37 44 /// Specifies the distance measure that is to be used. 38 ///39 /// Direct = The distances are given in form of the distance matrix.40 /// Euclidean = The distances are calculated as euclidean distance.41 /// RoundedEuclidean = Each individual euclidean distance is rounded before42 /// being summed.43 /// Geo = The coordinates specify points on the surface of the44 /// earth and the distances are arc distances.45 45 /// </summary> 46 46 TSPDistanceMeasure DistanceMeasure { get; } … … 53 53 double[,] Distances { get; } 54 54 /// <summary> 55 /// Optional! A a matrix of dimension [N, 2] where each row is one of the cities55 /// Optional! A a matrix of dimension [N, 2] matrix where each row is one of the cities 56 56 /// and the colmns represent x and y coordinates respectively. 57 57 /// </summary> … … 74 74 /// </summary> 75 75 double? BestKnownQuality { get; } 76 77 /// <summary> 78 /// If only the coordinates are given, can calculate the distance matrix. 79 /// </summary> 80 /// <returns>A full distance matrix between all cities.</returns> 81 double[,] GetDistanceMatrix(); 76 82 } 77 83 } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs
r7465 r7466 41 41 } 42 42 43 public voidFeedConsumer(IInstanceDescriptor descriptor) {44 Consumer.LoadFrom(GetInstance(descriptor));43 public bool FeedConsumer(IInstanceDescriptor descriptor) { 44 return Consumer.LoadFrom(GetInstance(descriptor)); 45 45 } 46 46
Note: See TracChangeset
for help on using the changeset viewer.