Skip to content

feat: enable entity value range for list variables#1671

Merged
triceo merged 39 commits into
TimefoldAI:mainfrom
zepfred:feat/value-range
Jul 22, 2025
Merged

feat: enable entity value range for list variables#1671
triceo merged 39 commits into
TimefoldAI:mainfrom
zepfred:feat/value-range

Conversation

@zepfred

@zepfred zepfred commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces the ability to define value ranges for list variables in the entities. The proposed approach in the CH phase involves creating a new descriptor and selector that can read all values from the entities, serving as a single source of truth. This unique list of elements is required for the queued value placer to function correctly. Additinaly, a new cache tier for value range elements is proposed to enable faster access to value ranges values.

For the LS phase, the proposed changes follow the same strategy used for basic variables, generating valid and invalid moves through the respective move generators. However, the logic for list moves in isMoveDoable has been updated to ensure that moves are valid when using entity value ranges. This approach makes the logic simpler and more performant in some cases, as generating only valid moves would require more complex changes than just ensuring it is doable.

Comment thread core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java Outdated
Comment thread core/src/main/java/ai/timefold/solver/core/config/util/ConfigUtils.java Outdated
Comment thread core/src/main/java/ai/timefold/solver/core/impl/heuristic/move/AbstractMove.java Outdated
@triceo

triceo commented Jul 4, 2025

Copy link
Copy Markdown
Collaborator

In general, I would like to see the same principle being applied to value ranges on entity for both list var and basic var. It is the same principle, and there should be the same subsystem handling both in the solver.

I know that in one case, we need to enumerate entities, and in the other, we need to enumerate values. But the value ranges need to be cached and accessed anyway, and those caches need to be selected from. Right now, we work around it by keeping the old system around, but for list var we bring a system which doesn't care if it's being entity-dependent or not.

In my opinion, it's time to bring this aspect of list and basic vars under the same roof.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
65.2% Coverage on New Code (required ��� 70%)

See analysis details on SonarQube Cloud

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

Successfully merging this pull request may close these issues.

3 participants