Changeset 12272


Ignore:
Timestamp:
03/31/15 16:57:05 (4 years ago)
Author:
apolidur
Message:

#2221: Adding 2.5-opt-EEs operators to PTSP

Location:
branches/PTSP
Files:
13 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/PTSP/HeuristicLab.Problems.PTSP.Tests-3.3/PTSPMoveEvaluatorTest.cs

    r12269 r12272  
    8888        double afterMatrix = ePTSP.EvaluateWithParams(distances, ProbabilityMatrix, realizations, tour)[0];
    8989
    90         Assert.IsTrue(moveMatrix.IsAlmost(Math.Abs(afterMatrix - beforeMatrix)), string.Format(failureString, (Math.Abs(afterMatrix - beforeMatrix)).ToString()));
     90        Assert.IsTrue(Math.Abs(moveMatrix).IsAlmost(Math.Abs(afterMatrix - beforeMatrix)), string.Format(failureString, (Math.Abs(afterMatrix - beforeMatrix)).ToString()));
    9191
    9292        beforeMatrix = afterMatrix;
     
    115115        double afterMatrix = ePTSP.EvaluateWithParams(distances, ProbabilityMatrix, realizations, tour)[0];
    116116
    117         Assert.IsTrue(moveMatrix.IsAlmost(Math.Abs(afterMatrix - beforeMatrix)), string.Format(failureString, (Math.Abs(afterMatrix - beforeMatrix)).ToString()));
     117        Assert.IsTrue(Math.Abs(moveMatrix).IsAlmost(Math.Abs(afterMatrix - beforeMatrix)), string.Format(failureString, (Math.Abs(afterMatrix - beforeMatrix)).ToString()));
    118118
    119119        beforeMatrix = afterMatrix;
  • branches/PTSP/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs

    r12269 r12272  
    9595      Operators.Add(new PTSPExhaustiveInversionLocalImprovement());
    9696      Operators.Add(new PTSPExhaustiveInsertionLocalImprovement());
     97
     98      Operators.Add(new Exhaustive25MoveGenerator());
     99      Operators.Add(new Stochastic25MultiMoveGenerator());
     100      Operators.Add(new Stochastic25SingleMoveGenerator());
     101      Operators.Add(new TwoPointFiveMoveMaker());
     102      Operators.Add(new PTSP25MoveEvaluator());
     103
    97104      Encoding.ConfigureOperators(Operators.OfType<IOperator>());
     105      foreach (var twopointfiveMoveOperator in Operators.OfType<I25MoveOperator>()) {
     106        twopointfiveMoveOperator.TwoPointFiveMoveParameter.ActualName = "Permutation.TwoPointFiveMove";
     107      }
    98108    }
    99109
     
    156166        op.RealizationsParameter.Value = realizations;
    157167      }
     168      foreach (var op in Operators.OfType<PTSP25MoveEvaluator>()) {
     169        op.RealizationsParameter.Value = realizations;
     170      }
     171
    158172    }
    159173  }
  • branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj

    r12261 r12272  
    119119    <Compile Include="Improvers\PTSPExhaustiveInsertionLocalImprovement.cs" />
    120120    <Compile Include="Improvers\PTSPExhaustiveInversionLocalImprovement.cs" />
     121    <Compile Include="Interfaces\I25MoveOperator.cs" />
    121122    <Compile Include="Interfaces\IPTSPPathMoveEvaluator.cs" />
    122123    <Compile Include="Interfaces\IPTSPMoveEvaluator.cs" />
     
    126127    <Compile Include="MoveEvaluators\TwoOpt\PTSPAnalyticalInversionMovePathEvaluator.cs" />
    127128    <Compile Include="MoveEvaluators\TwoOpt\PTSPEstimatedInversionMovePathEvaluator.cs" />
     129    <Compile Include="MoveEvaluators\TwoPointFiveOpt\PTSP25MoveEvaluator.cs" />
     130    <Compile Include="MoveGenerators\Exhaustive25MoveGenerator.cs" />
     131    <Compile Include="MoveGenerators\Stochastic25MultiMoveGenerator.cs" />
     132    <Compile Include="MoveGenerators\Stochastic25SingleMoveGenerator.cs" />
     133    <Compile Include="MoveGenerators\TwoPointFiveMoveGenerator.cs" />
     134    <Compile Include="MoveMakers\TwoPointFiveMoveMaker.cs" />
     135    <Compile Include="Moves\TwoPointFiveOpt\TwoPointFiveMove.cs" />
    128136    <Compile Include="PathPTSPTour.cs" />
    129137    <Compile Include="PTSP.cs" />
  • branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/OneShift/PTSPEstimatedInsertionEvaluator.cs

    r12261 r12272  
    157157      }
    158158      // return average of cost differences
    159       return Math.Abs(moveQuality) / realizations.Capacity;
     159      return moveQuality / realizations.Capacity;
    160160    }
    161161
  • branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPEstimatedInversionMovePathEvaluator.cs

    r12261 r12272  
    119119      }
    120120      // return average of cost differences
    121       return Math.Abs(moveQuality) / realizations.Capacity;
     121      return moveQuality / realizations.Capacity;
    122122    }
    123123
Note: See TracChangeset for help on using the changeset viewer.