Christopher Chianelli
Christopher Chianelli
Then it is definitely the performance of the constraints that is causing the issue. `7/sec` is extremely low. You need to rewrite your constraints to improve performance. Looking at shapely,...
This is complicated, since we don't actually use a Python logger, but a Java logger which our Python logger acts as a wrapper for: https://github.com/optapy/optapy/blob/3c35ef7600e327586e69e459e60894c22be7bf5e/optapy-core/src/main/python/optaplanner_python_logger.py#L6-L37 Having the Java logger call...
Sounds like a bug. From the stack trace, I am guessing what happening is `ScoreManager.explainScore` is rewrapping an already wrapped problem. Wrapping is the process of converting a CPython object...
@ge0ffrey Nope; it was fixed in `timefold-solver-python`.
You need to import `ConstraintCollectors` from `optapy.constraint` and use `ConstraintCollectors` to get the collector. For instance: ```python from optapy.constraint import ConstraintCollectors def each_user_name_must_have_at_least_two_appointments(constraint_factory: ConstraintFactory): return ( constraint_factory.for_each(User) .group_by(lambda user: user.week_num,...
That look like it should work (translating into english, the constraint you written should be equivalent to "penalize having more than one appointment per (user.week_num, user.name) pair by 1 hard")....
In fact, we do that, see https://github.com/optapy/optapy/blob/3c35ef7600e327586e69e459e60894c22be7bf5e/jpyinterpreter/tests/test_functions.py#L266-L286 and https://github.com/optapy/optapy/blob/3c35ef7600e327586e69e459e60894c22be7bf5e/jpyinterpreter/src/main/python/python_to_java_bytecode_translator.py#L227-L300. I suspect it falls through because of https://github.com/optapy/optapy/blob/3c35ef7600e327586e69e459e60894c22be7bf5e/jpyinterpreter/src/main/python/python_to_java_bytecode_translator.py#L1220-L1224 , which is not wrapped in a `try...except` (and hence why it is...
The error situation can definitely improve. I am planning in the future to return a `CompliationResult` instead of the raw Java class. The `CompliationResult` would have fields for errors and...
You probably could use CUDA in an `@easy_score_calculator` (https://www.optapy.org/docs/latest/score-calculation/score-calculation.html#easyPythonScoreCalculation), but then there will be frequent transfers between CPython and Java, which will probably eat all possible performance gains (and then...
That depends: by input parameters, are you talking about different problems or different SolverConfig? If it for different problems (with the same SolverConfig), then that the purpose of `SolverManager`; you...