Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/30/17 23:10:29 (6 years ago)
Author:
abeham
Message:

#1614:

  • Added LAHC and pLAHC-s
  • Changed all algorithms to update high frequency results only every second
Location:
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LAHC
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LAHC/pLAHCContext.cs

    r15562 r15563  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
     24using HeuristicLab.Data;
    2425using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    27 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms.LocalSearch {
    28   public sealed class LocalSearchContext : SingleObjectiveSingleSolutionContext<ISingleObjectiveSolutionScope<GQAPSolution>> {
     28namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms.LAHC {
     29  public sealed class PLAHCContext : SingleObjectiveSingleSolutionContext<ISingleObjectiveSolutionScope<GQAPSolution>> {
    2930    [Storable]
    3031    private IValueParameter<GQAP> problem;
     
    4041      set { bestSolution.Value = value; }
    4142    }
     43
     44    [Storable]
     45    private IValueParameter<IntValue> sprintIterations;
     46    public int SprintIterations {
     47      get { return sprintIterations.Value.Value; }
     48      set { sprintIterations.Value.Value = value; }
     49    }
     50
     51    [Storable]
     52    private IValueParameter<DoubleArray> memory;
     53    public DoubleArray Memory {
     54      get { return memory.Value; }
     55      set { memory.Value = value; }
     56    }
     57
     58    [Storable]
     59    private IValueParameter<IntValue> lastSuccess;
     60    public int LastSuccess {
     61      get { return lastSuccess.Value.Value; }
     62      set { lastSuccess.Value.Value = value; }
     63    }
     64
     65    [Storable]
     66    private IValueParameter<ItemList<DoubleValue>> bestList;
     67    public ItemList<DoubleValue> BestList {
     68      get { return bestList.Value; }
     69      set { bestList.Value = value; }
     70    }
    4271   
    4372    [StorableConstructor]
    44     private LocalSearchContext(bool deserializing) : base(deserializing) { }
    45     private LocalSearchContext(LocalSearchContext original, Cloner cloner)
     73    private PLAHCContext(bool deserializing) : base(deserializing) { }
     74    private PLAHCContext(PLAHCContext original, Cloner cloner)
    4675    : base(original, cloner) {
    4776      problem = cloner.Clone(original.problem);
    4877      bestSolution = cloner.Clone(original.bestSolution);
     78      sprintIterations = cloner.Clone(original.sprintIterations);
     79      memory = cloner.Clone(original.memory);
     80      lastSuccess = cloner.Clone(original.lastSuccess);
     81      bestList = cloner.Clone(original.bestList);
    4982    }
    50     public LocalSearchContext() {
     83    public PLAHCContext() {
    5184      Parameters.Add(problem = new ValueParameter<GQAP>("Problem"));
    5285      Parameters.Add(bestSolution = new ValueParameter<GQAPSolution>("BestFoundSolution"));
     86      Parameters.Add(sprintIterations = new ValueParameter<IntValue>("SprintIterations"));
     87      Parameters.Add(memory = new ValueParameter<DoubleArray>("Memory"));
     88      Parameters.Add(lastSuccess = new ValueParameter<IntValue>("LastSuccess"));
     89      Parameters.Add(bestList = new ValueParameter<ItemList<DoubleValue>>("BestList"));
    5390    }
    5491
    5592    public override IDeepCloneable Clone(Cloner cloner) {
    56       return new LocalSearchContext(this, cloner);
     93      return new PLAHCContext(this, cloner);
    5794    }
    5895
Note: See TracChangeset for help on using the changeset viewer.