- Timestamp:
- 02/04/15 13:28:37 (10 years ago)
- Location:
- branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiEncodingOperator.cs
r11797 r11885 81 81 } 82 82 83 public virtual void ReplaceEncoding(IEncoding oldEncoding, IEncoding newEncoding) {84 var oldParameterValue = GetParameter(oldEncoding).Value;85 RemoveEncoding(oldEncoding);86 AddEncoding(newEncoding);87 88 var parameter = GetParameter(newEncoding);89 var newParameterValue = parameter.ValidValues.FirstOrDefault(op => op.GetType() == oldParameterValue.GetType());90 if (newParameterValue != null) parameter.Value = newParameterValue;91 }92 93 83 protected IConstrainedValueParameter<T> GetParameter(IEncoding encoding) { 94 84 if (!Parameters.ContainsKey(encoding.Name)) throw new ArgumentException(string.Format("Encoding {0} was not added to the MultiEncoding.", encoding.Name)); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveImprover.cs
r11880 r11885 110 110 LocalEvaluatedSolutionsParameter.ActualValue = new IntValue(count); 111 111 QualityParameter.ActualValue = new DoubleValue(quality); 112 individual.Copy (ExecutionContext.Scope);112 individual.CopyToScope(ExecutionContext.Scope); 113 113 return base.Apply(); 114 114 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveGenerator.cs
r11753 r11885 74 74 for (int i = 0; i < moveScopes.Length; i++) { 75 75 moveScopes[i] = new Scope(i.ToString(CultureInfo.InvariantCulture.NumberFormat)); 76 nbhood[i].Copy (moveScopes[i]);76 nbhood[i].CopyToScope(moveScopes[i]); 77 77 } 78 78 ExecutionContext.Scope.SubScopes.AddRange(moveScopes); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveMaker.cs
r11753 r11885 63 63 var encoding = EncodingParameter.ActualValue; 64 64 var individual = encoding.GetIndividual(ExecutionContext.Scope); 65 individual.Copy (ExecutionContext.Scope.Parent.Parent);65 individual.CopyToScope(ExecutionContext.Scope.Parent.Parent); 66 66 67 67 if (QualityParameter.ActualValue == null) QualityParameter.ActualValue = new DoubleValue(MoveQualityParameter.ActualValue.Value);
Note: See TracChangeset
for help on using the changeset viewer.