Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/13/12 16:35:13 (13 years ago)
Author:
abeham
Message:

#1614

  • included TSLIB's ATSP and CVRP problems as well
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  
    2222namespace HeuristicLab.Problems.Instances.ElloumiCTAP {
    2323  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; }
    3234  }
    3335}
  • branches/GeneralizedQAP/HeuristicLab.Problems.Instances.ElloumiCTAP/3.3/ElloumiCTAPInstanceProvider.cs

    r7448 r7466  
    2828
    2929namespace 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 {
    3432      get { return "Elloumi's CTAP instances"; }
    3533    }
    3634
    37     public string Description {
     35    public override string Description {
    3836      get { return "CTAP instances published by Sourour Elloumi"; }
    3937    }
    4038
    41     public Uri Link {
     39    public override Uri Link {
    4240      get { return new Uri("http://cedric.cnam.fr/oc/TAP/TAP.html"); }
    4341    }
    4442
    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() {
    6044      var solutions = Assembly.GetExecutingAssembly()
    6145        .GetManifestResourceNames()
     
    7054    }
    7155
    72     public ICTAPInstance GetInstance(IInstanceDescriptor id) {
     56    public override ICTAPInstance GetInstance(IInstanceDescriptor id) {
    7357      var descriptor = (ElloumiCTAPInstanceDescriptor)id;
    7458      var instance = new ElloumiCTAPInstance();
     
    7862        datParser.Parse(stream);
    7963        if (datParser.Error != null) throw datParser.Error;
     64        instance.Processors = datParser.Processors;
     65        instance.Tasks = datParser.Tasks;
    8066        instance.ExecutionCosts = datParser.ExecutionCosts;
    8167        instance.CommunicationCosts = datParser.CommunicationCosts;
Note: See TracChangeset for help on using the changeset viewer.