mahf-opt/mahf

Rename termination criterions such that it is obvious when they terminate

Closed this issue · 3 comments

For example, the combined termination criterion

.while_(termination::FixedIterations::new(500) & termination::DistanceToOpt::new(0.01), ...),

could be read as "terminate when 500 iterations are reached and the best objective value found is within 0.01 of the optimum", which would mean the algorithm doesn't terminate until both conditions are true.

What this actually means is that the algorithm terminates when either 500 iterations are reached or the distance to the optimum is less than 0.01.

We should remove the implicit negation in termination criterions so it is readable in a while expression, for example IterationsBelow and DistanceToOptAbove instead FixedIterations and DistanceToOpt:

.while_(termination::IterationsBelow::new(500) & termination::DistanceToOptAbove::new(0.01), ...),

I was also thinking about this, and maybe it would be best to abolish the concept of "termination" and just make them normal conditions. The "termination" terminology is really just a relic of the first versions of MAHF and I don't think it makes sense anymore.

I would be okay with that. We can omit the "termination" term and just use a condition.

Well, FixedIterations and such are already simply Conditions, it's just that their name is not really clear. The only thing that makes them "termination criterions" is that they are located in the conditions::termination module, and that's fine I think because termination is an important concept here.

Or what exactly did you think of, @luleyleo?