- Timestamp:
- 02/11/20 13:36:02 (5 years ago)
- Location:
- branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/EvolutionTrackingAnalyzer.cs
r13482 r17434 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 30 31 namespace HeuristicLab.EvolutionTracking { 31 32 [Item("EvolutionTrackingAnalyzer", "Base class for analyzers that use the genealogy graph")] 32 [Storable Class]33 [StorableType("272F8098-CFD0-473C-AFC4-A5F3A51BC154")] 33 34 public abstract class EvolutionTrackingAnalyzer : SingleSuccessorOperator, IAnalyzer { 34 35 #region parameter names … … 92 93 93 94 [StorableConstructor] 94 protected EvolutionTrackingAnalyzer( bool deserializing) : base(deserializing) { }95 protected EvolutionTrackingAnalyzer(StorableConstructorFlag _) : base(_) { } 95 96 } 96 97 97 98 [Item("EvolutionTrackingAnalyzer", "Base class for analyzers that use the genealogy graph")] 98 [Storable Class]99 [StorableType("B48D6E89-3D0F-4F38-BC23-FE648E43421F")] 99 100 public class EvolutionTrackingAnalyzer<T> : EvolutionTrackingAnalyzer where T : class, IItem { 100 101 public EvolutionTrackingAnalyzer() { } … … 107 108 108 109 [StorableConstructor] 109 protected EvolutionTrackingAnalyzer( bool deserializing) : base(deserializing) { }110 protected EvolutionTrackingAnalyzer(StorableConstructorFlag _) : base(_) { } 110 111 111 112 public new IGenealogyGraph<T> PopulationGraph { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
r13495 r17434 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Data; 28 using HeuristicLab.EvolutionTracking; 27 29 using HeuristicLab.Operators; 28 30 using HeuristicLab.Optimization; 29 31 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 32 namespace HeuristicLab.EvolutionTracking { 33 [StorableClass] 34 [Item("GenealogyAnalyzer", "An analyzer which performs the necessary instrumentation to record the evolution of a genetic algorithm.")] 35 public abstract class GenealogyAnalyzer<T> : SingleSuccessorOperator, IAnalyzer 36 where T : class, IItem { 37 #region parameter names 38 private const string GenerationsParameterName = "Generations"; 39 private const string ResultsParameterName = "Results"; 40 private const string PopulationGraphParameterName = "PopulationGraph"; 41 public const string QualityParameterName = "Quality"; 42 public const string PopulationParameterName = "SymbolicExpressionTree"; 43 44 private const string CrossoverParameterName = "Crossover"; 45 private const string ManipulatorParameterName = "Mutator"; 46 private const string SolutionCreatorParameterName = "SolutionCreator"; 47 48 private const string BeforeCrossoverOperatorParameterName = "BeforeCrossoverOperator"; 49 private const string AfterCrossoverOperatorParameterName = "AfterCrossoverOperator"; 50 51 private const string BeforeManipulatorOperatorParameterName = "BeforeManipulatorOperator"; 52 private const string AfterManipulatorOperatorParameterName = "AfterManipulatorOperator"; 53 54 private const string EnableCrossoverTrackingParameterName = "EnableCrossoverTracking"; 55 private const string EnableManipulatorTrackingParameterName = "EnableManipulatorTracking"; 56 private const string EnableSolutionCreatorTrackingParameterName = "EnableSolutionCreatorTracking"; // should always be enabled. maybe superfluous 57 private const string TrimOlderGenerationsParameterName = "TrimOlderGenerations"; 58 #endregion parameter names 59 60 #region parameter properties 61 62 public IFixedValueParameter<BoolValue> TrimOlderGenerationsParameter { 63 get { return (IFixedValueParameter<BoolValue>)Parameters[TrimOlderGenerationsParameterName]; } 64 } 65 66 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 67 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; } 68 } 69 70 public IScopeTreeLookupParameter<T> PopulationParameter { 71 get { return (IScopeTreeLookupParameter<T>)Parameters[PopulationParameterName]; } 72 } 73 74 public IValueParameter<ICrossoverOperator<T>> BeforeCrossoverOperatorParameter { 75 get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[BeforeCrossoverOperatorParameterName]; } 76 } 77 78 public IValueParameter<ICrossoverOperator<T>> AfterCrossoverOperatorParameter { 79 get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[AfterCrossoverOperatorParameterName]; } 80 } 81 82 public IValueParameter<IManipulatorOperator<T>> BeforeManipulatorOperatorParameter { 83 get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[BeforeManipulatorOperatorParameterName]; } 84 } 85 86 public IValueParameter<IManipulatorOperator<T>> AfterManipulatorOperatorParameter { 87 get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[AfterManipulatorOperatorParameterName]; } 88 } 89 90 public ILookupParameter<ResultCollection> ResultsParameter { 91 get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; } 92 } 93 94 public ILookupParameter<IntValue> GenerationsParameter { 95 get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; } 96 } 97 98 public IValueParameter<BoolValue> EnableCrossoverTrackingParameter { 99 get { return (IValueParameter<BoolValue>)Parameters[EnableCrossoverTrackingParameterName]; } 100 } 101 102 public IValueParameter<BoolValue> EnableManipulatorTrackingParameter { 103 get { return (IValueParameter<BoolValue>)Parameters[EnableManipulatorTrackingParameterName]; } 104 } 105 106 public IValueParameter<BoolValue> EnableSolutionCreatorTrackingParameter { 107 get { return (IValueParameter<BoolValue>)Parameters[EnableSolutionCreatorTrackingParameterName]; } 108 } 109 110 public ILookupParameter<ICrossover> CrossoverParameter { 111 get { return (ILookupParameter<ICrossover>)Parameters[CrossoverParameterName]; } 112 } 113 114 public ILookupParameter<IManipulator> ManipulatorParameter { 115 get { return (ILookupParameter<IManipulator>)Parameters[ManipulatorParameterName]; } 116 } 117 118 public ILookupParameter<ISolutionCreator> SolutionCreatorParameter { 119 get { return (ILookupParameter<ISolutionCreator>)Parameters[SolutionCreatorParameterName]; } 120 } 121 #endregion parameter properties 122 123 #region properties 124 public ICrossoverOperator<T> BeforeCrossoverOperator { 125 get { return BeforeCrossoverOperatorParameter.Value; } 126 } 127 128 public ICrossoverOperator<T> AfterCrossoverOperator { 129 get { return AfterCrossoverOperatorParameter.Value; } 130 } 131 132 public IManipulatorOperator<T> BeforeManipulatorOperator { 133 get { return BeforeManipulatorOperatorParameter.Value; } 134 } 135 136 public IManipulatorOperator<T> AfterManipulatorOperator { 137 get { return AfterManipulatorOperatorParameter.Value; } 138 } 139 140 public BoolValue EnableCrossoverTracking { 141 get { return EnableCrossoverTrackingParameter.Value; } 142 } 143 144 public BoolValue EnableManipulatorTracking { 145 get { return EnableManipulatorTrackingParameter.Value; } 146 } 147 148 public BoolValue EnableSolutionCreatorTracking { 149 get { return EnableSolutionCreatorTrackingParameter.Value; } 150 } 151 152 public bool TrimOlderGenerations { 153 get { return TrimOlderGenerationsParameter.Value.Value; } 154 } 155 #endregion properties 156 157 protected GenealogyAnalyzer() { 158 #region add parameters 159 // the instrumented operators 32 33 [Item("GenealogyAnalyzer", "An analyzer which performs the necessary instrumentation to record the evolution of a genetic algorithm.")] 34 [StorableType("04001C52-025C-4555-8812-AC3FA26A2B2F")] 35 public abstract class GenealogyAnalyzer<T> : SingleSuccessorOperator, IAnalyzer 36 where T : class, IItem 37 { 38 #region parameter names 39 private const string GenerationsParameterName = "Generations"; 40 private const string ResultsParameterName = "Results"; 41 private const string PopulationGraphParameterName = "PopulationGraph"; 42 public const string QualityParameterName = "Quality"; 43 public const string PopulationParameterName = "SymbolicExpressionTree"; 44 45 private const string CrossoverParameterName = "Crossover"; 46 private const string ManipulatorParameterName = "Mutator"; 47 private const string SolutionCreatorParameterName = "SolutionCreator"; 48 49 private const string BeforeCrossoverOperatorParameterName = "BeforeCrossoverOperator"; 50 private const string AfterCrossoverOperatorParameterName = "AfterCrossoverOperator"; 51 52 private const string BeforeManipulatorOperatorParameterName = "BeforeManipulatorOperator"; 53 private const string AfterManipulatorOperatorParameterName = "AfterManipulatorOperator"; 54 55 private const string EnableCrossoverTrackingParameterName = "EnableCrossoverTracking"; 56 private const string EnableManipulatorTrackingParameterName = "EnableManipulatorTracking"; 57 private const string EnableSolutionCreatorTrackingParameterName = "EnableSolutionCreatorTracking"; // should always be enabled. maybe superfluous 58 private const string TrimOlderGenerationsParameterName = "TrimOlderGenerations"; 59 #endregion parameter names 60 61 #region parameter properties 62 63 public IFixedValueParameter<BoolValue> TrimOlderGenerationsParameter { 64 get { return (IFixedValueParameter<BoolValue>)Parameters[TrimOlderGenerationsParameterName]; } 65 } 66 67 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 68 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; } 69 } 70 71 public IScopeTreeLookupParameter<T> PopulationParameter { 72 get { return (IScopeTreeLookupParameter<T>)Parameters[PopulationParameterName]; } 73 } 74 75 public IValueParameter<ICrossoverOperator<T>> BeforeCrossoverOperatorParameter { 76 get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[BeforeCrossoverOperatorParameterName]; } 77 } 78 79 public IValueParameter<ICrossoverOperator<T>> AfterCrossoverOperatorParameter { 80 get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[AfterCrossoverOperatorParameterName]; } 81 } 82 83 public IValueParameter<IManipulatorOperator<T>> BeforeManipulatorOperatorParameter { 84 get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[BeforeManipulatorOperatorParameterName]; } 85 } 86 87 public IValueParameter<IManipulatorOperator<T>> AfterManipulatorOperatorParameter { 88 get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[AfterManipulatorOperatorParameterName]; } 89 } 90 91 public ILookupParameter<ResultCollection> ResultsParameter { 92 get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; } 93 } 94 95 public ILookupParameter<IntValue> GenerationsParameter { 96 get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; } 97 } 98 99 public IValueParameter<BoolValue> EnableCrossoverTrackingParameter { 100 get { return (IValueParameter<BoolValue>)Parameters[EnableCrossoverTrackingParameterName]; } 101 } 102 103 public IValueParameter<BoolValue> EnableManipulatorTrackingParameter { 104 get { return (IValueParameter<BoolValue>)Parameters[EnableManipulatorTrackingParameterName]; } 105 } 106 107 public IValueParameter<BoolValue> EnableSolutionCreatorTrackingParameter { 108 get { return (IValueParameter<BoolValue>)Parameters[EnableSolutionCreatorTrackingParameterName]; } 109 } 110 111 public ILookupParameter<ICrossover> CrossoverParameter { 112 get { return (ILookupParameter<ICrossover>)Parameters[CrossoverParameterName]; } 113 } 114 115 public ILookupParameter<IManipulator> ManipulatorParameter { 116 get { return (ILookupParameter<IManipulator>)Parameters[ManipulatorParameterName]; } 117 } 118 119 public ILookupParameter<ISolutionCreator> SolutionCreatorParameter { 120 get { return (ILookupParameter<ISolutionCreator>)Parameters[SolutionCreatorParameterName]; } 121 } 122 #endregion parameter properties 123 124 #region properties 125 public ICrossoverOperator<T> BeforeCrossoverOperator { 126 get { return BeforeCrossoverOperatorParameter.Value; } 127 } 128 129 public ICrossoverOperator<T> AfterCrossoverOperator { 130 get { return AfterCrossoverOperatorParameter.Value; } 131 } 132 133 public IManipulatorOperator<T> BeforeManipulatorOperator { 134 get { return BeforeManipulatorOperatorParameter.Value; } 135 } 136 137 public IManipulatorOperator<T> AfterManipulatorOperator { 138 get { return AfterManipulatorOperatorParameter.Value; } 139 } 140 141 public BoolValue EnableCrossoverTracking { 142 get { return EnableCrossoverTrackingParameter.Value; } 143 } 144 145 public BoolValue EnableManipulatorTracking { 146 get { return EnableManipulatorTrackingParameter.Value; } 147 } 148 149 public BoolValue EnableSolutionCreatorTracking { 150 get { return EnableSolutionCreatorTrackingParameter.Value; } 151 } 152 153 public bool TrimOlderGenerations { 154 get { return TrimOlderGenerationsParameter.Value.Value; } 155 } 156 #endregion properties 157 158 protected GenealogyAnalyzer() { 159 #region add parameters 160 // the instrumented operators 161 Parameters.Add(new LookupParameter<ICrossover>(CrossoverParameterName, "The crossover operator.")); 162 Parameters.Add(new LookupParameter<IManipulator>(ManipulatorParameterName, "The manipulator operator.")); 163 Parameters.Add(new LookupParameter<ISolutionCreator>(SolutionCreatorParameterName, "The solution creator operator.")); 164 // the analyzer parameters 165 Parameters.Add(new ValueParameter<BoolValue>(EnableCrossoverTrackingParameterName, new BoolValue(true))); 166 Parameters.Add(new ValueParameter<BoolValue>(EnableManipulatorTrackingParameterName, new BoolValue(true))); 167 Parameters.Add(new ValueParameter<BoolValue>(EnableSolutionCreatorTrackingParameterName, new BoolValue(true))); 168 // parameters required by the analyzer to do its work 169 Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far.")); 170 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName)); 171 Parameters.Add(new ScopeTreeLookupParameter<T>(PopulationParameterName, "The population of individuals.")); 172 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities.")); 173 Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(BeforeCrossoverOperatorParameterName)); 174 Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(AfterCrossoverOperatorParameterName)); 175 Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(BeforeManipulatorOperatorParameterName)); 176 Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(AfterManipulatorOperatorParameterName)); 177 Parameters.Add(new FixedValueParameter<BoolValue>(TrimOlderGenerationsParameterName, "Remove all the generations older than the last generation from the genealoy graph to save memory.")); 178 #endregion add parameters 179 } 180 181 protected GenealogyAnalyzer(GenealogyAnalyzer<T> original, Cloner cloner) 182 : base(original, cloner) { 183 } 184 185 [StorableConstructor] 186 protected GenealogyAnalyzer(StorableConstructorFlag _) : base(_) { } 187 188 [StorableHook(HookType.AfterDeserialization)] 189 private void AfterDeserialization() { 190 // the instrumented operators 191 if (!Parameters.ContainsKey(CrossoverParameterName)) 160 192 Parameters.Add(new LookupParameter<ICrossover>(CrossoverParameterName, "The crossover operator.")); 193 if (!Parameters.ContainsKey(ManipulatorParameterName)) 161 194 Parameters.Add(new LookupParameter<IManipulator>(ManipulatorParameterName, "The manipulator operator.")); 195 if (!Parameters.ContainsKey(SolutionCreatorParameterName)) 162 196 Parameters.Add(new LookupParameter<ISolutionCreator>(SolutionCreatorParameterName, "The solution creator operator.")); 163 // the analyzer parameters 197 // the analyzer parameters 198 if (!Parameters.ContainsKey(EnableCrossoverTrackingParameterName)) 164 199 Parameters.Add(new ValueParameter<BoolValue>(EnableCrossoverTrackingParameterName, new BoolValue(true))); 200 if (!Parameters.ContainsKey(EnableManipulatorTrackingParameterName)) 165 201 Parameters.Add(new ValueParameter<BoolValue>(EnableManipulatorTrackingParameterName, new BoolValue(true))); 202 if (!Parameters.ContainsKey(EnableSolutionCreatorTrackingParameterName)) 166 203 Parameters.Add(new ValueParameter<BoolValue>(EnableSolutionCreatorTrackingParameterName, new BoolValue(true))); 167 // parameters required by the analyzer to do its work 204 // parameters required by the analyzer to do its work 205 if (!Parameters.ContainsKey(GenerationsParameterName)) 168 206 Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far.")); 207 if (!Parameters.ContainsKey(ResultsParameterName)) 169 208 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName)); 209 if (!Parameters.ContainsKey(PopulationParameterName)) { 170 210 Parameters.Add(new ScopeTreeLookupParameter<T>(PopulationParameterName, "The population of individuals.")); 211 } 212 if (!Parameters.ContainsKey(QualityParameterName)) { 171 213 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities.")); 172 Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(BeforeCrossoverOperatorParameterName)); 173 Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(AfterCrossoverOperatorParameterName)); 174 Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(BeforeManipulatorOperatorParameterName)); 175 Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(AfterManipulatorOperatorParameterName)); 214 } 215 if (!Parameters.ContainsKey(TrimOlderGenerationsParameterName)) 176 216 Parameters.Add(new FixedValueParameter<BoolValue>(TrimOlderGenerationsParameterName, "Remove all the generations older than the last generation from the genealoy graph to save memory.")); 177 #endregion add parameters 178 } 179 180 protected GenealogyAnalyzer(GenealogyAnalyzer<T> original, Cloner cloner) 181 : base(original, cloner) { 182 } 183 184 [StorableConstructor] 185 protected GenealogyAnalyzer(bool deserializing) : base(deserializing) { } 186 187 [StorableHook(HookType.AfterDeserialization)] 188 private void AfterDeserialization() { 189 // the instrumented operators 190 if (!Parameters.ContainsKey(CrossoverParameterName)) 191 Parameters.Add(new LookupParameter<ICrossover>(CrossoverParameterName, "The crossover operator.")); 192 if (!Parameters.ContainsKey(ManipulatorParameterName)) 193 Parameters.Add(new LookupParameter<IManipulator>(ManipulatorParameterName, "The manipulator operator.")); 194 if (!Parameters.ContainsKey(SolutionCreatorParameterName)) 195 Parameters.Add(new LookupParameter<ISolutionCreator>(SolutionCreatorParameterName, "The solution creator operator.")); 196 // the analyzer parameters 197 if (!Parameters.ContainsKey(EnableCrossoverTrackingParameterName)) 198 Parameters.Add(new ValueParameter<BoolValue>(EnableCrossoverTrackingParameterName, new BoolValue(true))); 199 if (!Parameters.ContainsKey(EnableManipulatorTrackingParameterName)) 200 Parameters.Add(new ValueParameter<BoolValue>(EnableManipulatorTrackingParameterName, new BoolValue(true))); 201 if (!Parameters.ContainsKey(EnableSolutionCreatorTrackingParameterName)) 202 Parameters.Add(new ValueParameter<BoolValue>(EnableSolutionCreatorTrackingParameterName, new BoolValue(true))); 203 // parameters required by the analyzer to do its work 204 if (!Parameters.ContainsKey(GenerationsParameterName)) 205 Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far.")); 206 if (!Parameters.ContainsKey(ResultsParameterName)) 207 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName)); 208 if (!Parameters.ContainsKey(PopulationParameterName)) { 209 Parameters.Add(new ScopeTreeLookupParameter<T>(PopulationParameterName, "The population of individuals.")); 210 } 211 if (!Parameters.ContainsKey(QualityParameterName)) { 212 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities.")); 213 } 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.")); 216 } 217 218 public bool EnabledByDefault { 219 get { return false; } 220 } 221 222 private void ConfigureTrackingOperators() { 223 // at the beginning we add the before/after operators to the instrumented operators 224 var crossover = CrossoverParameter.ActualValue; 225 if (crossover != null) { 226 var instrumentedCrossover = (InstrumentedOperator)crossover; 227 instrumentedCrossover.AfterExecutionOperators.Clear(); 228 instrumentedCrossover.BeforeExecutionOperators.Clear(); 229 230 if (EnableCrossoverTracking.Value) { 231 if (BeforeCrossoverOperator != null) { 232 instrumentedCrossover.BeforeExecutionOperators.Add(BeforeCrossoverOperator); 233 } 234 if (AfterCrossoverOperator != null) { 235 instrumentedCrossover.AfterExecutionOperators.Add(AfterCrossoverOperator); 236 } 237 } 238 } 239 var manipulator = ManipulatorParameter.ActualValue; 240 if (manipulator != null) { 241 var instrumentedManipulator = (InstrumentedOperator)manipulator; 242 instrumentedManipulator.AfterExecutionOperators.Clear(); 243 instrumentedManipulator.BeforeExecutionOperators.Clear(); 244 245 if (EnableManipulatorTracking.Value) { 246 if (BeforeManipulatorOperator != null) { 247 instrumentedManipulator.BeforeExecutionOperators.Add(BeforeManipulatorOperator); 248 } 249 if (AfterManipulatorOperator != null) { 250 instrumentedManipulator.AfterExecutionOperators.Add(AfterManipulatorOperator); 251 } 252 } 253 } 254 } 255 256 protected abstract void EvaluateIntermediateChildren(); 257 258 public override IOperation Apply() { 259 IGenealogyGraph<T> genealogyGraph; 260 var results = ResultsParameter.ActualValue; 261 if (!results.ContainsKey(PopulationGraphParameterName)) { 262 genealogyGraph = new GenealogyGraph<T>(); 263 results.Add(new Result(PopulationGraphParameterName, genealogyGraph)); 264 } else { 265 genealogyGraph = (IGenealogyGraph<T>)results[PopulationGraphParameterName].Value; 266 } 267 268 var population = PopulationParameter.ActualValue; 269 var qualities = QualityParameter.ActualValue; 270 271 int generation = GenerationsParameter.ActualValue.Value; 272 if (generation == 0) { 273 ConfigureTrackingOperators(); 274 275 for (int i = 0; i < population.Length; ++i) { 276 var individual = population[i]; 277 var vertex = new GenealogyGraphNode<T>(individual) { Rank = generation }; 278 genealogyGraph.AddVertex(vertex); 279 // save the vertex id in the individual scope (so that we can identify graph indices) 280 ExecutionContext.Scope.SubScopes[i].Variables.Add(new Variable("Id", new StringValue(vertex.Id))); 281 } 282 } else { 283 int index = 0; 284 T elite = null; 285 // identify previous elite individual 286 for (int i = 0; i < population.Length; ++i) { 287 if (genealogyGraph.GetByContent(population[i]).Rank.Equals(generation - 1)) { 288 elite = population[i]; 289 index = i; 290 break; 291 } 292 } 293 // add current elite and connect with previous 294 #region add elite in the graph and connect it with the previous elite 295 if (elite != null) { 296 var prevVertex = genealogyGraph.GetByContent(elite); 297 prevVertex.IsElite = true; // mark elites in the graph retroactively 298 var v = (IGenealogyGraphNode<T>)prevVertex.Clone(); 299 v.Rank = generation; 300 v.IsElite = false; 301 population[index] = v.Data; 302 genealogyGraph.AddVertex(v); 303 genealogyGraph.AddArc(prevVertex, v); 304 // inject the graph node unique id to the scope 305 ExecutionContext.Scope.SubScopes[index].Variables[BeforeManipulatorOperator.ChildParameter.ActualName].Value = v.Data; 306 ExecutionContext.Scope.SubScopes[index].Variables["Id"].Value = new StringValue(v.Id); 307 } 308 #endregion add elite in the graph and connect it with the previous elite 309 } 310 // update qualities 217 } 218 219 public bool EnabledByDefault { 220 get { return false; } 221 } 222 223 private void ConfigureTrackingOperators() { 224 // at the beginning we add the before/after operators to the instrumented operators 225 var crossover = CrossoverParameter.ActualValue; 226 if (crossover != null) { 227 var instrumentedCrossover = (InstrumentedOperator)crossover; 228 instrumentedCrossover.AfterExecutionOperators.Clear(); 229 instrumentedCrossover.BeforeExecutionOperators.Clear(); 230 231 if (EnableCrossoverTracking.Value) { 232 if (BeforeCrossoverOperator != null) { 233 instrumentedCrossover.BeforeExecutionOperators.Add(BeforeCrossoverOperator); 234 } 235 if (AfterCrossoverOperator != null) { 236 instrumentedCrossover.AfterExecutionOperators.Add(AfterCrossoverOperator); 237 } 238 } 239 } 240 var manipulator = ManipulatorParameter.ActualValue; 241 if (manipulator != null) { 242 var instrumentedManipulator = (InstrumentedOperator)manipulator; 243 instrumentedManipulator.AfterExecutionOperators.Clear(); 244 instrumentedManipulator.BeforeExecutionOperators.Clear(); 245 246 if (EnableManipulatorTracking.Value) { 247 if (BeforeManipulatorOperator != null) { 248 instrumentedManipulator.BeforeExecutionOperators.Add(BeforeManipulatorOperator); 249 } 250 if (AfterManipulatorOperator != null) { 251 instrumentedManipulator.AfterExecutionOperators.Add(AfterManipulatorOperator); 252 } 253 } 254 } 255 } 256 257 protected abstract void EvaluateIntermediateChildren(); 258 259 public override IOperation Apply() { 260 IGenealogyGraph<T> genealogyGraph; 261 var results = ResultsParameter.ActualValue; 262 if (!results.ContainsKey(PopulationGraphParameterName)) { 263 genealogyGraph = new GenealogyGraph<T>(); 264 results.Add(new Result(PopulationGraphParameterName, genealogyGraph)); 265 } else { 266 genealogyGraph = (IGenealogyGraph<T>)results[PopulationGraphParameterName].Value; 267 } 268 269 var population = PopulationParameter.ActualValue; 270 var qualities = QualityParameter.ActualValue; 271 272 int generation = GenerationsParameter.ActualValue.Value; 273 if (generation == 0) { 274 ConfigureTrackingOperators(); 275 311 276 for (int i = 0; i < population.Length; ++i) { 312 var vertex = genealogyGraph.GetByContent(population[i]); 313 vertex.Quality = qualities[i].Value; 314 } 315 // update qualities for intermediate vertices 316 EvaluateIntermediateChildren(); 317 318 // remove extra graph nodes (added by the instrumented operators in the case of offspring selection) 319 var pop = new HashSet<T>(population); 320 var discarded = genealogyGraph.GetByRank(generation).Where(x => !pop.Contains(x.Data)).ToList(); 321 for (int i = 0; i < discarded.Count; ++i) { 322 var v = discarded[i]; 323 if (v.InDegree == 1) { 324 var p = v.Parents.First(); 325 if (p.Rank.Equals(generation - 0.5)) 326 // the individual was a product of mutation. since it wasn't selected, we must remove both it and its parent 327 // ("intermediate" vertex result of crossover) 328 discarded.Add(v.Parents.First()); 329 } 330 } 331 genealogyGraph.RemoveVertices(discarded); 332 333 //trim 334 if (TrimOlderGenerations) { 335 var vertices = genealogyGraph.Vertices.Where(x => x.Rank < generation - 1).ToList(); // select all ranks older than the previous generation 336 genealogyGraph.RemoveVertices(vertices); 337 } 338 339 return base.Apply(); 340 } 277 var individual = population[i]; 278 var vertex = new GenealogyGraphNode<T>(individual) { Rank = generation }; 279 genealogyGraph.AddVertex(vertex); 280 // save the vertex id in the individual scope (so that we can identify graph indices) 281 ExecutionContext.Scope.SubScopes[i].Variables.Add(new Variable("Id", new StringValue(vertex.Id))); 282 } 283 } else { 284 int index = 0; 285 T elite = null; 286 // identify previous elite individual 287 for (int i = 0; i < population.Length; ++i) { 288 if (genealogyGraph.GetByContent(population[i]).Rank.Equals(generation - 1)) { 289 elite = population[i]; 290 index = i; 291 break; 292 } 293 } 294 // add current elite and connect with previous 295 #region add elite in the graph and connect it with the previous elite 296 if (elite != null) { 297 var prevVertex = genealogyGraph.GetByContent(elite); 298 prevVertex.IsElite = true; // mark elites in the graph retroactively 299 var v = (IGenealogyGraphNode<T>)prevVertex.Clone(); 300 v.Rank = generation; 301 v.IsElite = false; 302 population[index] = v.Data; 303 genealogyGraph.AddVertex(v); 304 genealogyGraph.AddArc(prevVertex, v); 305 // inject the graph node unique id to the scope 306 ExecutionContext.Scope.SubScopes[index].Variables[BeforeManipulatorOperator.ChildParameter.ActualName].Value = v.Data; 307 ExecutionContext.Scope.SubScopes[index].Variables["Id"].Value = new StringValue(v.Id); 308 } 309 #endregion add elite in the graph and connect it with the previous elite 310 } 311 // update qualities 312 for (int i = 0; i < population.Length; ++i) { 313 var vertex = genealogyGraph.GetByContent(population[i]); 314 vertex.Quality = qualities[i].Value; 315 } 316 // update qualities for intermediate vertices 317 EvaluateIntermediateChildren(); 318 319 // remove extra graph nodes (added by the instrumented operators in the case of offspring selection) 320 var pop = new HashSet<T>(population); 321 var discarded = genealogyGraph.GetByRank(generation).Where(x => !pop.Contains(x.Data)).ToList(); 322 for (int i = 0; i < discarded.Count; ++i) { 323 var v = discarded[i]; 324 if (v.InDegree == 1) { 325 var p = v.Parents.First(); 326 if (p.Rank.Equals(generation - 0.5)) 327 // the individual was a product of mutation. since it wasn't selected, we must remove both it and its parent 328 // ("intermediate" vertex result of crossover) 329 discarded.Add(v.Parents.First()); 330 } 331 } 332 genealogyGraph.RemoveVertices(discarded); 333 334 //trim 335 if (TrimOlderGenerations) { 336 var vertices = genealogyGraph.Vertices.Where(x => x.Rank < generation - 1).ToList(); // select all ranks older than the previous generation 337 genealogyGraph.RemoveVertices(vertices); 338 } 339 340 return base.Apply(); 341 341 } 342 342 } -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/SelectionSchemeAnalyzer.cs
r12894 r17434 21 21 22 22 using System.Linq; 23 using HEAL.Attic; 23 24 using HeuristicLab.Analysis; 24 25 using HeuristicLab.Common; … … 29 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 31 31 namespace HeuristicLab.EvolutionTracking { 32 namespace HeuristicLab.EvolutionTracking 33 { 32 34 [Item("SelectionSchemeAnalyzer", "An analyzer which gives information about the relative amount of individuals that get selected each generation")] 33 [StorableClass] 34 public class SelectionSchemeAnalyzer : EvolutionTrackingAnalyzer { 35 [StorableType("96FBBBE5-059C-4EA7-A633-0D2CBD7F58BE")] 36 public class SelectionSchemeAnalyzer : EvolutionTrackingAnalyzer 37 { 35 38 private const string StoreHistoryParameterName = "StoreHistory"; 36 39 … … 47 50 48 51 [StorableConstructor] 49 protected SelectionSchemeAnalyzer( bool deserializing) : base(deserializing) { }52 protected SelectionSchemeAnalyzer(StorableConstructorFlag _) : base(_) { } 50 53 51 54 protected SelectionSchemeAnalyzer(SelectionSchemeAnalyzer original, Cloner cloner) : base(original, cloner) { } -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs
r11928 r17434 1 using HeuristicLab.Common; 1 using HEAL.Attic; 2 using HeuristicLab.Common; 2 3 using HeuristicLab.Core; 3 4 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 5 5 6 namespace HeuristicLab.EvolutionTracking { 6 [StorableClass]7 7 [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")] 8 [StorableType("21BE7538-052E-451E-A0A3-CD8CBF51B051")] 8 9 public class Fragment : Item, IFragment { 9 10 [Storable] … … 20 21 } 21 22 [StorableConstructor] 22 protected Fragment( bool deserializable) : base(deserializable) { }23 protected Fragment(StorableConstructorFlag _) : base(_) { } 23 24 24 25 protected Fragment(Fragment original, Cloner cloner) … … 36 37 } 37 38 38 [StorableClass]39 39 [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")] 40 [StorableType("19346017-6C9E-41BF-BCD2-00B1FE82F2FA")] 40 41 public class Fragment<T> : Fragment, IFragment<T> where T : class { 41 42 public new T Root { … … 53 54 54 55 [StorableConstructor] 55 protected Fragment( bool deserializable) : base(deserializable) { }56 protected Fragment(StorableConstructorFlag _) : base(_) { } 56 57 57 58 public Fragment() { } -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
r12966 r17434 26 26 using System.Linq; 27 27 using System.Text; 28 using HEAL.Attic; 28 29 using HeuristicLab.Common; 29 30 using HeuristicLab.Core; 30 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 32 32 namespace HeuristicLab.EvolutionTracking {33 [StorableClass] 33 namespace HeuristicLab.EvolutionTracking 34 { 34 35 [Item("GenealogyGraph", "A class representing a genealogy graph")] 35 public class GenealogyGraph : DirectedGraph, IGenealogyGraph { 36 [StorableType("66DCA305-87F7-41D8-91CF-68415B1809A8")] 37 public class GenealogyGraph : DirectedGraph, IGenealogyGraph 38 { 36 39 private Dictionary<object, IGenealogyGraphNode> contentMap; 37 40 private Dictionary<string, IGenealogyGraphNode> idMap; … … 71 74 72 75 [StorableConstructor] 73 protected GenealogyGraph(bool deserializing) 74 : base(deserializing) { 75 } 76 protected GenealogyGraph(StorableConstructorFlag _) : base(_) { } 76 77 [StorableHook(HookType.AfterDeserialization)] 77 78 private void AfterDeserialization() { … … 191 192 192 193 [Item("GenealogyGraph", "A genealogy graph in which the vertex data is of type T")] 193 [StorableClass] 194 public class GenealogyGraph<T> : GenealogyGraph, IGenealogyGraph<T> where T : class, IItem { 194 [StorableType("3F5043F7-2538-4B76-BA12-062A4CEF5A1A")] 195 public class GenealogyGraph<T> : GenealogyGraph, IGenealogyGraph<T> where T : class, IItem 196 { 195 197 public GenealogyGraph() { } 196 198 private GenealogyGraph(GenealogyGraph original, Cloner cloner) -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs
r11925 r17434 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 25 26 26 27 namespace HeuristicLab.EvolutionTracking { 27 [StorableClass]28 28 [Item("GenealogyGraphArc", "A graph arc connecting two GenealogyGraphNodes and holding some data.")] 29 [StorableType("011C69C6-7E84-4AB0-8DBB-9A5BB69D9484")] 29 30 public class GenealogyGraphArc : Arc<IDeepCloneable>, IGenealogyGraphArc { 30 31 [StorableConstructor] 31 protected GenealogyGraphArc( bool deserializing) : base(deserializing) { }32 protected GenealogyGraphArc(StorableConstructorFlag _) : base(_) { } 32 33 protected GenealogyGraphArc(GenealogyGraphArc original, Cloner cloner) 33 34 : base(original, cloner) { } … … 50 51 } 51 52 52 [StorableClass]53 53 [Item("GenealogyGraphArc", "")] 54 [StorableType("47612662-7C98-44F8-94D0-132B425889F5")] 54 55 public class GenealogyGraphArc<T> : GenealogyGraphArc where T : class,IItem { 55 56 [StorableConstructor] 56 protected GenealogyGraphArc( bool deserializing) : base(deserializing) { }57 protected GenealogyGraphArc(StorableConstructorFlag _) : base(_) { } 57 58 58 59 protected GenealogyGraphArc(GenealogyGraphArc original, Cloner cloner) -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs
r15757 r17434 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 28 29 29 30 namespace HeuristicLab.EvolutionTracking { 30 [StorableClass]31 31 [Item("GenealogGraphNode", "A class representing a node in the GenealogyGraph")] 32 [StorableType("3112AC58-F11A-435A-A669-8C9B6EF88F40")] 32 33 public class GenealogyGraphNode : Vertex<IDeepCloneable>, IGenealogyGraphNode { 33 34 [StorableConstructor] 34 protected GenealogyGraphNode( bool deserializing) : base(deserializing) { }35 protected GenealogyGraphNode(StorableConstructorFlag _) : base(_) { } 35 36 36 37 public override IDeepCloneable Clone(Cloner cloner) { … … 132 133 } 133 134 134 [StorableClass]135 135 [Item("GenealogyGraphNode", "A genealogy graph node which also has a Content")] 136 [StorableType("68BE4E3D-2578-4C06-BF03-8583BA03022F")] 136 137 public class GenealogyGraphNode<T> : GenealogyGraphNode, IGenealogyGraphNode<T> where T : class, IItem { 137 138 public new T Data { … … 141 142 142 143 [StorableConstructor] 143 protected GenealogyGraphNode( bool deserializing) : base(deserializing) { }144 protected GenealogyGraphNode(StorableConstructorFlag _) : base(_) { } 144 145 145 146 public GenealogyGraphNode(IDeepCloneable content) : base(content) { } -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/HeuristicLab.EvolutionTracking-3.4.csproj
r16131 r17434 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <Project ToolsVersion=" 4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">2 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 3 <PropertyGroup> 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> … … 11 11 <RootNamespace>HeuristicLab.EvolutionTracking</RootNamespace> 12 12 <AssemblyName>HeuristicLab.EvolutionTracking-3.4</AssemblyName> 13 <TargetFrameworkVersion>v4. 5</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> 15 15 <TargetFrameworkProfile /> … … 62 62 </PropertyGroup> 63 63 <ItemGroup> 64 <Reference Include="HEAL.Attic, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 65 <SpecificVersion>False</SpecificVersion> 66 <HintPath>..\..\..\..\trunk\bin\HEAL.Attic.dll</HintPath> 67 </Reference> 64 68 <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 65 69 <SpecificVersion>False</SpecificVersion> -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterCrossoverOperator.cs
r14574 r17434 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 27 28 namespace HeuristicLab.EvolutionTracking { 28 [StorableClass]29 29 [Item("AfterCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")] 30 [StorableType("E43B0F0A-998D-4CD1-A030-B2A927086433")] 30 31 public class AfterCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class, IItem { 31 32 private const string ParentsParameterName = "Parents"; … … 46 47 } 47 48 [StorableConstructor] 48 protected AfterCrossoverOperator( bool deserializing) : base(deserializing) { }49 protected AfterCrossoverOperator(StorableConstructorFlag _) : base(_) { } 49 50 50 51 public AfterCrossoverOperator() { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterManipulatorOperator.cs
r11227 r17434 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 27 28 namespace HeuristicLab.EvolutionTracking { 28 [StorableClass]29 29 [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")] 30 [StorableType("DF888AB7-709A-41BD-A201-F026CE4DB8F4")] 30 31 public class AfterManipulatorOperator<T> : EvolutionTrackingOperator<T>, IManipulatorOperator<T> where T : class,IItem { 31 32 private const string ChildParameterName = "Child"; … … 42 43 } 43 44 [StorableConstructor] 44 protected AfterManipulatorOperator( bool deserializing) : base(deserializing) { }45 protected AfterManipulatorOperator(StorableConstructorFlag _) : base(_) { } 45 46 46 47 public AfterManipulatorOperator() { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterSolutionCreatorOperator.cs
r10650 r17434 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Parameters; … … 25 26 26 27 namespace HeuristicLab.EvolutionTracking.Operators { 27 [StorableClass]28 28 [Item("AfterSolutionCreatorOperator", "An operator that runs after the solution creator and performs additional actions.")] 29 [StorableType("A5B1528D-336B-48CF-8F74-8F2322F8A136")] 29 30 public class AfterSolutionCreatorOperator<T> : EvolutionTrackingOperator<T> 30 31 where T : class,IItem { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs
r11858 r17434 22 22 using System; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 29 30 30 31 namespace HeuristicLab.EvolutionTracking { 31 [StorableClass]32 32 [Item("BeforeCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")] 33 [StorableType("A44A9100-AD1D-459C-A45A-CE7C1B894E71")] 33 34 public class BeforeCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class,IItem { 34 35 private const string ParentsParameterName = "Parents"; … … 55 56 56 57 [StorableConstructor] 57 protected BeforeCrossoverOperator( bool deserializing) : base(deserializing) { }58 protected BeforeCrossoverOperator(StorableConstructorFlag _) : base(_) { } 58 59 59 60 public BeforeCrossoverOperator() { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
r13527 r17434 21 21 22 22 using System.Linq; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 27 28 28 29 namespace HeuristicLab.EvolutionTracking { 29 [StorableClass]30 30 [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")] 31 [StorableType("78C5698A-39B8-4158-83F6-7E6CFAF5BD2A")] 31 32 public class BeforeManipulatorOperator<T> : EvolutionTrackingOperator<T>, IManipulatorOperator<T> where T : class, IItem { 32 33 private const string ChildParameterName = "Child"; … … 45 46 46 47 [StorableConstructor] 47 protected BeforeManipulatorOperator( bool deserializing) : base(deserializing) { }48 protected BeforeManipulatorOperator(StorableConstructorFlag _) : base(_) { } 48 49 49 50 public BeforeManipulatorOperator() { -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/EvolutionTrackingOperator.cs
r12951 r17434 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 30 31 namespace HeuristicLab.EvolutionTracking { 31 32 [Item("EvolutionTrackingOperator", "A base operator which facilitates access to the genealogy graph.")] 32 [Storable Class]33 [StorableType("27D4603D-0EDC-4C77-9AB9-ED10CA6D4613")] 33 34 public class EvolutionTrackingOperator<T> : SingleSuccessorOperator where T : class, IItem { 34 35 // evolution tracking-related parameters … … 73 74 } 74 75 [StorableConstructor] 75 protected EvolutionTrackingOperator( bool deserializing) : base(deserializing) { }76 protected EvolutionTrackingOperator(StorableConstructorFlag _) : base(_) { } 76 77 } 77 78 } -
branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/RemovePopulationGraphFromResults.cs
r16131 r17434 1 using HeuristicLab.Common; 1 using HEAL.Attic; 2 using HeuristicLab.Common; 2 3 using HeuristicLab.Core; 3 4 using HeuristicLab.Operators; … … 12 13 13 14 namespace HeuristicLab.EvolutionTracking.Operators { 14 [StorableClass]15 15 [Item("RemovePopulationGraphFromResultsOperator", "In some cases the genealogy graph is necessary during the run but to save memory it should be removed from the results at the end of the run.")] 16 [StorableType("5F5FEAAD-DA7C-4C8C-A9B3-B4DE30B64C51")] 16 17 public class RemovePopulationGraphFromResultsOperator : SingleSuccessorOperator { 17 18 … … 23 24 24 25 [StorableConstructor] 25 protected RemovePopulationGraphFromResultsOperator( bool deserializing) : base(deserializing) { }26 protected RemovePopulationGraphFromResultsOperator(StorableConstructorFlag _) : base(_) { } 26 27 27 28 [StorableHook(HookType.AfterDeserialization)]
Note: See TracChangeset
for help on using the changeset viewer.