optaplanner | AI constraint solver in Java to optimize the vehicle routing problem, employee rostering, task assig

 by   kiegroup Java Version: 7.73.0.Final License: Apache-2.0

kandi X-RAY | optaplanner Summary

kandi X-RAY | optaplanner Summary

optaplanner is a Java library typically used in Financial Services, Banks, Payments applications. optaplanner has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.

It will save you and us a lot of time by setting up your development environment correctly. It solves all known pitfalls that can disrupt your development. It also describes all guidelines, tips and tricks. If you want your pull requests (or patches) to be merged into main, please respect those guidelines.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              optaplanner has a highly active ecosystem.
              It has 3069 star(s) with 923 fork(s). There are 157 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              optaplanner has no issues reported. There are 20 open pull requests and 0 closed requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of optaplanner is 7.73.0.Final

            kandi-Quality Quality

              optaplanner has 0 bugs and 0 code smells.

            kandi-Security Security

              optaplanner has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              optaplanner code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              optaplanner is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              optaplanner releases are not available. You will need to build from source code and install.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed optaplanner and discovered the below as its top functions. This is intended to give you an instant insight into optaplanner implemented functionality, and help decide if they suit your requirements.
            • Overrides superclass to override the weight of the constraint
            • Adds the soft constraint with the softScores
            • Append the multi constraint
            • Adds a soft - constraint with the soft - level constraint
            • Adjusts the weight of the constraint based on the constraint weight
            • Registers a hard - constraint with the hard - score constraint
            • Registers a soft - constraint with the soft - level constraint
            • Adds the multi - constraint constraint
            • Updates the given tuple
            • Evaluates the given constraint
            • Build a WeightedScoreImpact based on the given constraints
            • Computes the score of the given constraint
            • Builds the score operator
            • Update the right index
            • Builds the weighted score
            • Updates the right
            • Updates the left index properties of the given left tuple
            • Builds a WeightedScoreImpact with the given constraints
            • Updates the index properties
            • Calculate a WeightedScoreImpact for the given constraint
            • Builds a WeightedScoreImpact based on the given weight
            • Build a WeightedScoreImpact with the given weight
            • Sets the weight of the constraint
            • Builds a WeightedScoreImpact from the given constraint and the given constraint weight
            • Builds a WeightedScoreImpact with the given soft - constraint weight
            • Builds a WeightedScoreImpact based on the given constraint and the given weight
            Get all kandi verified functions for this library.

            optaplanner Key Features

            No Key Features are available at this moment for optaplanner.

            optaplanner Examples and Code Snippets

            copy iconCopy
            description: OptaPlanner optimizes business resource usage. It is a lightweight\\, embeddable\\, open source planning engine\\, written in 100% Java.
            

            Community Discussions

            QUESTION

            Custom "sumDouble()" function in OptaPlanner for constraints
            Asked 2022-Apr-11 at 11:36

            I need a sum functionality that sums up double values for my ConstraintProviding functionality. Currently OptaPlanner offers sum() and sumBigDecimal() functionality, where the first is only summing integer values and the second BigDecimal values. So therefore I started with the compose approach as described in the manual chapter 6.4.5.3. for implementing my own functionality (didn't want to override the original one).

            Deriving from there and taking the implementation of the sum functionality from the ConstraintCollector.java class of the OptaPlanner source code itself, I ended up with the following code:

            ...

            ANSWER

            Answered 2022-Apr-11 at 11:11

            Have you considered using a different type, e.g. long, to represent values you need to sum() in your constraint?

            Using floating-point numbers in the score calculation is generally not recommended as it may lead to score corruption.

            Source https://stackoverflow.com/questions/71825707

            QUESTION

            Is optaplanner scheduling AI suitable for optimising a college schedule?
            Asked 2022-Mar-23 at 14:39

            Optaplanner school timetabling examples show different problems than what I need to solve.

            The problem:

            Let's have three courses: Math, English, History

            All these courses offer multiple timeslots (parallels) and the student gets to choose one of them for each.

            Let's say:

            Math: Monday: 9:00 - 10:00, Tuesday: 10:00 - 11:00

            English: Monday: 9:00 - 10:00, Tuesday: 11:00 - 12:00, 14:00 - 15:00, Friday: 16:00 - 17:00

            History: Tuesday: 10:00 - 11:00, Friday: 10:00 - 11:00

            I would like to find the best possible timeslot for each of these courses. By the best I mean the one with the least amount of gaps and, more importantly, the one which lets you have the most free days.

            The optimal solution for the example problem might be something like

            Tuesday: Math: 9:00 - 10:00, History: 10:00 - 11:00, English: 11:00 - 12:00

            leaving no gap and simultaneously giving 4 free days.

            Is this possible with OptaPlanner or should I use a different solver? I noticed that the Lesson object only has a single TimeSlot instead of a list, which makes me think that this kind of timetable optimisation is not supported.

            ...

            ANSWER

            Answered 2022-Mar-23 at 14:39

            From the description, it appears your problem is "Student planning their own schedule" (whereas school timetabling is "Teachers planning the school timetable for all students").

            I would model it like this:

            Source https://stackoverflow.com/questions/71572097

            QUESTION

            OptaPlanner Benchmark config failing due to element namespace mismatch
            Asked 2022-Mar-21 at 07:26

            I'm trying to use the OptaPlanner Benchmarking module. My benchmark config file is being rejected due to the following error:

            ...

            ANSWER

            Answered 2022-Mar-21 at 07:26

            I think that you are passing the benchmark-config.xml to the wrong method; createFromSolverConfigXmlResource expects a solver-config.xml. It creates a basic benchmark from an existing solver configuration.

            In fact, the solver config is a subset of the benchmark config, but they have a separate XML namespace.

            Please take a look at the method createFromXmlResource, which expects the benchmark-config.xml.

            Source https://stackoverflow.com/questions/71550844

            QUESTION

            OptaPy Constraint to groupBy 2 variables for the same target
            Asked 2022-Mar-09 at 18:59

            I am trying to add a constraint_factory using OptaPy, the Python variant of OptaPlanner, (using the School Timetabling quickstart as a base) for scheduling sports matches. Each match has 2 teams, so there are 2 variables in the Match class : team1 and team2 along with a time_slot and pitch.

            How can I have a constraint where I can reward or penalise if a team (in either team1 or team2 variable) has been assigned more than 2 matches in a day?

            ...

            ANSWER

            Answered 2021-Dec-07 at 10:10

            I suggest to approach it differently. Start from Team, join with Match where either of the teams are equal, and count() that in a groupBy(). You will need to add a composite group key in that groupBy, your team and your match day.

            This is how such a constraint would look in Java, the native language of OptaPlanner:

            Source https://stackoverflow.com/questions/70249606

            QUESTION

            Optimisation algorithm, constraints and score calculation configurations with Optapy
            Asked 2022-Feb-24 at 07:21

            I am using the Optapy library in python, and I am using the school timetabling instance on GitHub as a base. I have few questions regarding the library configurations:

            • How do I choose the optimisation algorithm (e.g. tabu search or simulated annealing)?
            • How do Optapy calculate the score of a solution? Do I have the option to change the score calculation type in python?
            • How can I decide the weights for each constraint, except hard or soft constraint?

            I was looking at OptaPlanner User Guide, but I am not sure how to implement it on python.

            Guidance appreciated.

            ...

            ANSWER

            Answered 2022-Feb-23 at 14:57

            OptaPy can be configured using the programmatic API. The config classes can be found in the optapy.config package. In particular, you choose the optimisation algorithm via withPhases:

            Source https://stackoverflow.com/questions/71238147

            QUESTION

            How can I use multiple dynos for an Optaplanner process on Heroku?
            Asked 2022-Feb-15 at 20:07

            I'm running an Optaplanner application on Heroku with:

            ...

            ANSWER

            Answered 2022-Feb-15 at 20:07

            moveThreadCount refers to how many threads the solver will use on a single machine, and if set to AUTO, it will use as many cores as are available to the JVM with the upper bound of 4.

            OptaPlanner does not (yet) support horizontal scaling across the cloud. The orchestration for that would have to be hand-rolled.

            Source https://stackoverflow.com/questions/71130151

            QUESTION

            Optaplanner: How to get solver instance in Quarkus
            Asked 2022-Feb-14 at 13:07

            I am using Quarkus optaplanner, so instead of using SolverFactory to build a solver, I us ethe Quarkus way to inject a solverManager then let it solve the problem:

            ...

            ANSWER

            Answered 2022-Feb-14 at 12:25

            Yes, that is possible with SolverManager and you don't need to obtain a Solver instance.

            Use SolverManager.solverAndListen(problemId, problemFinder, bestSolutionConsumer). The third argument is a consumer where you can do whatever you want with each best solution that is found. It could look something like this in your case:

            Source https://stackoverflow.com/questions/71057029

            QUESTION

            Can I change OptaPlanner's logging level when using it as a local project dependency?
            Asked 2022-Jan-31 at 15:42

            I have a project in Eclipse which uses OptaPlanner (v8.12.0). I want to be able to write temporary debug statements within the OptaPlanner code itself, so I:

            1. cloned the repo,
            2. checked out branch 8.12.x,
            3. built using mvn,
            4. imported as a pre-existing Maven project optaplanner-core (again, Eclipse), and
            5. removed the optaplanner-core dependency from my Gradle dependencies

            Everything compiles and runs just fine, but OptaPlanner no longer responds to my log config changes.

            We're using Log4j2 and, when pulling OptaPlanner using the standard build process (Gradle), I can set the log level just fine using the Log4j2 config. But, with the src as a project dependency, it's not working.

            I have tried:

            • Including a local logback.xml
            • Adding adding as a vm arg: -Dlogging.level.org.optaplanner=trace
            • Adding adding as a vm arg: -Dlog4j.configurationFile=C:\path\to\log4j2.xml
            • Setting an environment variable LOGGING_CONFIG=C:\path\to\logback.xml
            • Setting the level programmatically using Configurator
            ...

            ANSWER

            Answered 2022-Jan-31 at 15:42

            OptaPlanner only has Logback as a scoped-to-test dependency.

            To get a local copy of OptaPlanner to pick up your log config, you need to (locally) add your logging dependency to the OptaPlanner buildpath.

            For me, this meant adding a Log4j2 dependency to the OptaPlanner pom.xml:

            Source https://stackoverflow.com/questions/70883799

            QUESTION

            Can I run a custom phase generating an initial solution several times to generate a pool of starting solutions?
            Asked 2022-Jan-31 at 11:19

            I’m using Optaplanner 8.15.0 to solve a variant of the redistricting problem: Geographic areas with an expected revenue are assembled to sales districts that must be contiguous and should be balanced and compact.

            The initial solution is generated by a custom phase using a greedy heuristic. Afterwards a local search hill climbing phase makes big and obvious improvements to that using custom moves. Only then, the “real” optimization starts with a tabu search.

            The configuration of the first two phases:

            ...

            ANSWER

            Answered 2022-Jan-31 at 11:15

            The answer is no, when the problem is specified like this. However, we could maybe change the problem statement a bit. If you run multiple independent solvers and, at the end, pick the best result, you can then pass that to a new solver which will start from there. This would be a variant of multi-bet solving. It is not supported out of the box, but would be relatively easy to code yourself, using either the Solver or SolverManager APIs.

            That said, your entire approach is very unconventional. Custom construction heuristic is understandable, as are custom moves. But the fact that you feel the need to separate the moves into different phases makes me curious. Have you benchmarked this to be the best possible approach?

            I would think that using the default local search (late acceptance), with your custom moves and our generic moves all thrown into the mix, would yield decent results already. If that fails to happen, then generally either your constraints need to be faster, or the solver needs to run for longer. For large problems, multi-threaded solving can help, too.

            Source https://stackoverflow.com/questions/70923394

            QUESTION

            Opraplanner uniform employees shifts planning
            Asked 2022-Jan-27 at 23:11

            I have a problem with planning employees shifts where employees are distributed uniformly (randomly) across the shifts.

            In my minimal example I use Spring boot, Lombock and Optaplanner spring boot starter (8.15.0.Final) package.

            My minimal example in one file:

            ...

            ANSWER

            Answered 2022-Jan-27 at 23:00

            You have no constraints. You have not told OptaPlanner what to optimize for, and therefore all solutions are equally favorable to OptaPlanner.

            (In fact, I am quite surprised that this code does not fail. A situation with no constraints should have thrown an exception.)

            Source https://stackoverflow.com/questions/70883516

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install optaplanner

            You can download it from GitHub, Maven.
            You can use optaplanner like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the optaplanner component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/kiegroup/optaplanner.git

          • CLI

            gh repo clone kiegroup/optaplanner

          • sshUrl

            git@github.com:kiegroup/optaplanner.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Java Libraries

            CS-Notes

            by CyC2018

            JavaGuide

            by Snailclimb

            LeetCodeAnimation

            by MisterBooo

            spring-boot

            by spring-projects

            Try Top Libraries by kiegroup

            drools

            by kiegroupJava

            jbpm

            by kiegroupJava

            kogito-runtimes

            by kiegroupJava

            droolsjbpm-integration

            by kiegroupJava