I have a use case where I want to assign a salesperson to a list of appointments. Now, these salespeople have to travel from one point to another to reach the appointment location. I am using Optaplanner to schedule a list of salespersons for a bunch of appointments.
I have multiple constraints. Currently, I have implemented two constraints.
1. Sales rep work timing constraint.
2. A sales rep can accommodate at most one appointment at the same time.
Currently, when I ran these constraints individually it works fine and assigns correctly. However, when I add all the constraints and run the program, it is assigning some sales rep incorrectly. Even though some constraints are penalized but still OP selects the incorrect ones maybe it finds the best score among the penalized values.
Is there a way to completely reject a solution if we find any constraint(among multiples) violated?
For example, always choose a positive score and reject if a score has at least one negative value.
(5hard/3medium/2soft) > (1hard/0medium/0soft) but reject (6hard/-1medium/0soft)
Reject: 100hard/0medium/-1soft
Even if anyone score is negative then reject and only accept a score if it has all positive values.