Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/12 16:46:35 (12 years ago)
Author:
gkronber
Message:

#1847: merged r8084:8205 from trunk into GP move operators branch

Location:
branches/GP-MoveOperators
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators

  • branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMoveSoftTabuCriterion.cs

    r8083 r8206  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
     26using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2627using HeuristicLab.Operators;
    2728using HeuristicLab.Optimization;
     
    2930using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3031
    31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     32namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    3233  [Item("ReplaceBranchMoveSoftTabuCriterion", @"")]
    3334  [StorableClass]
     
    119120        }
    120121      }
    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;
    126122
    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 (!useAspiration
    137       //        || maximization && moveQuality <= attribute.MoveQuality
    138       //        || !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 okay
    139 
    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 (!useAspiration
    170       //        || maximization && moveQuality <= attribute.MoveQuality
    171       //        || !maximization && moveQuality >= attribute.MoveQuality) {
    172 
    173       //        // if previously deleted Edge1Source-Target is readded
    174       //        if (permutation.PermutationType == PermutationTypes.RelativeUndirected) {
    175       //          if (attribute.Edge1Source == E3S && attribute.Edge1Target == E1T || attribute.Edge1Source == E1T && attribute.Edge1Target == E3S
    176       //            || attribute.Edge1Source == E2S && attribute.Edge1Target == E3T || attribute.Edge1Source == E3T && attribute.Edge1Target == E2S
    177       //            // if previously deleted Edge2Source-Target is readded
    178       //            || attribute.Edge2Source == E3S && attribute.Edge2Target == E1T || attribute.Edge2Source == E1T && attribute.Edge2Target == E3S
    179       //            || attribute.Edge2Source == E2S && attribute.Edge2Target == E3T || attribute.Edge2Source == E3T && attribute.Edge2Target == E2S
    180       //            // if previously deleted Edge3Source-Target is readded
    181       //            || attribute.Edge3Source == E3S && attribute.Edge3Target == E1T || attribute.Edge3Source == E1T && attribute.Edge3Target == E3S
    182       //            || 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 == E1T
    188       //            || attribute.Edge1Source == E2S && attribute.Edge1Target == E3T
    189       //            // if previously deleted Edge2Source-Target is readded
    190       //            || attribute.Edge2Source == E3S && attribute.Edge2Target == E1T
    191       //            || attribute.Edge2Source == E2S && attribute.Edge2Target == E3T
    192       //            // if previously deleted Edge3Source-Target is readded
    193       //            || attribute.Edge3Source == E3S && attribute.Edge3Target == E1T
    194       //            || attribute.Edge3Source == E2S && attribute.Edge3Target == E3T) {
    195       //            isTabu = true;
    196       //            break;
    197       //          }
    198       //        }
    199       //      }
    200       //    }
    201       //  }
    202       //}
    203123      MoveTabuParameter.ActualValue = new BoolValue(isTabu);
    204124      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.