<?xml version="1.0" encoding="UTF-8"?>
<plannerBenchmark>
  <benchmarkDirectory>local/data/tsp</benchmarkDirectory>
  <parallelBenchmarkCount>AUTO</parallelBenchmarkCount>

  <inheritedSolverBenchmark>
    <problemBenchmarks>
      <solutionFileIOClass>org.optaplanner.examples.tsp.persistence.TspFileIO</solutionFileIOClass>
      <inputSolutionFile>data/tsp/import/other/air/europe40.tsp</inputSolutionFile>
      <inputSolutionFile>data/tsp/import/cook/air/dj38.tsp</inputSolutionFile>
      <inputSolutionFile>data/tsp/import/cook/air/lu980.tsp</inputSolutionFile>
      <!--<problemStatisticType>BEST_SCORE</problemStatisticType>-->
      <!--<problemStatisticType>STEP_SCORE</problemStatisticType>-->
      <!--<problemStatisticType>SCORE_CALCULATION_SPEED</problemStatisticType>-->
      <!--<problemStatisticType>BEST_SOLUTION_MUTATION</problemStatisticType>-->
      <!--<problemStatisticType>MOVE_COUNT_PER_STEP</problemStatisticType>-->
      <!--<problemStatisticType>MEMORY_USE</problemStatisticType>-->
      <!--<singleStatisticType>CONSTRAINT_MATCH_TOTAL_BEST_SCORE</singleStatisticType>-->
      <!--<singleStatisticType>CONSTRAINT_MATCH_TOTAL_STEP_SCORE</singleStatisticType>-->
      <!--<singleStatisticType>PICKED_MOVE_TYPE_BEST_SCORE_DIFF</singleStatisticType>-->
      <!--<singleStatisticType>PICKED_MOVE_TYPE_STEP_SCORE_DIFF</singleStatisticType>-->
    </problemBenchmarks>

    <solver>
      <solutionClass>org.optaplanner.examples.tsp.domain.TspSolution</solutionClass>
      <entityClass>org.optaplanner.examples.tsp.domain.Visit</entityClass>

      <scoreDirectorFactory>
        <!--<incrementalScoreCalculatorClass>org.optaplanner.examples.tsp.solver.score.TspIncrementalScoreCalculator</incrementalScoreCalculatorClass>-->
        <scoreDrl>org/optaplanner/examples/tsp/solver/tspScoreRules.drl</scoreDrl>
        <initializingScoreTrend>ONLY_DOWN</initializingScoreTrend>
      </scoreDirectorFactory>

      <termination>
        <minutesSpentLimit>5</minutesSpentLimit>
      </termination>
    </solver>
  </inheritedSolverBenchmark>

  <solverBenchmark>
    <name>Tabu Search</name>
    <solver>
      <constructionHeuristic>
        <constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
      </constructionHeuristic>
      <localSearch>
        <unionMoveSelector>
          <changeMoveSelector/>
          <swapMoveSelector>
            <cacheType>STEP</cacheType>
            <selectionOrder>SHUFFLED</selectionOrder>
          </swapMoveSelector>
          <subChainChangeMoveSelector>
            <subChainSelector>
              <maximumSubChainSize>40</maximumSubChainSize>
            </subChainSelector>
            <selectReversingMoveToo>true</selectReversingMoveToo>
          </subChainChangeMoveSelector>
          <!--<subChainSwapMoveSelector>-->
            <!--<subChainSelector>-->
              <!--<maximumSubChainSize>40</maximumSubChainSize>-->
            <!--</subChainSelector>-->
            <!--<selectReversingMoveToo>true</selectReversingMoveToo>-->
          <!--</subChainSwapMoveSelector>-->
        </unionMoveSelector>
        <acceptor>
          <entityTabuSize>5</entityTabuSize>
        </acceptor>
        <forager>
          <acceptedCountLimit>5000</acceptedCountLimit>
        </forager>
      </localSearch>
    </solver>
  </solverBenchmark>
  <solverBenchmark>
    <name>Late Acceptance Nearby</name>
    <solver>
      <constructionHeuristic>
        <constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType>
      </constructionHeuristic>
      <localSearch>
        <unionMoveSelector>
          <changeMoveSelector>
            <entitySelector id="entitySelector1"/>
            <valueSelector>
              <nearbySelection>
                <originEntitySelector mimicSelectorRef="entitySelector1"/>
                <nearbyDistanceMeterClass>org.optaplanner.examples.tsp.domain.solver.nearby.VisitNearbyDistanceMeter</nearbyDistanceMeterClass>
                <parabolicDistributionSizeMaximum>40</parabolicDistributionSizeMaximum>
              </nearbySelection>
            </valueSelector>
          </changeMoveSelector>
          <swapMoveSelector>
            <entitySelector id="entitySelector2"/>
            <secondaryEntitySelector>
              <nearbySelection>
                <originEntitySelector mimicSelectorRef="entitySelector2"/>
                <nearbyDistanceMeterClass>org.optaplanner.examples.tsp.domain.solver.nearby.VisitNearbyDistanceMeter</nearbyDistanceMeterClass>
                <parabolicDistributionSizeMaximum>40</parabolicDistributionSizeMaximum>
              </nearbySelection>
            </secondaryEntitySelector>
          </swapMoveSelector>
          <tailChainSwapMoveSelector>
            <entitySelector id="entitySelector3"/>
            <valueSelector>
              <nearbySelection>
                <originEntitySelector mimicSelectorRef="entitySelector3"/>
                <nearbyDistanceMeterClass>org.optaplanner.examples.tsp.domain.solver.nearby.VisitNearbyDistanceMeter</nearbyDistanceMeterClass>
                <parabolicDistributionSizeMaximum>40</parabolicDistributionSizeMaximum>
              </nearbySelection>
            </valueSelector>
          </tailChainSwapMoveSelector>
        </unionMoveSelector>
      </localSearch>
    </solver>
  </solverBenchmark>
</plannerBenchmark>
