Changeset 15979 for branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration
- Timestamp:
- 07/03/18 10:55:29 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/GrammarEnumerationAlgorithm.cs
r15977 r15979 170 170 protected GrammarEnumerationAlgorithm(bool deserializing) : base(deserializing) { } 171 171 172 private void RegisterEvents() { 173 // re-wire analyzer events 174 foreach (var analyzer in Analyzers.CheckedItems) 175 analyzer.Register(this); 176 Analyzers.CheckedItemsChanged += Analyzers_CheckedItemsChanged; 177 178 SearchDataStructureParameter.Value.ValueChanged += (o, e) => Prepare(); 179 SearchDataStructureSizeParameter.Value.ValueChanged += (o, e) => Prepare(); 180 SearchCacheSizeParameter.Value.ValueChanged += (o, e) => Prepare(); 181 } 182 183 private void DeregisterEvents() { 184 foreach (var analyzer in Analyzers.CheckedItems) 185 analyzer.Register(this); 186 Analyzers.CheckedItemsChanged -= Analyzers_CheckedItemsChanged; 187 188 SearchDataStructureParameter.Value.ValueChanged -= (o, e) => Prepare(); 189 SearchDataStructureSizeParameter.Value.ValueChanged -= (o, e) => Prepare(); 190 SearchCacheSizeParameter.Value.ValueChanged -= (o, e) => Prepare(); 191 } 192 193 [StorableHook(HookType.AfterDeserialization)] 194 private void AfterDeserialization() { 195 RegisterEvents(); 196 } 197 172 198 public GrammarEnumerationAlgorithm() { 173 199 Parameters.Add(new FixedValueParameter<DoubleValue>(VariableImportanceWeightName, "Variable Weight.", new DoubleValue(1.0))); … … 417 443 #region pause support 418 444 private ExecutionState previousExecutionState; 445 419 446 protected override void OnPaused() { 420 447 previousExecutionState = this.ExecutionState; 421 448 base.OnPaused(); 422 449 } 450 423 451 protected override void OnPrepared() { 424 452 previousExecutionState = this.ExecutionState; 425 453 base.OnPrepared(); 426 454 } 455 427 456 protected override void OnStarted() { 428 457 previousExecutionState = this.ExecutionState; 429 458 base.OnStarted(); 430 459 } 460 431 461 protected override void OnStopped() { 432 462 previousExecutionState = this.ExecutionState;
Note: See TracChangeset
for help on using the changeset viewer.