Changeset 13496 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs
- Timestamp:
- 01/11/16 21:29:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs
r13480 r13496 58 58 private const string ExclusiveMatchingParameterName = "ExclusiveMatching"; 59 59 private const string UseAdaptiveReplacementRatioParameterName = "UseAdaptiveReplacementRatio"; 60 private const string StrictSchemaMatchingParameterName = "StrictSchemaMatching"; 60 61 #endregion 61 62 … … 117 118 public LookupParameter<IntValue> NumberOfChangedTreesParameter { 118 119 get { return (LookupParameter<IntValue>)Parameters[NumberOfChangedTreesParameterName]; } 120 } 121 public LookupParameter<BoolValue> StrictSchemaMatchingParameter { 122 get { return (LookupParameter<BoolValue>)Parameters[StrictSchemaMatchingParameterName]; } 119 123 } 120 124 #endregion … … 143 147 [Storable] 144 148 private readonly UpdateEstimatedValuesOperator updateEstimatedValuesOperator; 149 150 [StorableHook(HookType.AfterDeserialization)] 151 private void AfterDeserialization() { 152 if (!Parameters.ContainsKey(StrictSchemaMatchingParameterName)) 153 Parameters.Add(new LookupParameter<BoolValue>(StrictSchemaMatchingParameterName)); 154 } 145 155 146 156 public SchemaEvaluator() { … … 159 169 Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName)); 160 170 Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName)); 171 Parameters.Add(new LookupParameter<BoolValue>(StrictSchemaMatchingParameterName)); 161 172 Parameters.Add(new LookupParameter<ISymbolicExpressionTreeManipulator>(MutatorParameterName)); 162 173 Parameters.Add(new LookupParameter<ISymbolicExpressionTreeCrossover>(CrossoverParameterName)); … … 188 199 189 200 public override IOperation Apply() { 201 var strictSchemaMatching = StrictSchemaMatchingParameter.ActualValue.Value; 202 if (strictSchemaMatching) { 203 comp.MatchVariableWeights = true; 204 comp.MatchConstantValues = true; 205 } else { 206 comp.MatchVariableWeights = false; 207 comp.MatchConstantValues = false; 208 } 209 190 210 var individuals = ExecutionContext.Scope.SubScopes; // the scopes represent the individuals 191 211 var trees = individuals.Select(x => (ISymbolicExpressionTree)x.Variables["SymbolicExpressionTree"].Value).ToList(); 192 var qualities = individuals.Select(x => (DoubleValue)x.Variables["Quality"].Value).ToList();193 212 194 213 var random = RandomParameter.ActualValue;
Note: See TracChangeset
for help on using the changeset viewer.