Questions tagged [optaplanner]

OptaPlanner is a lightweight, embeddable planning engine written in Java. It helps normal Java programmers solve constraint satisfaction problems efficiently. Under the hood, it combines optimization heuristics and metaheuristics with very efficient score calculation.

OptaPlanner is a Artificial Intelligence planning engine written in Java. It works in Kotlin and Scala too. It integrates with Quarkus and Spring Boot. It helps normal programmers solve constraint solving problems efficiently. Under the hood, it combines optimization heuristics and metaheuristics with incremental score calculation.

Typical use cases include the vehicle routing problem, maintenance scheduling, employee rostering, task assignment and school timetabling.

OptaPlanner is open source software, released under the Apache Software License. It is 100% pure Java, runs on any JVM and is available in the Maven Central Repository too.

1619 questions
4
votes
1 answer

Modeling lunch breaks and additional depot returns in Optaplanner

we are using optaplanner to try to improve our current vehicle routes with time windows. We have a few smaller issues which we are not sure how to overcome: Our drivers need to have to have a 30 minutes lunch break, somewhere between 3rd and 5th…
kodo
  • 55
  • 1
  • 7
4
votes
1 answer

Must an InverseRelationShadowVariable necessarily belong to a planningEntity?

I have been trying to implement a shadow variable so that one of my problem facts can keep track of which planning entity is relevant to it, the end goal being to simplify/speed up my rules. I am looking at the optaplanner doc about shadow…
asachet
  • 6,620
  • 2
  • 30
  • 74
4
votes
1 answer

Custom VariableListener updating more than one shadow variables

I am reading in the documentation about shadow variables and custom variable listeners and i was wondering if i am on the right track in understanding how they work. Copied from the OptaPlanner Documentation in section 4.3.6.4. "Custom…
4
votes
1 answer

OptaPlanner - A planning entity is an instance of an entitySubclass (class java.lang.Integer) that is not configured as a planning entity.

I have been trying to implement a custom Construction Heuristic in Optaplanner on a problem similar to the Nurse Rostering one. Everything seems to be annotated correctly, and is added to the SolverConfiguration, but i keep getting this…
Nikola Atanasov
  • 605
  • 1
  • 4
  • 11
4
votes
3 answers

OptaPlanner's Drools rules don't fire with Spring Boot's devtools on the classpath so the score is zero

I got optaplanner working correctly with drools rules. "Suddenly", after some change I did, Optaplanner does not put my facts in the drools kSession anymore. I put some logging, and I see that optaplanner calls the getProblemFacts() method on my…
Gaël Oberson
  • 603
  • 1
  • 5
  • 14
4
votes
1 answer

OptaPlanner deploy multiple vehicles to same location

I have taken OptaPlanner VRP web example and customized it to my needs. It is working fine except in the below scenario: Number of vehicles available : 2. Each vehicle capacity is 6. And customer demand is 7. In the above scenario, OptaPlanner is…
Chandra Manthina
  • 147
  • 1
  • 4
  • 13
4
votes
0 answers

Optaplanner: Multi-Depot VRP with TimeWindow and multiple pickup and delivery

I am working on a variant of a VRP and looking to solve it using Optaplanner. I have a shipping company that has list of all jobs that needs to be fulfilled for the next day (so the demand is generated at least a day earlier). This company has…
4
votes
1 answer

Returning multiple solutions to a scheduling issue with optaplanner

strong textHello Optaplanner experts, I am pretty new to OptaPlanner, so please pardon any naive or basic questions. I am using it to schedule a: set of jobs, A, B and C, which can be completed by 5 resources, say Will, Jane, Roy, Tom, Jeff. Each…
Alice
  • 390
  • 2
  • 5
  • 19
4
votes
1 answer

I am getting 'Local Search phase started with an uninitialized Solution' when I run on a larger dataset

I am developing a solver using Optaplanner 6.1.0, similar to the Vehicle Routing Problem. When I run my solver on 700 installers and 200 bookings, it will successfully solve the planning problem. But, when I used against a larger dataset (700…
Pejal Hebat
  • 116
  • 6
4
votes
2 answers

Optaplanner: Evaluate solution

I am currently working on a Java project that uses Optaplanner and drools for a Constraint Satisfaction problem. The solving works fine. But after the solver has given me a solution, I want to evaluate the solution: I want to know which…
Pieter Meiresone
  • 1,910
  • 1
  • 22
  • 22
4
votes
2 answers

Bicycle messenger / TSPPD with OptaPlanner

Dear OptaPlanner experts! I would like to use OptaPlanner (or a similar Open Source Java Framework) to optimize routes for a bicycle messenger service. Let's assume 5 messengers have to pick up 30 envelopes FROM a certain origin and deliver them TO…
user2828726
  • 59
  • 1
  • 4
3
votes
1 answer

Unexpected behavior when switching to BAVET for entity with nullable planning variable

OptaPlanner 8.36.0.Final When using ConstraintStreamImplType.DROOLS the following constraint behaves as expected: return constraintFactory .forEach(Ewe.class) .groupBy(ConstraintCollectors.count()) .penalize(level, (count) -> { …
Steven
  • 33
  • 4
3
votes
2 answers

ConstraintConfiguration not used by ConstraintVerifier in testing class?

I am currently working with dynamic weights configured in a ConstraintConfiguration class. But the class doesn't seem to be used while executing my tests that I wrote. It is however used while actually executing the solver. For example: one of the…
kwaki
  • 33
  • 3
3
votes
2 answers

Optaplanner - drools file cannot be compiled when project is deployed

We developped a SpringBoot project with Java 11 using optaplanner-core and defining rules in a Drools file. We have no issue for running the app in intelliJ with JDK. We then deployed the app onto Azure app service where a JRE is installed. We get…
axellerdp
  • 31
  • 1
3
votes
0 answers

Optaplanner custom phase command fails in native build, can't find generated Gizmo supplier

Using Optaplanner 8.6.0.Final, Quarkus 1.13.4.Final I have built a custom phase using the CustomPhaseCommand interface: @RegisterForReflection public class InitPhase implements CustomPhaseCommand { ... } It is configured like this in…
Magnus Våge
  • 305
  • 3
  • 12