Hi!
Thank for the fast reply.
Unfortunately, I think I'm missing some steps. The use case is very simple because I have two shifts (one 09-13 the other 14-18) and three employees. Only two of these have the right skills and both have a contract that cannot exceed 4 hours per day, so the best solution is to assign one shift each. Performing the solve I receive the following output
2023-01-26 15:59:36,895 INFO [org.opt.cor.imp.sol.DefaultSolver] (pool-145-thread-1) Solving started: time spent (3), best score (0hard/-2medium/0soft), environment mode (FULL_ASSERT), move thread count (NONE), random (JDK with seed 0).
2023-01-26 15:59:36,918 INFO [org.opt.cor.imp.con.DefaultConstructionHeuristicPhase] (pool-145-thread-1) Construction Heuristic phase (0) ended: time spent (26), best score (0hard/0medium/0soft), score calculation speed (1863/sec), step total (2).
2023-01-26 15:59:46,918 INFO [org.opt.cor.imp.loc.DefaultLocalSearchPhase] (pool-145-thread-1) Local Search phase (1) ended: time spent (10026), best score (0hard/0medium/0soft), score calculation speed (3072/sec), step total (3715).
2023-01-26 15:59:46,918 INFO [org.opt.cor.imp.sol.DefaultSolver] (pool-145-thread-1) Solving ended: time spent (10026), best score (0hard/0medium/0soft), score calculation speed (3068/sec), phase total (2), environment mode (FULL_ASSERT), move thread count (NONE).
So basically it seems that from Optaplanner pov it can find the right solution (0/0/0) but in mongo I just see the two shifts assigned to the same employee (hence breaking the rule of the maximum contract daily). If I try to perform the solve again, I obtain this
2023-01-26 16:02:56,364 INFO [org.opt.cor.imp.sol.DefaultSolver] (pool-145-thread-4) Solving started: time spent (2), best score (-180hard/0medium/0soft), environment mode (FULL_ASSERT), move thread count (NONE), random (JDK with seed 0).
2023-01-26 16:02:56,365 INFO [org.opt.cor.imp.con.DefaultConstructionHeuristicPhase] (pool-145-thread-4) Construction Heuristic phase (0) ended: time spent (3), best score (-180hard/0medium/0soft), score calculation speed (1000/sec), step total (0).
2023-01-26 16:03:06,371 INFO [org.opt.cor.imp.loc.DefaultLocalSearchPhase] (pool-145-thread-4) Local Search phase (1) ended: time spent (10009), best score (0hard/-1medium/0soft), score calculation speed (3002/sec), step total (4406).
2023-01-26 16:03:06,371 INFO [org.opt.cor.imp.sol.DefaultSolver] (pool-145-thread-4) Solving ended: time spent (10009), best score (0hard/-1medium/0soft), score calculation speed (3001/sec), phase total (2), environment mode (FULL_ASSERT), move thread count (NONE).
How can I use the FULL_ASSERT to check if there is something wrong?
THank you