Class AverageRegretKScoringFunction

java.lang.Object
com.graphhopper.jsprit.core.algorithm.recreate.AverageRegretKScoringFunction
All Implemented Interfaces:
RegretKScoringFunction

public class AverageRegretKScoringFunction extends Object implements RegretKScoringFunction
Average-based regret-k scoring function.

Computes: score = mean(c_2..c_k) - c_1

This variant uses the average regret - the difference between the mean of alternatives 2 through k and the best. This provides a balanced view.

  • Constructor Details

    • AverageRegretKScoringFunction

      public AverageRegretKScoringFunction(ScoringFunction additionalScorer, int k)
      Creates an average regret-k scoring function.
      Parameters:
      additionalScorer - additional scoring function for tie-breaking (can be null)
      k - the number of alternatives to consider (use Integer.MAX_VALUE for "all")
  • Method Details

    • score

      public double score(RegretKAlternatives alternatives, Job job)
      Description copied from interface: RegretKScoringFunction
      Computes a score for a job based on its k-best insertion alternatives. Higher scores indicate higher urgency to insert the job now.
      Specified by:
      score in interface RegretKScoringFunction
      Parameters:
      alternatives - the k-best insertion alternatives for the job
      job - the job being scored
      Returns:
      the regret score (higher = more urgent to insert)
    • getK

      public int getK()