Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/16/14 16:37:56 (11 years ago)
Author:
bburlacu
Message:

#1772: Small changes to the GenealogyGraph. Added generic Fragment class and interface. Added the SymbolicDataAnalysisPopulationDiversityAnalyzer. Added specialized tracking operators for symbolic data analysis. Merged trunk changes.

Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterCrossoverOperator.cs

    r10300 r10347  
    2020#endregion
    2121
    22 using System.Linq;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    2928  [StorableClass]
    3029  [Item("AfterCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")]
    31   public class AfterCrossoverOperator<T> : EvolutionTrackingOperator
    32     where T : class,IItem {
     30  public class AfterCrossoverOperator<T> : EvolutionTrackingOperator, ICrossoverOperator<T> where T : class,IItem {
    3331    private const string defaultParentsParameterName = "Parents";
    3432    private const string defaultChildParameterName = "Child";
    35     public IScopeTreeLookupParameter<T> ParentsParameter;
    36     public ILookupParameter<T> ChildParameter;
     33    public IScopeTreeLookupParameter<T> ParentsParameter { get; set; }
     34    public ILookupParameter<T> ChildParameter { get; set; }
    3735
    3836    protected AfterCrossoverOperator(AfterCrossoverOperator<T> original, Cloner cloner)
     
    5149
    5250    public override IOperation Apply() {
    53       //      var parentVertices = ParentsParameter.ActualValue.Select(x => GenealogyGraph[x].Last()).ToList();
    54       var lastGen = GenealogyGraph.Ranks[Generations.Value].ToList();
    55       var parentVertices = ExecutionContext.Scope.SubScopes.Select(s => lastGen[int.Parse(s.Name)]).ToList(); // because the individuals in the execution scope are copies of the ones in the graph
    56 
    57       var childVertex = new GenealogyGraphNode<T> {
    58         Content = ChildParameter.ActualValue,
    59         Rank = parentVertices[0].Rank + 1
    60       };
    61       GenealogyGraph.AddVertex(childVertex);
    62       foreach (var v in parentVertices) {
    63         childVertex.AddReverseArc(v);
    64         v.AddForwardArc(childVertex);
    65       }
    66       //      if (parentVertices[0].Content == parentVertices[1].Content)
    67       //        throw new Exception("Self-crossover");
    6851      return base.Apply();
    6952    }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterManipulatorOperator.cs

    r10300 r10347  
    2828  [StorableClass]
    2929  [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")]
    30   public class AfterManipulatorOperator<T> : EvolutionTrackingOperator
    31     where T : class,IItem {
     30  public class AfterManipulatorOperator<T> : EvolutionTrackingOperator, IManipulatorOperator<T> where T : class,IItem {
    3231
    3332    private const string ChildParameterName = "Child";
    34     public ILookupParameter<T> ChildParameter;
     33    public ILookupParameter<T> ChildParameter { get; set; }
    3534
    3635    protected AfterManipulatorOperator(AfterManipulatorOperator<T> original, Cloner cloner)
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterSolutionCreatorOperator.cs

    r10300 r10347  
    2121
    2222using HeuristicLab.Core;
     23using HeuristicLab.Parameters;
    2324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2425
     
    2930    where T : class,IItem {
    3031
     32    private const string CurrentScopeParameterName = "CurrentScope";
     33
     34    public ScopeParameter CurrentScopeParameter {
     35      get { return (ScopeParameter)Parameters[CurrentScopeParameterName]; }
     36    }
     37    public IScope CurrentScope { get { return CurrentScopeParameter.ActualValue; } }
     38
    3139    public override IOperation Apply() {
    3240      return base.Apply();
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs

    r10300 r10347  
    2929  [StorableClass]
    3030  [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")]
    31   public class BeforeManipulatorOperator<T> : EvolutionTrackingOperator
    32     where T : class,IItem {
     31  public class BeforeManipulatorOperator<T> : EvolutionTrackingOperator, IManipulatorOperator<T> where T : class,IItem {
    3332
    3433    private const string ChildParameterName = "Child";
    35     public ILookupParameter<T> ChildParameter;
     34    public ILookupParameter<T> ChildParameter { get; set; }
    3635
    3736    protected BeforeManipulatorOperator(BeforeManipulatorOperator<T> original, Cloner cloner)
Note: See TracChangeset for help on using the changeset viewer.