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)
File:
1 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    }
Note: See TracChangeset for help on using the changeset viewer.