Changeset 15563 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LAHC/pLAHCContext.cs
- Timestamp:
- 12/30/17 23:10:29 (6 years ago)
- 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 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 24 25 using HeuristicLab.Parameters; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 27 27 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms.L ocalSearch{28 public sealed class LocalSearchContext : SingleObjectiveSingleSolutionContext<ISingleObjectiveSolutionScope<GQAPSolution>> {28 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms.LAHC { 29 public sealed class PLAHCContext : SingleObjectiveSingleSolutionContext<ISingleObjectiveSolutionScope<GQAPSolution>> { 29 30 [Storable] 30 31 private IValueParameter<GQAP> problem; … … 40 41 set { bestSolution.Value = value; } 41 42 } 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 } 42 71 43 72 [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) 46 75 : base(original, cloner) { 47 76 problem = cloner.Clone(original.problem); 48 77 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); 49 82 } 50 public LocalSearchContext() {83 public PLAHCContext() { 51 84 Parameters.Add(problem = new ValueParameter<GQAP>("Problem")); 52 85 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")); 53 90 } 54 91 55 92 public override IDeepCloneable Clone(Cloner cloner) { 56 return new LocalSearchContext(this, cloner);93 return new PLAHCContext(this, cloner); 57 94 } 58 95
Note: See TracChangeset
for help on using the changeset viewer.