Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/15/15 00:10:33 (9 years ago)
Author:
bburlacu
Message:

#1772:

  • Slight refactor in QueryMatch.cs
  • Added a parameter to the genealogy analyzer for removing older generations from the graph (useful to conserve memory in experiments)
  • Updated wildcard nodes (added persistence & cloning)
  • Implemented diversification strategy based on schema frequencies & phenotypic similarity as a separate operator (for now keep also the analyzer)
  • Updated license headers
  • Added QueryMatch performance test (to be expanded)
Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs

    r12892 r12951  
    5555    private const string EnableManipulatorTrackingParameterName = "EnableManipulatorTracking";
    5656    private const string EnableSolutionCreatorTrackingParameterName = "EnableSolutionCreatorTracking"; // should always be enabled. maybe superfluous
     57    private const string TrimOlderGenerationsParameterName = "TrimOlderGenerations";
    5758    #endregion parameter names
    5859
    5960    #region parameter properties
     61
     62    public IFixedValueParameter<BoolValue> TrimOlderGenerationsParameter {
     63      get { return (IFixedValueParameter<BoolValue>)Parameters[TrimOlderGenerationsParameterName]; }
     64    }
     65
    6066    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
    6167      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
     
    142148    public BoolValue EnableSolutionCreatorTracking {
    143149      get { return EnableSolutionCreatorTrackingParameter.Value; }
     150    }
     151
     152    public bool TrimOlderGenerations {
     153      get { return TrimOlderGenerationsParameter.Value.Value; }
    144154    }
    145155    #endregion properties
     
    164174      Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(BeforeManipulatorOperatorParameterName));
    165175      Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(AfterManipulatorOperatorParameterName));
     176      Parameters.Add(new FixedValueParameter<BoolValue>(TrimOlderGenerationsParameterName, "Remove all the generations older than the last generation from the genealoy graph to save memory."));
    166177      #endregion add parameters
    167178    }
     
    201212        Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities."));
    202213      }
     214      if (!Parameters.ContainsKey(TrimOlderGenerationsParameterName))
     215        Parameters.Add(new FixedValueParameter<BoolValue>(TrimOlderGenerationsParameterName, "Remove all the generations older than the last generation from the genealoy graph to save memory."));
    203216    }
    204217
     
    318331      genealogyGraph.RemoveVertices(discarded);
    319332
     333      //trim
     334      if (TrimOlderGenerations) {
     335        for (int i = 0; i < generation - 1; ++i) {
     336          var vertices = genealogyGraph.GetByRank(i).ToList();
     337          genealogyGraph.RemoveVertices(vertices);
     338        }
     339      }
     340
    320341      return base.Apply();
    321342    }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs

    r11858 r12951  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929  [StorableClass]
    3030  [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")]
    31   public class BeforeManipulatorOperator<T> : EvolutionTrackingOperator<T>, IManipulatorOperator<T> where T : class,IItem {
     31  public class BeforeManipulatorOperator<T> : EvolutionTrackingOperator<T>, IManipulatorOperator<T> where T : class, IItem {
    3232    private const string ChildParameterName = "Child";
    3333
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/EvolutionTrackingOperator.cs

    r11227 r12951  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131  [Item("EvolutionTrackingOperator", "A base operator which facilitates access to the genealogy graph.")]
    3232  [StorableClass]
    33   public class EvolutionTrackingOperator<T> : SingleSuccessorOperator where T : class,IItem {
     33  public class EvolutionTrackingOperator<T> : SingleSuccessorOperator where T : class, IItem {
    3434    // evolution tracking-related parameters
    35     private const string resultsParameterName = "Results";
    36     private const string populationGraphParameterName = "PopulationGraph";
    37     private const string generationsParameterName = "Generations";
     35    private const string ResultsParameterName = "Results";
     36    private const string PopulationGraphParameterName = "PopulationGraph";
     37    private const string GenerationsParameterName = "Generations";
    3838
    3939    public ILookupParameter<ResultCollection> ResultsParameter {
    40       get { return (ILookupParameter<ResultCollection>)Parameters[resultsParameterName]; }
     40      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
    4141    }
    4242    public ILookupParameter<IntValue> GenerationsParameter {
    43       get { return (ILookupParameter<IntValue>)Parameters[generationsParameterName]; }
     43      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
    4444    }
    4545    public ResultCollection Results {
     
    5252      get {
    5353        IResult result;
    54         if (!Results.ContainsKey(populationGraphParameterName)) {
    55           result = new Result(populationGraphParameterName, new GenealogyGraph<T>());
     54        if (!Results.ContainsKey(PopulationGraphParameterName)) {
     55          result = new Result(PopulationGraphParameterName, new GenealogyGraph<T>());
    5656          Results.Add(result);
    5757        } else {
    58           result = Results[populationGraphParameterName];
     58          result = Results[PopulationGraphParameterName];
    5959        }
    6060        var graph = (GenealogyGraph<T>)result.Value;
     
    6363    }
    6464    public EvolutionTrackingOperator() {
    65       Parameters.Add(new LookupParameter<IntValue>(generationsParameterName));
    66       Parameters.Add(new LookupParameter<ResultCollection>(resultsParameterName));
     65      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName));
     66      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName));
    6767    }
    6868    protected EvolutionTrackingOperator(EvolutionTrackingOperator<T> original, Cloner cloner)
Note: See TracChangeset for help on using the changeset viewer.