- Timestamp:
- 05/07/19 15:38:16 (6 years ago)
- Location:
- branches/2994-AutoDiffForIntervals
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2994-AutoDiffForIntervals
- Property svn:mergeinfo changed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/branches/2931_OR-Tools_LP_MIP/HeuristicLab.Optimization (added) merged: 16233,16582 /trunk/HeuristicLab.Optimization merged: 16860,16875,16910
- Property svn:mergeinfo changed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
r16565 r16911 36 36 37 37 public abstract bool SupportsPause { get; } 38 public virtual bool SupportsStop { 39 get { return true; } 40 } 38 41 39 42 [Storable] … … 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(); -
branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization/3.3/BasicProblems/BasicProblem.cs
r16565 r16911 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 using HeuristicLab.Data; 27 29 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 30 30 31 namespace HeuristicLab.Optimization { … … 157 158 OnOperatorsChanged(); 158 159 } 160 161 protected override IEnumerable<KeyValuePair<string, IItem>> GetCollectedValues(IValueParameter param) { 162 if (param.Value == null) yield break; 163 if (param.GetsCollected) { 164 if (param == EncodingParameter) // store only the name of the encoding 165 yield return new KeyValuePair<string, IItem>(String.Empty, new StringValue(EncodingParameter.Value.Name)); 166 else yield return new KeyValuePair<string, IItem>(String.Empty, param.Value); 167 } 168 var parameterizedItem = param.Value as IParameterizedItem; 169 if (parameterizedItem != null) { 170 var children = new Dictionary<string, IItem>(); 171 parameterizedItem.CollectParameterValues(children); 172 foreach (var child in children) yield return child; 173 } 174 } 159 175 } 160 176 } -
branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs
r16565 r16911 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; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 30 30 namespace HeuristicLab.Optimization { … … 92 92 protected Encoding(string name) 93 93 : base(name) { 94 Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly())); 94 Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly()) { 95 GetsCollected = false 96 }); 95 97 } 96 98 -
branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization/3.3/Problems/Problem.cs
r16829 r16911 23 23 using System.Collections.Generic; 24 24 using System.Drawing; 25 using HEAL.Attic; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; … … 28 29 using HeuristicLab.Data; 29 30 using HeuristicLab.Parameters; 30 using HEAL.Attic;31 31 32 32 namespace HeuristicLab.Optimization { … … 52 52 protected Problem() 53 53 : base() { 54 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>() , false));54 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>()) { GetsCollected = false }); 55 55 OperatorsParameter.Hidden = true; 56 56 RegisterEventHandlers(); … … 66 66 if (operators != null) { 67 67 Parameters.Remove(OperatorsParameterName); 68 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>(operators) , false));68 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>(operators)) { GetsCollected = false }); 69 69 OperatorsParameter.Hidden = true; 70 70 } … … 95 95 //necessary to convert old experiments files where no parameter was used for saving the operators 96 96 if (!Parameters.ContainsKey(OperatorsParameterName)) { 97 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>() , false));97 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>()) { GetsCollected = false }); 98 98 OperatorsParameter.Hidden = true; 99 99 } … … 107 107 #region Backwards compatible code, remove with 3.4 108 108 if (!Parameters.ContainsKey(OperatorsParameterName)) { 109 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>() , false));109 Parameters.Add(new FixedValueParameter<ItemCollection<IItem>>(OperatorsParameterName, "The operators and items that the problem provides to the algorithms.", new ItemCollection<IItem>()) { GetsCollected = false }); 110 110 OperatorsParameter.Hidden = true; 111 111 } -
branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs
r16565 r16911 25 25 using System.Linq; 26 26 using System.Threading; 27 using HEAL.Attic; 27 28 using HeuristicLab.Collections; 28 29 using HeuristicLab.Common; … … 30 31 using HeuristicLab.Data; 31 32 using HeuristicLab.Parameters; 32 using HEAL.Attic;33 33 using HeuristicLab.PluginInfrastructure; 34 34 … … 130 130 ItemList<IOperator> tmp = ((ValueParameter<ItemList<IOperator>>)Parameters["Operators"]).Value; 131 131 Parameters.Remove("Operators"); 132 Parameters.Add(new ValueParameter<ItemList<IItem>>("Operators", "The operators and items that the problem provides to the algorithms.", new ItemList<IItem>(tmp) , false));132 Parameters.Add(new ValueParameter<ItemList<IItem>>("Operators", "The operators and items that the problem provides to the algorithms.", new ItemList<IItem>(tmp)) { GetsCollected = false }); 133 133 } 134 134 #endregion
Note: See TracChangeset
for help on using the changeset viewer.