Skip to content

Conversation

@ArthurGodet
Copy link
Collaborator

No description provided.

@ArthurGodet ArthurGodet requested a review from cprudhom October 9, 2023 18:43
manageModifications();
for (int i = nextNotEmpty(); i > -1; i = nextNotEmpty()) {
assert !pro_queue[i].isEmpty() : "try to pop a propagator from an empty queue";
if (model.getSolver().isTimeLimitMet()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not calling model.getSolver().isStopCriterionMet() ?
This would avoid modifying the Solver class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to have a simple check on the time limit, and not check all the stopping criterion before the propagation of each propagator.
Indeed, all stopping criterion but the time limit do not depend on the problem's state outside of fixpoint. Unless you can think of one that would.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personnaly, I would have move the code to the end of the while-loop just to keep the main purpose (ie, propagating) clear

boolean solved = solver.solve();
long took = System.currentTimeMillis() - start;

assertFalse(solved);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to check that solve() returns false;

manageModifications();
for (int i = nextNotEmpty(); i > -1; i = nextNotEmpty()) {
assert !pro_queue[i].isEmpty() : "try to pop a propagator from an empty queue";
if (model.getSolver().isTimeLimitMet()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personnaly, I would have move the code to the end of the while-loop just to keep the main purpose (ie, propagating) clear

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.

4 participants