Feat: Allows specifying a weight function for individual ranges for the Connected Ranges collector

Open
#820 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start at the Connected Range collector and its toConnectedTemporalRanges entry point. Compare the current default weighting behavior with the proposed range-to-int weighting function, using the Job start, end, and required-forklift methods shown in the example. Done means callers can supply a per-range weight while the existing default behavior remains available.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
Sometimes a Job requires multiple of the same resource. For instance, a Job might require either 2 or 3 forklifts.
If there are a limited number of forklifts, then schedules where the number of required forklifts at any given time is over the limit is infeasible.

The Connected Range collector is useful when the Job will always require 1 forklift, but cannot handle cases where each Job require a different number of forklifts.

Describe the solution you'd like
The connected ranges collector takes an optional weighting function parameter from range to int (defaulting to range -> 1).
For instance,

toConnectedTemporalRanges(Job::getStart, Job::getEnd, Job::getRequiredForkliftCount)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Dominant language
Java
Stars
1.8k
Forks
228
Avg merge
1d 13h
Merged PRs (30d)
46

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TimefoldAI/timefold-solver

All issues in TimefoldAI/timefold-solver

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.