Release 2.3.3 of April-2025

This is a minor release that slightly improves API for posting constraints with certain probabilities. JSR-331 supports the concept “Probability” with the following standard values:

NEVER(0),
VERY_LOW(10),
LOW(25),
BELOW_MID(35),
MID(50),
ABOVE_MID(60),
HIGH(75),
VERY_HIGH(90),
ALWAYS(100);

The Constraint’s method public void post(String name, Probability probability) is used to post a constraint assuming that it can be violated.  The parameter probability defines a probability (a relative importance) of this constraint. The probability ALWAYS means that this is a regular “hard” constraint that cannot be violated. The probability NEVER means that this constraint never can be satisfied but its opposite constraint should be satisfied. For example, if you create a constraint “x =5” and post it with probability NEVER, it means that its negation “x != 5” should be satisfied.

All other probability values allow the constraint to be violated with certain penalties. For instance, probability MID invokes a higher penalty to compare with probability LOW, but a lower penalty to compare with HIGH.

The Problem’s method getTotalConstraintViolation() returns a variable that could be minimized to find a solution that may all synchronize all relative constraint violations. Thus, posting related constraints with different probabilities may resolve their conflicts.