Skip to content

Composition of Search Strategy with different limit #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bourreauEric opened this issue Nov 16, 2017 · 5 comments
Open

Composition of Search Strategy with different limit #567

bourreauEric opened this issue Nov 16, 2017 · 5 comments

Comments

@bourreauEric
Copy link

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}
);

@jgFages
Copy link
Contributor

jgFages commented Nov 16, 2017

good idea, can you do it?

@fagossa
Copy link

fagossa commented Jan 3, 2018

Hello, I would like to give this a try.

Is that ok?

@cprudhom
Copy link
Member

cprudhom commented Jan 8, 2018

@fagossa that's perfectly ok

@Xabibax
Copy link

Xabibax commented Jan 24, 2024

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);

@cprudhom
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants