Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/17 16:52:36 (7 years ago)
Author:
abeham
Message:

#2457: working on MemPR integration

Location:
branches/PerformanceComparison/ProblemInstanceIdentifier
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/ProblemInstanceIdentifier/InstanceExplorer.cs

    r14696 r14776  
    7474  }
    7575
     76  public class AdaptiveWalkExplorer : InstanceExplorer {
     77    public int Iterations { get; set; }
     78
     79    public override string Name { get { return "Adaptive-Walk Explorer"; } }
     80    public override int Effort { get { return Iterations; } }
     81
     82    public AdaptiveWalkExplorer() {
     83
     84    }
     85
     86    public override InstanceDescriptor Explore(QuadraticAssignmentProblem problem, int? seed = null) {
     87      var walk = new AdaptiveWalk() {
     88        SeedParameter = { Value = { Value = seed ?? 0 } },
     89        SetSeedRandomlyParameter = { Value = { Value = seed.HasValue } },
     90        MaximumIterationsParameter = { Value = { Value = Iterations } },
     91        RepetitionsParameter = { Value = { Value = 1 } }
     92      };
     93      walk.Problem = problem;
     94      walk.Engine = new SequentialEngine();
     95      walk.MutatorParameter.Value = walk.MutatorParameter.ValidValues.First(x => x is Swap2Manipulator);
     96      var calculator = new AdaptiveWalkCalculator(walk) { Problem = problem };
     97      var features = calculator.Calculate().ToDictionary(x => x.Name, x => x.Value);
     98
     99      return new InstanceDescriptor(problem.Name, InstanceDescriptor.GetClass(problem.Name), problem.Weights.Rows,
     100        features.Keys.ToArray(), features.Values.Select(x => ((DoubleValue)x).Value).ToArray());
     101    }
     102  }
     103
    76104  public class MemPRExplorer : InstanceExplorer {
    77105    public int Seconds { get; set; }
  • branches/PerformanceComparison/ProblemInstanceIdentifier/Program.cs

    r14696 r14776  
    44using System.Linq;
    55using System.Threading.Tasks;
    6 using HeuristicLab.Algorithms.MemPR.Permutation;
    76using HeuristicLab.PluginInfrastructure;
    87using HeuristicLab.Problems.Instances;
Note: See TracChangeset for help on using the changeset viewer.