- Timestamp:
- 05/13/19 13:59:30 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/branches/2931_OR-Tools_LP_MIP/HeuristicLab.Optimization (added) merged: 16233,16582 /trunk/HeuristicLab.Optimization merged: 16860,16875,16910
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs
r16751 r16946 96 96 : base(name) { 97 97 Parameters.Add(new ValueParameter<ISolutionCreator<TEncodedSolution>>(name + ".SolutionCreator", "The operator to create a solution.")); 98 Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly())); 98 Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly()) { 99 GetsCollected = false 100 }); 99 101 100 102 RegisterEventHandlers(); -
branches/2521_ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs
r16751 r16946 26 26 using HeuristicLab.Common; 27 27 using HeuristicLab.Core; 28 using HeuristicLab.Data; 28 29 using HeuristicLab.Parameters; 29 30 … … 190 191 newEncoding.Operators = operators; 191 192 } 193 194 protected override IEnumerable<KeyValuePair<string, IItem>> GetCollectedValues(IValueParameter param) { 195 if (param.Value == null) yield break; 196 if (param.GetsCollected) { 197 if (param == EncodingParameter) // store only the name of the encoding 198 yield return new KeyValuePair<string, IItem>(String.Empty, new StringValue(EncodingParameter.Value.Name)); 199 else yield return new KeyValuePair<string, IItem>(String.Empty, param.Value); 200 } 201 var parameterizedItem = param.Value as IParameterizedItem; 202 if (parameterizedItem != null) { 203 var children = new Dictionary<string, IItem>(); 204 parameterizedItem.CollectParameterValues(children); 205 foreach (var child in children) yield return child; 206 } 207 } 192 208 } 193 209 }
Note: See TracChangeset
for help on using the changeset viewer.