return constraintFactory.from(ProductPrice.class)
.groupBy(min(), max(), sum())
.penalize(..., SimpleScore.ONE, (minPrice, maxPrice, sumPrices) -> ...);
We are happy to announce a 8 Final release of OptaPlanner. OptaPlanner is a lightweight, embeddable planning engine written in Java™ to solve AI constraint optimization problems efficiently. Use cases include Vehicle Routing, Employee Rostering, Maintenance Scheduling, Task Assignment, School Timetabling, Cloud Optimization, Conference Scheduling and many more.
The RHDM version differs from the OptaPlanner version:
RHDM version | OptaPlanner version |
---|---|
7.7 | 7.33 |
7.8 | 7.39 |
7.9 | 7.44 |
To empower OptaPlanner on the latest technologies and facilitate new features (see below), OptaPlanner can’t remain 100% backwards compatible. Therefore, following Apache version guidelines, the major version number increments. OptaPlanner 8 removes the deprecated methods from OptaPlanner 7 and makes a few minor backwards incompatible changes. Upgrading your code from 7 to 8 is easy and quick. Just follow the instructions in the upgrade recipe.
As usual, Red Hat offers enterprise support and consulting on OptaPlanner 8, with the Red Hat build of OptaPlanner in an upcoming release of Red Hat Decision Manager 7 in the first half of 2021.
The default implementation of the Constraint Streams API has seen major performance improvements. Use cases with tri and quad streams may experience order of magnitude speedups. Use cases with grouping are likely to experience some speedups too, albeit comparatively smaller.
Kudos to the Drools team for helping make this possible!
groupBy()
overloads for multiple collectorsThe Constraint Streams API has been extended to allow using more than 2 collectors in a single grouping. The following is now possible:
return constraintFactory.from(ProductPrice.class)
.groupBy(min(), max(), sum())
.penalize(..., SimpleScore.ONE, (minPrice, maxPrice, sumPrices) -> ...);
The new OptaPlanner Quickstarts repository contains pretty web demos for several use cases. It also shows you how to integrate OptaPlanner with different technologies:
School timetabling: Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.
This application connects to a relational database and exposes a REST API, rendered by a pretty JavaScript UI.
quarkus-school-timetabling
: Java, Maven or Gradle, Quarkus, H2
spring-boot-school-timetabling
: Java, Maven or Gradle, Spring Boot, H2
kotlin-quarkus-school-timetabling
: Kotlin, Maven, Quarkus, H2
Facility location problem (FLP): Pick the best geographical locations for new stores, distribution centers, covid test centers or telco masts.
quarkus-facility-location
: Java, Maven, Quarkus
Factorio layout: Assign machines to assembly line locations to design the best factory layout.
quarkus-factorio-layout
: Java, Maven, Quarkus
Maintenance scheduling: Coming soon
The OptaPlanner 8 API has been groomed to maximize compatibility with the latest OpenJDK and GraalVM releases and game-changing platforms such as Quarkus. Meanwhile, we still fully support OpenJDK 11 and platforms such as Spring Boot or plain Java.
For example, when running OptaPlanner in Java 11 or higher with a classpath,
OptaPlanner no longer triggers WARNING: An illegal reflective access operation has occurred
for XStream.
To validate XML configuration during development, add the new XML Schema Definition (XSD) on the solver or benchmark configuration:
<?xml version="1.0" encoding="UTF-8"?>
<solver xmlns="https://www.optaplanner.org/xsd/solver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.optaplanner.org/xsd/solver https://www.optaplanner.org/xsd/solver/solver.xsd">
...
</solver>
This enables code completion for XML in most IDEs:
The OptaPlanner Quarkus extension is now stable and displays no warnings when compiling Java to a native executable.
The ScoreManager
can now also explain why a solution has a certain score:
ScoreManager<TimeTable, HardSoftScore> scoreManager = ScoreManager.create(solverFactory);
...
ScoreExplanation<TimeTable, HardSoftScore> scoreExplanation = scoreManager.explain(timeTable);
System.out.println(scoreExplanation.getSummary());
...
Additionally, use scoreExplanation.getConstraintMatchTotalMap()
and scoreExplanation.getIndictmentMap()
to extract the ConstraintMatchTotal<HardSoftScore>
and Indictment<HardSoftScore>
information without triggering a new score calculation.
The ConstraintStreams API is now richer, more stable with better error messages and faster.
The SolverManager
API now supports to listen to both best solution events and the solving ended event.
OptaPlanner no longer depends on Guava or Reflections.
The best and easiest way to upgrade to this new version of OptaPlanner is by following the upgrade recipe.
Read the previous release notes to learn about the new and noteworthy in previous releases.
Want to talk to the experts? Red Hat offers certified binaries with enterprise consulting. Contact optaplanner-info for more information.
Comments
Visit our forum to comment