OptaPy is an AI constraint solver for Python to optimize planning and scheduling problems.
Upgraded to OptaPlanner 9.37.0.Final. Despite being a updated major version of OptaPlanner, the vast majority of OptaPy users are unaffected (unless you use your own Java jars with javax dependencies).
Fixes:
Add support for Python 3.11 for jpyinterpreter
, significantly improving Python 3.11 score calculation speeds.
Also optimize how calls are done in the interpreter, which can provide a modest improvement to score calculation speeds for some constraints.
Add the ConstraintVerifier API to allow testing of constraints. See https://www.optapy.org/docs/latest/constraint-streams/constraint-streams.html#constraintStreamsTesting for details.
This is the first release of optapy
that includes jpyinterpreter
, a module created to translate Python function bytecode to equivalent Java bytecode to massively increase performance by avoiding Foreign Function Interface (FFI) calls. You don't need to do anything in order to use it; it is on by default. Functions and classes that cannot be translated will be proxied to their CPython functions and types.
Bug fixes:
solve
and solveAndListen
will now show exceptionsDependency Upgrades:
JPype1 upgraded to 1.4.0, which fixes ambiguity errors when dealing with overloaded methods
New Features:
@custom_shadow_variable
and @variable_listener
, which can be used to create a custom shadow variable that changes when a geninue @planning_variable
(or another shadow variable) changes.tuple
and set
collections, and collections that extend the collection.abc
abstract base classesNew Features:
solver_config_create_from_xml_file(pathlib.Path)
logging
Fixed Bugs:
@planning_list_variable
, which can be used to model variables as an ordered disjoint set (for example, the customers to visit in vehicle routing).@problem_change
, which allows changing the problem during solving.@easy_score_calculator
decorator@incremental_score_calculator
decoratoroptapy.types