Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultScorer getLargestTimeWindow method always return MAX timeWindow #561

Open
YevgenRiaboshtan opened this issue Mar 8, 2025 · 0 comments

Comments

@YevgenRiaboshtan
Copy link

YevgenRiaboshtan commented Mar 8, 2025

com.graphhopper.jsprit.core.algorithm.recreate.DefaultScorer -> getLargestTimeWindow method
always return MAX timeWindow for each Activity (return TimeWindow.newInstance(0, Double.MAX_VALUE))

private TimeWindow getLargestTimeWindow(Activity act) {
     TimeWindow timeWindow = null;
     for (TimeWindow tw : act.getTimeWindows()) {
         if (timeWindow == null) timeWindow = tw;
         else if (tw.larger(timeWindow)) timeWindow = tw;
     }
     return TimeWindow.newInstance(0, Double.MAX_VALUE);
 }

and minTimeToOperate is always = Double.MAX_VALUE

If the method must return "TimeWindow.newInstance(0, Double.MAX_VALUE)" for each activity, it could be simplified to static final field,
or method must return timeWindow variable.?

private TimeWindow getLargestTimeWindow(Activity act) {
    TimeWindow timeWindow = null;
    for (TimeWindow tw : act.getTimeWindows()) {
        if (timeWindow == null) timeWindow = tw;
        else if (tw.larger(timeWindow)) timeWindow = tw;
    }
    if (timeWindow != null) {
        return timeWindow;
    }
    return TimeWindow.newInstance(0, Double.MAX_VALUE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant