- Timestamp:
- 04/20/19 23:28:49 (6 years ago)
- Location:
- trunk/HeuristicLab.Optimization/3.3/BasicProblems
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Optimization/3.3/BasicProblems/BasicProblem.cs
r16565 r16860 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 28 using HeuristicLab.Data; 27 29 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 30 30 31 namespace HeuristicLab.Optimization { … … 157 158 OnOperatorsChanged(); 158 159 } 160 161 protected override IEnumerable<KeyValuePair<string, IItem>> GetCollectedValues(IValueParameter param) { 162 if (param.Value == null) yield break; 163 if (param.GetsCollected) { 164 if (param == EncodingParameter) // store only the name of the encoding 165 yield return new KeyValuePair<string, IItem>(String.Empty, new StringValue(EncodingParameter.Value.Name)); 166 else yield return new KeyValuePair<string, IItem>(String.Empty, param.Value); 167 } 168 var parameterizedItem = param.Value as IParameterizedItem; 169 if (parameterizedItem != null) { 170 var children = new Dictionary<string, IItem>(); 171 parameterizedItem.CollectParameterValues(children); 172 foreach (var child in children) yield return child; 173 } 174 } 159 175 } 160 176 } -
trunk/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs
r16565 r16860 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 30 30 namespace HeuristicLab.Optimization { … … 92 92 protected Encoding(string name) 93 93 : base(name) { 94 Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly())); 94 Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly()) { 95 GetsCollected = false 96 }); 95 97 } 96 98
Note: See TracChangeset
for help on using the changeset viewer.