org.optaplanner.core.impl.domain.solution.mutation

## Class MutationCounter<Solution_>

- java.lang.Object
- - org.optaplanner.core.impl.domain.solution.mutation.MutationCounter<Solution_>

- Type Parameters:
    `Solution_` - the solution type, the class with the `PlanningSolution` annotation

      public class MutationCounter<Solution_>
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SolutionDescriptor<Solution_>` | `solutionDescriptor`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MutationCounter(SolutionDescriptor<Solution_> solutionDescriptor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `countMutations(Solution_ a, Solution_ b)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### solutionDescriptor

          protected final SolutionDescriptor<Solution_> solutionDescriptor

  - ### Constructor Detail

    - #### MutationCounter

          public MutationCounter(SolutionDescriptor<Solution_> solutionDescriptor)

  - ### Method Detail

    - #### countMutations

          public int countMutations(Solution_ a,
                                    Solution_ b)

      Parameters:
        `a` - never null
        `b` - never null
      Returns:
        `>= 0`, the number of planning variables that have a different value in `a` and `b`.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.