- Timestamp:
- 03/22/17 16:52:36 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/ProblemInstanceIdentifier/InstanceExplorer.cs
r14696 r14776 74 74 } 75 75 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 76 104 public class MemPRExplorer : InstanceExplorer { 77 105 public int Seconds { get; set; }
Note: See TracChangeset
for help on using the changeset viewer.