Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/05/13 15:21:24 (10 years ago)
Author:
mkommend
Message:

#1997: Added after deserialization hook for reevaluation of immigrants and made the analysis interval for the island GA configureable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs

    r10155 r10197  
    6767      get { return (ValueParameter<IntValue>)Parameters["MigrationInterval"]; }
    6868    }
     69    protected IFixedValueParameter<IntValue> AnalysisIntervalParameter {
     70      get { return (IFixedValueParameter<IntValue>)Parameters["AnalysisInterval"]; }
     71    }
    6972    protected ValueParameter<PercentValue> MigrationRateParameter {
    7073      get { return (ValueParameter<PercentValue>)Parameters["MigrationRate"]; }
     
    130133      get { return MigrationIntervalParameter.Value; }
    131134      set { MigrationIntervalParameter.Value = value; }
     135    }
     136    public int AnalysisInterval {
     137      get { return AnalysisIntervalParameter.Value.Value; }
     138      set { AnalysisIntervalParameter.Value.Value = value; }
    132139    }
    133140    public PercentValue MigrationRate {
     
    218225        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
    219226      }
     227      if (!Parameters.ContainsKey("ReevaluateImmigrants")) {
     228        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateImmigrants", "Flag which indicates if inviduals should be reevaluated before they are immigrated.", new BoolValue(false)) { Hidden = true });
     229      }
     230      if (!Parameters.ContainsKey("AnalysisInterval")) {
     231        Parameters.Add(new ValueParameter<IntValue>("AnalysisInterval", "The number of generations that should pass between the analyzers should be executed (should be <= MigrationInteval).", new IntValue(20)) { Hidden = true });
     232      }
    220233      #endregion
    221234
     
    238251      Parameters.Add(new ValueParameter<IntValue>("NumberOfIslands", "The number of islands.", new IntValue(5)));
    239252      Parameters.Add(new ValueParameter<IntValue>("MigrationInterval", "The number of generations that should pass between migration phases.", new IntValue(20)));
     253      Parameters.Add(new ValueParameter<IntValue>("AnalysisInterval", "The number of generations that should pass between the analyzers should be executed (should be <= MigrationInteval).", new IntValue(20)) { Hidden = true });
    240254      Parameters.Add(new ValueParameter<PercentValue>("MigrationRate", "The proportion of individuals that should migrate between the islands.", new PercentValue(0.15)));
    241255      Parameters.Add(new ConstrainedValueParameter<IMigrator>("Migrator", "The migration strategy."));
Note: See TracChangeset for help on using the changeset viewer.