Changeset 16956 for branches/2457_ExpertSystem/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
- Timestamp:
- 05/15/19 13:36:51 (5 years ago)
- Location:
- branches/2457_ExpertSystem/HeuristicLab.Optimization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2457_ExpertSystem/HeuristicLab.Optimization
- Property svn:mergeinfo changed
-
branches/2457_ExpertSystem/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
r16075 r16956 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using HeuristicLab.Common; 25 25 using HeuristicLab.Core; 26 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;26 using HEAL.Attic; 27 27 28 28 namespace HeuristicLab.Optimization { 29 [Storable Class]29 [StorableType("EFBEE5EB-B15B-4FBB-A210-C4E36898B89D")] 30 30 public abstract class BasicAlgorithm : Algorithm, IStorableContent { 31 31 … … 36 36 37 37 public abstract bool SupportsPause { get; } 38 public virtual bool SupportsStop { 39 get { return true; } 40 } 38 41 39 42 [Storable] … … 52 55 53 56 [StorableConstructor] 54 protected BasicAlgorithm( bool deserializing) : base(deserializing) { }57 protected BasicAlgorithm(StorableConstructorFlag _) : base(_) { } 55 58 protected BasicAlgorithm(BasicAlgorithm original, Cloner cloner) 56 59 : base(original, cloner) { … … 106 109 // CancellationToken.ThrowIfCancellationRequested() must be called from within the Run method, otherwise stop does nothing 107 110 // alternatively check the IsCancellationRequested property of the cancellation token 111 if (!SupportsStop) 112 throw new NotSupportedException("Stop is not supported by this algorithm."); 113 108 114 base.Stop(); 109 115 if (ExecutionState == ExecutionState.Paused) OnStopped();
Note: See TracChangeset
for help on using the changeset viewer.