TimefoldAI / TimefoldAI/timefold-solver
Filters for KOptListMove don't work yet?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 228
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 46
Description
Hello.
Describe the bug
After you made KOptListMove public, I tried to create trivial filter for it, but it didn't work. https://stackoverflow.com/questions/77619677/timefold-is-it-possible-to-filter-out-all-trivial-2opt-moves-for-planninglistva.
public class KOptFilter implements SelectionFilter<Table, KOptListMove> {
@Override
public boolean accept(ScoreDirector<Table> scoreDirector, KOptListMove kOptListMove) {
System.out.println(kOptListMove.getSimpleMoveTypeDescription() +" "+kOptListMove.getPlanningEntities().size()+" "+kOptListMove.getPlanningValues().size());
System.out.println(kOptListMove);
return true;
}
}
Expected behavior
I expected some information in log, which would help me to understand, how filter out moves with firstEndpointIndex == secondEndpointIndex + 1
Actual behavior
But I haven't got any information in log. Instead I've got warning messages:
2024-01-16 11:26:26,118 WARN [ai.tim.sol.cor.imp.heu.sel.mov.dec.FilteringMoveSelector] (pool-7-thread-1) Bailing out of neverEnding selector (Filtering(ai.timefold.solver.core.impl.heuristic.selector.move.generic.list.kopt.KOptListMoveSelector@4b8a1b5)) after (0) attempts to avoid infinite loop.
And looks like k-opt moves weren't accepted at all. I couldn't find any "firstEndpointIndex" in log.
To Reproduce
Create any filter for KOptListMove
Environment
Timefold Solver Version or Git ref:
1.6.0
Output of java -version:
java version "21" 2023-09-19 LTS
Java(TM) SE Runtime Environment (build 21+35-LTS-2513)
Java HotSpot(TM) 64-Bit Server VM (build 21+35-LTS-2513, mixed mode, sharing)
Output of uname -a or ver:
Microsoft Windows [Version 10.0.22621.3007]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported filter with KOptListMove and inspect the KOptListMoveSelector and FilteringMoveSelector behavior described in the warning. Check why the filter receives no moves and why the never-ending selector bails out after zero attempts. Done means a KOptListMove filter is invoked and can identify or reject the reported trivial moves without the selector warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100