- Timestamp:
- 02/13/12 16:35:13 (13 years ago)
- Location:
- branches/GeneralizedQAP/HeuristicLab.Problems.Instances.ElloumiCTAP/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.