choco-solver icon indicating copy to clipboard operation
choco-solver copied to clipboard

Composition of Search Strategy with different limit

Open bourreauEric opened this issue 7 years ago • 5 comments

Expected behavior

limit the first search strategy to 1 second in solve THEN use the second strategy (to improve the best so far solution)

Actual behavior

search.limit Monitor are attach to search and not strategy.

Minimal Working Example

Experienced with choco-solver-4.0.4

solv.setSearch( new AbstractStrategy[] { Search.intVarSearch(new MaxRegret(), new IntDomainMax(), X), Search.domOverWDegSearch(TableVariableCouleur)} ); solv.limitTime(1000);

can be

solv.setSearch( new AbstractStrategy[] { Search.intVarSearch(new MaxRegret(), new IntDomainMax(), X).limitTime(1000), Search.domOverWDegSearch(TableVariableCouleur).limitTime(10000} );

bourreauEric avatar Nov 16 '17 10:11 bourreauEric

good idea, can you do it?

jgFages avatar Nov 16 '17 11:11 jgFages

Hello, I would like to give this a try.

Is that ok?

fagossa avatar Jan 03 '18 16:01 fagossa

@fagossa that's perfectly ok

cprudhom avatar Jan 08 '18 08:01 cprudhom

If it's still open I would like to work on it. Just wich time limit should have priority in a case like this:

solv.setSearch(
new AbstractStrategy[] {
Search.intVarSearch(new MaxRegret(), new IntDomainMax(), X).limitTime(1000),
Search.domOverWDegSearch(TableVariableCouleur).limitTime(10000}
);
solv.limitTime(5000);

Xabibax avatar Jan 24 '24 08:01 Xabibax

I think that, for design reason, the global time limit should always have the priority. Each strategy will only be concerned by its own limit (time, nodes, failures, ...).

And thank you for proposing yourself on the PR.

cprudhom avatar Jan 24 '24 08:01 cprudhom