Changeset 7040
- Timestamp:
- 11/22/11 14:54:17 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding.Views/3.3/PermutationTypeView.Designer.cs
r5445 r7040 54 54 this.valueLabel.Location = new System.Drawing.Point(3, 3); 55 55 this.valueLabel.Name = "valueLabel"; 56 this.valueLabel.Size = new System.Drawing.Size(3 7, 13);56 this.valueLabel.Size = new System.Drawing.Size(34, 13); 57 57 this.valueLabel.TabIndex = 0; 58 this.valueLabel.Text = "& Value:";58 this.valueLabel.Text = "&Type:"; 59 59 // 60 60 // valueComboBox … … 71 71 this.valueComboBox.SelectedIndexChanged += new System.EventHandler(this.valueComboBox_SelectedIndexChanged); 72 72 // 73 // ComparisonView73 // PermutationTypeView 74 74 // 75 75 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 77 77 this.Controls.Add(this.valueComboBox); 78 78 this.Controls.Add(this.valueLabel); 79 this.Name = " ComparisonView";79 this.Name = "PermutationTypeView"; 80 80 this.Size = new System.Drawing.Size(265, 29); 81 81 this.ResumeLayout(false); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding.Views/3.3/PermutationView.Designer.cs
r6628 r7040 72 72 this.Controls.Add(this.permutationTypeView); 73 73 this.Name = "PermutationView"; 74 this.Controls.SetChildIndex(this.permutationTypeView, 0);75 74 this.Controls.SetChildIndex(this.lengthLabel, 0); 76 75 this.Controls.SetChildIndex(this.lengthTextBox, 0); 76 this.Controls.SetChildIndex(this.permutationTypeView, 0); 77 77 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 78 78 this.ResumeLayout(false); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding.Views/3.3/PermutationView.cs
r6628 r7040 37 37 InitializeComponent(); 38 38 dataGridView.Top = permutationTypeView.Bottom + permutationTypeView.Margin.Bottom + dataGridView.Margin.Top; 39 dataGridView.Height = Bottom - dataGridView.Top; 39 40 } 40 41 -
trunk/sources/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSeachOperator.cs
r6628 r7040 31 31 namespace HeuristicLab.Problems.QuadraticAssignment.Algorithms { 32 32 [Item("RobustTabooSearchOperator", "Performs an iteration of the robust taboo search algorithm as descrbied in Taillard 1991.")] 33 [StorableClass] 33 34 public sealed class RobustTabooSeachOperator : SingleSuccessorOperator, IIterationBasedOperator, IStochasticOperator { 34 35 … … 85 86 public IValueLookupParameter<IntValue> AlternativeAspirationTenureParameter { 86 87 get { return (IValueLookupParameter<IntValue>)Parameters["AlternativeAspirationTenure"]; } 88 } 89 90 private ILookupParameter<BoolValue> AllMovesTabuParameter { 91 get { return (ILookupParameter<BoolValue>)Parameters["AllMovesTabu"]; } 87 92 } 88 93 #endregion … … 111 116 Parameters.Add(new ValueLookupParameter<BoolValue>("UseAlternativeAspiration", "True if the alternative aspiration condition should be used that takes moves that have not been made for some time above others.")); 112 117 Parameters.Add(new ValueLookupParameter<IntValue>("AlternativeAspirationTenure", "The time t that a move will be remembered for the alternative aspiration condition.")); 118 Parameters.Add(new LookupParameter<BoolValue>("AllMovesTabu", "Indicates that all moves are tabu.")); 113 119 } 114 120 115 121 public override IDeepCloneable Clone(Cloner cloner) { 116 122 return new RobustTabooSeachOperator(this, cloner); 123 } 124 125 [StorableHook(HookType.AfterDeserialization)] 126 private void AfterDeserialization() { 127 // BackwardsCompatibility3.3 128 #region Backwards compatible code, remove with 3.4 129 if (!Parameters.ContainsKey("AllMovesTabu")) { 130 Parameters.Add(new LookupParameter<BoolValue>("AllMovesTabu", "Indicates that all moves are tabu.")); 131 } 132 #endregion 117 133 } 118 134 … … 131 147 bestQuality = BestQualityParameter.ActualValue; 132 148 } 149 bool allMovesTabu = false; 150 if (AllMovesTabuParameter.ActualValue == null) 151 AllMovesTabuParameter.ActualValue = new BoolValue(false); 152 else allMovesTabu = AllMovesTabuParameter.ActualValue.Value; 133 153 134 154 int minTenure = MinimumTabuTenureParameter.ActualValue.Value; … … 147 167 if (lastMove == null) 148 168 moveQuality = QAPSwap2MoveEvaluator.Apply(solution, move, weights, distances); 169 else if (allMovesTabu) moveQuality = moveQualityMatrix[move.Index1, move.Index2]; 149 170 else moveQuality = QAPSwap2MoveEvaluator.Apply(solution, move, moveQualityMatrix[move.Index1, move.Index2], weights, distances, lastMove); 150 171 … … 180 201 } 181 202 182 LastMoveParameter.ActualValue = bestMove; 183 184 if (bestMove == null) return base.Apply(); 203 allMovesTabu = bestMove == null; 204 if (!allMovesTabu) 205 LastMoveParameter.ActualValue = bestMove; 206 AllMovesTabuParameter.ActualValue.Value = allMovesTabu; 207 208 if (allMovesTabu) return base.Apply(); 185 209 186 210 bool useNewAdaptionScheme = UseNewTabuTenureAdaptionSchemeParameter.ActualValue.Value; -
trunk/sources/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSearch.cs
r6953 r7040 51 51 52 52 #region Parameter Properties 53 public FixedValueParameter<MultiAnalyzer> AnalyzerParameter {54 get { return ( FixedValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }53 public IValueParameter<MultiAnalyzer> AnalyzerParameter { 54 get { return (IValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 55 55 } 56 56 public FixedValueParameter<IntValue> SeedParameter { … … 77 77 public FixedValueParameter<BoolValue> UseNewTabuTenureAdaptionSchemeParameter { 78 78 get { return (FixedValueParameter<BoolValue>)Parameters["UseNewTabuTenureAdaptionScheme"]; } 79 } 80 public FixedValueParameter<BoolValue> TerminateOnOptimalSolutionParameter { 81 get { return (FixedValueParameter<BoolValue>)Parameters["TerminateOnOptimalSolution"]; } 79 82 } 80 83 #endregion … … 112 115 get { return UseNewTabuTenureAdaptionSchemeParameter.Value.Value; } 113 116 set { UseNewTabuTenureAdaptionSchemeParameter.Value.Value = value; } 117 } 118 public bool TerminateOnOptimalSolution { 119 get { return TerminateOnOptimalSolutionParameter.Value.Value; } 120 set { TerminateOnOptimalSolutionParameter.Value.Value = value; } 114 121 } 115 122 #endregion … … 132 139 } 133 140 public RobustTabooSearch() { 134 Parameters.Add(new FixedValueParameter<MultiAnalyzer>("Analyzer", "The analyzers that are applied after each iteration.", new MultiAnalyzer()));141 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The analyzers that are applied after each iteration.", new MultiAnalyzer())); 135 142 Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The seed value of the random number generator.", new IntValue(0))); 136 143 Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True whether the seed should be set randomly for each run, false if it should be fixed.", new BoolValue(true))); … … 140 147 Parameters.Add(new FixedValueParameter<BoolValue>("UseAlternativeAspiration", "True if the alternative aspiration condition should be used that takes moves that have not been made for some time above others.", new BoolValue(false))); 141 148 Parameters.Add(new FixedValueParameter<IntValue>("AlternativeAspirationTenure", "The time t that a move will be remembered for the alternative aspiration condition.", new IntValue(int.MaxValue))); 142 Parameters.Add(new FixedValueParameter<BoolValue>("TerminateOnOptimalSolution", "True when the algorithm should stop if it reached a quality equal or smaller to the BestKnownQuality.", new BoolValue( true)));149 Parameters.Add(new FixedValueParameter<BoolValue>("TerminateOnOptimalSolution", "True when the algorithm should stop if it reached a quality equal or smaller to the BestKnownQuality.", new BoolValue(false))); 143 150 Parameters.Add(new FixedValueParameter<BoolValue>("UseNewTabuTenureAdaptionScheme", @"In an updated version of his implementation, Eric Taillard introduced a different way to change the tabu tenure. 144 151 Instead of setting it uniformly between min and max, it will be set between 0 and max according to a right-skewed distribution. 145 152 Set this option to false if you want to optimize using the earlier 1991 version, and set to true if you want to optimize using the newer version. 146 153 Please note that the MinimumTabuTenure parameter has no effect in the new version.", new BoolValue(true))); 154 155 TerminateOnOptimalSolutionParameter.Hidden = true; 147 156 148 157 qualityAnalyzer = new BestAverageWorstQualityAnalyzer(); … … 298 307 [StorableHook(HookType.AfterDeserialization)] 299 308 private void AfterDeserialization() { 309 // BackwardsCompatibility3.3 310 #region Backwards compatible code, remove with 3.4 311 if (Parameters["Analyzer"] is FixedValueParameter<MultiAnalyzer>) { 312 MultiAnalyzer analyzer = AnalyzerParameter.Value; 313 Parameters.Remove("Analyzer"); 314 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The analyzers that are applied after each iteration.", analyzer)); 315 } 316 #endregion 300 317 RegisterEventHandlers(); 301 318 }
Note: See TracChangeset
for help on using the changeset viewer.