Changeset 13527 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification
- Timestamp:
- 01/16/16 15:39:03 (9 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs
r13496 r13527 67 67 } 68 68 69 public override void InitializeState() { 70 base.InitializeState(); 71 evaluatedSolutionsTracker = 0; 72 } 73 69 74 public override void ClearState() { 75 base.ClearState(); 70 76 evaluatedSolutionsTracker = 0; 71 base.ClearState();72 77 } 73 78 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
r13496 r13527 111 111 #endregion 112 112 113 private Update EstimatedValuesOperator updateEstimatedValuesOperator;113 private UpdateQualityOperator updateQualityOperator; 114 114 private DiversificationStatisticsOperator diversificationStatisticsOperator; 115 115 … … 182 182 183 183 var updateEstimatedValues = new OperationCollection { Parallel = true }; 184 if (update EstimatedValuesOperator == null)185 update EstimatedValuesOperator = new UpdateEstimatedValuesOperator();184 if (updateQualityOperator == null) 185 updateQualityOperator = new UpdateQualityOperator(); 186 186 187 187 foreach (var s in ExecutionContext.Scope.SubScopes.Where(s => !s.Variables.ContainsKey("EstimatedValues"))) { 188 updateEstimatedValues.Add(ExecutionContext.CreateChildOperation(update EstimatedValuesOperator, s));188 updateEstimatedValues.Add(ExecutionContext.CreateChildOperation(updateQualityOperator, s)); 189 189 } 190 190 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs
r13496 r13527 143 143 }; 144 144 145 [Storable] 145 146 public ISymbolicExpressionTree Schema { get; set; } 146 147 147 148 [Storable] 148 private readonly Update EstimatedValuesOperator updateEstimatedValuesOperator;149 private readonly UpdateQualityOperator updateQualityOperator; 149 150 150 151 [StorableHook(HookType.AfterDeserialization)] … … 156 157 public SchemaEvaluator() { 157 158 qm = new QueryMatch(comp) { MatchParents = true }; 158 this.update EstimatedValuesOperator = new UpdateEstimatedValuesOperator();159 this.updateQualityOperator = new UpdateQualityOperator(); 159 160 #region add parameters 160 161 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SchemaParameterName, "The current schema to be evaluated")); … … 185 186 186 187 protected SchemaEvaluator(SchemaEvaluator original, Cloner cloner) : base(original, cloner) { 187 this.comp = original.comp == null ? new SymbolicExpressionTreeNodeEqualityComparer { 188 MatchConstantValues = false, 189 MatchVariableWeights = false, 190 MatchVariableNames = true 191 } : (ISymbolicExpressionTreeNodeEqualityComparer)original.comp.Clone(); 188 this.comp = new SymbolicExpressionTreeNodeEqualityComparer(); 192 189 this.qm = new QueryMatch(comp) { MatchParents = original.qm?.MatchParents ?? true }; 193 this.updateEstimatedValuesOperator = new UpdateEstimatedValuesOperator(); 190 this.updateQualityOperator = new UpdateQualityOperator(); 191 Schema = original.Schema; 194 192 } 195 193 … … 295 293 foreach (var ind in individualsToReplace) { 296 294 var mutatorOp = ExecutionContext.CreateChildOperation(mutator, ind); 297 var updateOp = ExecutionContext.CreateChildOperation(update EstimatedValuesOperator, ind);295 var updateOp = ExecutionContext.CreateChildOperation(updateQualityOperator, ind); 298 296 mutationOc.Add(mutatorOp); 299 297 updateEstimatedValues.Add(updateOp); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs
r13526 r13527 31 31 32 32 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 33 [Item("Update EstimatedValuesOperator", "Put the estimated values of the tree in the scope to be used by the phenotypic similarity calculator")]33 [Item("UpdateQualityOperator", "Put the estimated values of the tree in the scope to be used by the phenotypic similarity calculator")] 34 34 [StorableClass] 35 public class Update EstimatedValuesOperator : EvolutionTrackingOperator<ISymbolicExpressionTree> {35 public class UpdateQualityOperator : EvolutionTrackingOperator<ISymbolicExpressionTree> { 36 36 private const string ProblemDataParameterName = "ProblemData"; 37 37 private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter"; … … 56 56 } 57 57 58 public Update EstimatedValuesOperator() {58 public UpdateQualityOperator() { 59 59 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName)); 60 60 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName)); … … 65 65 66 66 [StorableConstructor] 67 protected Update EstimatedValuesOperator(bool deserializing) : base(deserializing) { }67 protected UpdateQualityOperator(bool deserializing) : base(deserializing) { } 68 68 69 protected Update EstimatedValuesOperator(UpdateEstimatedValuesOperator original, Cloner cloner) : base(original, cloner) {69 protected UpdateQualityOperator(UpdateQualityOperator original, Cloner cloner) : base(original, cloner) { 70 70 } 71 71 72 72 public override IDeepCloneable Clone(Cloner cloner) { 73 return new Update EstimatedValuesOperator(this, cloner);73 return new UpdateQualityOperator(this, cloner); 74 74 } 75 75 … … 110 110 111 111 ((DoubleValue)variables["Quality"].Value).Value = r2; 112 GenealogyGraph.GetByContent(tree).Quality = r2; 112 113 113 114 var scaleEstimatedValues = ScaleEstimatedValuesParameter.ActualValue;
Note: See TracChangeset
for help on using the changeset viewer.