Changeset 8206 for branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMoveSoftTabuCriterion.cs
- Timestamp:
- 07/03/12 16:46:35 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:mergeinfo changed
/trunk/sources merged: 8084,8088-8090,8092-8100,8102-8113,8115,8117-8132,8134-8146,8148-8156,8158-8160,8163-8170,8173-8176,8178-8190,8192-8205
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMoveSoftTabuCriterion.cs
r8083 r8206 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 27 using HeuristicLab.Operators; 27 28 using HeuristicLab.Optimization; … … 29 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 31 31 namespace HeuristicLab. Encodings.SymbolicExpressionTreeEncoding{32 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 32 33 [Item("ReplaceBranchMoveSoftTabuCriterion", @"")] 33 34 [StorableClass] … … 119 120 } 120 121 } 121 //int length = permutation.Length;122 //double moveQuality = MoveQualityParameter.ActualValue.Value;123 //bool maximization = MaximizationParameter.ActualValue.Value;124 //bool useAspiration = UseAspirationCriterion.Value;125 //bool isTabu = false;126 122 127 //if (permutation.PermutationType == PermutationTypes.Absolute) {128 // int count = move.Index2 - move.Index1 + 1;129 // int[] numbers = new int[count];130 // for (int i = move.Index1; i <= move.Index2; i++)131 // numbers[i - move.Index1] = permutation[i];132 133 // foreach (IItem tabuMove in tabuList) {134 // TranslocationMoveAbsoluteAttribute attribute = (tabuMove as TranslocationMoveAbsoluteAttribute);135 // if (attribute != null) {136 // if (!useAspiration137 // || maximization && moveQuality <= attribute.MoveQuality138 // || !maximization && moveQuality >= attribute.MoveQuality) { // if the move quality is improving beyond what was recorded when the move in the tabu list was recorded the move is regarded as okay139 140 // for (int i = 0; i < count; i++) {141 // for (int j = 0; j < attribute.Number.Length; j++) {142 // if (attribute.Number[j] == numbers[i] && attribute.OldPosition + j == move.Index3 + i) {143 // isTabu = true;144 // break;145 // }146 // }147 // if (isTabu) break;148 // }149 // }150 // }151 // if (isTabu) break;152 // }153 //} else {154 // int E1S = permutation.GetCircular(move.Index1 - 1);155 // int E1T = permutation[move.Index1];156 // int E2S = permutation[move.Index2];157 // int E2T = permutation.GetCircular(move.Index2 + 1);158 // int E3S, E3T;159 // if (move.Index3 > move.Index1) {160 // E3S = permutation.GetCircular(move.Index3 + move.Index2 - move.Index1);161 // E3T = permutation.GetCircular(move.Index3 + move.Index2 - move.Index1 + 1);162 // } else {163 // E3S = permutation.GetCircular(move.Index3 - 1);164 // E3T = permutation[move.Index3];165 // }166 // foreach (IItem tabuMove in tabuList) {167 // TranslocationMoveRelativeAttribute attribute = (tabuMove as TranslocationMoveRelativeAttribute);168 // if (attribute != null) {169 // if (!useAspiration170 // || maximization && moveQuality <= attribute.MoveQuality171 // || !maximization && moveQuality >= attribute.MoveQuality) {172 173 // // if previously deleted Edge1Source-Target is readded174 // if (permutation.PermutationType == PermutationTypes.RelativeUndirected) {175 // if (attribute.Edge1Source == E3S && attribute.Edge1Target == E1T || attribute.Edge1Source == E1T && attribute.Edge1Target == E3S176 // || attribute.Edge1Source == E2S && attribute.Edge1Target == E3T || attribute.Edge1Source == E3T && attribute.Edge1Target == E2S177 // // if previously deleted Edge2Source-Target is readded178 // || attribute.Edge2Source == E3S && attribute.Edge2Target == E1T || attribute.Edge2Source == E1T && attribute.Edge2Target == E3S179 // || attribute.Edge2Source == E2S && attribute.Edge2Target == E3T || attribute.Edge2Source == E3T && attribute.Edge2Target == E2S180 // // if previously deleted Edge3Source-Target is readded181 // || attribute.Edge3Source == E3S && attribute.Edge3Target == E1T || attribute.Edge3Source == E1T && attribute.Edge3Target == E3S182 // || attribute.Edge3Source == E2S && attribute.Edge3Target == E3T || attribute.Edge3Source == E3T && attribute.Edge3Target == E2S) {183 // isTabu = true;184 // break;185 // }186 // } else {187 // if (attribute.Edge1Source == E3S && attribute.Edge1Target == E1T188 // || attribute.Edge1Source == E2S && attribute.Edge1Target == E3T189 // // if previously deleted Edge2Source-Target is readded190 // || attribute.Edge2Source == E3S && attribute.Edge2Target == E1T191 // || attribute.Edge2Source == E2S && attribute.Edge2Target == E3T192 // // if previously deleted Edge3Source-Target is readded193 // || attribute.Edge3Source == E3S && attribute.Edge3Target == E1T194 // || attribute.Edge3Source == E2S && attribute.Edge3Target == E3T) {195 // isTabu = true;196 // break;197 // }198 // }199 // }200 // }201 // }202 //}203 123 MoveTabuParameter.ActualValue = new BoolValue(isTabu); 204 124 return base.Apply();
Note: See TracChangeset
for help on using the changeset viewer.