Ignore:
Timestamp:
01/11/16 21:29:25 (5 years ago)
Author:
bburlacu
Message:

#1772: Update diversification operators (add extra evaluations to the evaluation counter, add the option for strict schema matching, add additional replacement ratio update rules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs

    r13480 r13496  
    3838    private const string ResultCollectionParameterName = "Results";
    3939    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
     40
     41    private readonly object locker = new object();
    4042
    4143    public ILookupParameter<IntValue> NumberOfChangedTreesParameter {
     
    8385        table = new DataTable();
    8486        results.Add(new Result("NumberOfChangedTrees", table));
    85         var row = new DataRow("Changed trees");
     87        var row = new DataRow("Changed trees") { VisualProperties = { StartIndexZero = true } };
    8688        table.Rows.Add(row);
    8789      }
     
    8991        table = new DataTable();
    9092        results.Add(new Result("AverageSchemaLength", table));
    91         var row = new DataRow("Average schema length");
     93        var row = new DataRow("Average schema length") { VisualProperties = { StartIndexZero = true } };
    9294        table.Rows.Add(row);
    9395      }
     
    9597        table = new DataTable();
    9698        results.Add(new Result("NumberOfSchemas", table));
    97         var row = new DataRow("Number of schemas");
     99        var row = new DataRow("Number of schemas") { VisualProperties = { StartIndexZero = true } };
    98100        table.Rows.Add(row);
    99101      }
     
    101103        table = new DataTable();
    102104        results.Add(new Result("EvaluatedSolutionsPerGeneration", table));
    103         var row = new DataRow("Evaluated solutions");
     105        var row = new DataRow("Evaluated solutions") { VisualProperties = { StartIndexZero = true } };
    104106        table.Rows.Add(row);
    105107        row.Values.Add(0);
    106108      }
    107109
    108       var evaluatedSolutions = EvaluatedSolutionsParameter.ActualValue.Value - evaluatedSolutionsTracker;
     110      lock (locker) {
     111        // count the extra evaluations performed after diversification
     112        EvaluatedSolutionsParameter.ActualValue.Value += NumberOfChangedTreesParameter.ActualValue.Value;
     113      }
     114
     115      var evaluatedSolutions = EvaluatedSolutionsParameter.ActualValue.Value;
     116      if (evaluatedSolutions > 0)
     117        evaluatedSolutions -= evaluatedSolutionsTracker;
    109118      ((DataTable)results["NumberOfChangedTrees"].Value).Rows["Changed trees"].Values.Add(NumberOfChangedTreesParameter.ActualValue.Value);
    110119      ((DataTable)results["AverageSchemaLength"].Value).Rows["Average schema length"].Values.Add(AverageSchemaLengthParameter.ActualValue.Value);
Note: See TracChangeset for help on using the changeset viewer.