TimefoldAI / TimefoldAI/timefold-solver

feat: allow sourcing of declarative variables on values inside @PlanningListVariable and @InverseRelationShadowVariable

Open
#2,009 0 comments 0 reactions 1 assignee View on GitHub

@Christopher-Chianelli is already working on this.

Since Jan 9, 2026.

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

Description

Is your feature request related to a problem? Please describe.
Currently the following is invalid to do since a variable cannot be used as a group source:

@PlanningListVariable
List<Value> values;

@ShadowSources("values[].declarativeVariable")
public Integer maxDeclarativeVariableSupplier() {
    return values.stream().map(Value::getDeclarativeVariable).max(Comparator.naturalOrder()).orElse(null);
} 

Describe the solution you'd like
@PlanningListVariable and @InverseRelationShadowVariable should be able to be used as a group source.

Describe alternatives you've considered
Calling the method inside a constraint (although that loses caching).

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.