Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/15 13:28:37 (10 years ago)
Author:
abeham
Message:

#2174:

  • Some refactorings and bug fixes
  • Renamed (Binary|Integer|Real)Encoding to (Binary|Integer|Real)VectorEncoding
  • Improved error messages when compiling programmable problems
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  
    8181    }
    8282
    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 
    9383    protected IConstrainedValueParameter<T> GetParameter(IEncoding encoding) {
    9484      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  
    110110      LocalEvaluatedSolutionsParameter.ActualValue = new IntValue(count);
    111111      QualityParameter.ActualValue = new DoubleValue(quality);
    112       individual.Copy(ExecutionContext.Scope);
     112      individual.CopyToScope(ExecutionContext.Scope);
    113113      return base.Apply();
    114114    }
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveGenerator.cs

    r11753 r11885  
    7474      for (int i = 0; i < moveScopes.Length; i++) {
    7575        moveScopes[i] = new Scope(i.ToString(CultureInfo.InvariantCulture.NumberFormat));
    76         nbhood[i].Copy(moveScopes[i]);
     76        nbhood[i].CopyToScope(moveScopes[i]);
    7777      }
    7878      ExecutionContext.Scope.SubScopes.AddRange(moveScopes);
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveMoveMaker.cs

    r11753 r11885  
    6363      var encoding = EncodingParameter.ActualValue;
    6464      var individual = encoding.GetIndividual(ExecutionContext.Scope);
    65       individual.Copy(ExecutionContext.Scope.Parent.Parent);
     65      individual.CopyToScope(ExecutionContext.Scope.Parent.Parent);
    6666
    6767      if (QualityParameter.ActualValue == null) QualityParameter.ActualValue = new DoubleValue(MoveQualityParameter.ActualValue.Value);
Note: See TracChangeset for help on using the changeset viewer.