Class PSRanking

java.lang.Object
org.ddolib.examples.pigmentscheduling.PSRanking
All Implemented Interfaces:
Comparator<PSState>, StateRanking<PSState>

public class PSRanking extends Object implements StateRanking<PSState>
Provides a ranking heuristic for comparing two PSState objects within the Production Scheduling Problem (PSP) search framework.

The PSRanking class implements the StateRanking interface and defines a simple heuristic ordering between states based on their total remaining demand. This ranking is typically used by search algorithms such as DDO (Decision Diagram Optimization) to prioritize which states should be expanded first during the exploration of the search tree.

In this implementation, states with a smaller total demand are considered "better" (i.e., ranked higher), as they represent configurations that are closer to satisfying all production demands.

Note: this ranking heuristic is a simple and potentially suboptimal choice. More advanced heuristics may consider additional aspects such as stocking cost accumulation, changeover penalties, or temporal feasibility.

See Also:
  • Constructor Details

    • PSRanking

      public PSRanking()
  • Method Details

    • compare

      public int compare(PSState s1, PSState s2)
      Compares two PSP states based on their total remaining demand.

      The state with the smaller sum of previousDemands values (i.e., fewer remaining demands) is considered to have a better rank.

      Specified by:
      compare in interface Comparator<PSState>
      Parameters:
      s1 - the first PSState to compare
      s2 - the second PSState to compare
      Returns:
      a negative integer if s1 is better than s2, zero if they are equivalent, or a positive integer otherwise