JBoss.orgCommunity Documentation

Drools Planner User Guide

Version 5.4.0.Beta2


1. Planner introduction
1.1. What is Drools Planner?
1.2. What is a planning problem?
1.2.1. A planning problem is NP-complete
1.2.2. A planning problem has (hard and soft) constraints
1.2.3. A planning problem has a huge search space
1.3. Status of Drools Planner
1.4. Get Drools Planner and run the examples
1.4.1. Get the release zip and run the examples
1.4.2. Run the examples in an IDE (IntelliJ, Eclipse, NetBeans)
1.4.3. Use it with maven, gradle, ivy, buildr or ANT
1.4.4. Build it from source
1.5. Questions, issues and blog
2. Use cases and examples
2.1. Introduction
2.2. N queens example
2.2.1. Problem statement
2.2.2. Solution(s)
2.2.3. Screenshot
2.2.4. Problem size
2.2.5. Domain model
2.3. Cloud balancing example
2.3.1. Problem statement
2.3.2. Domain model
2.4. Machine reassignment example (ROADEF 2012)
2.4.1. Problem statement
2.4.2. Problem size
2.5. Manners 2009 example
2.5.1. Problem statement
2.6. Traveling Salesman Problem example (TSP)
2.6.1. Problem statement
2.7. Traveling Tournament Problem example (TTP)
2.7.1. Problem statement
2.7.2. Simple and smart implementation
2.7.3. Problem size
2.8. Curriculum course scheduling example (ITC 2007 track 3)
2.8.1. Problem statement
2.9. Examination timetabling example (ITC 2007 track 1)
2.9.1. Problem statement
2.9.2. Problem size
2.9.3. Domain model
2.10. Patient admission scheduling (hospital bed planning) example (PAS)
2.10.1. Problem statement
2.11. Nurse rostering example (INRC 2010)
2.11.1. Problem statement
3. Planner configuration
3.1. Overview
3.2. Solver configuration
3.2.1. Solver configuration by XML file
3.2.2. Solver configuration by Java API
3.3. Model your planning problem
3.3.1. Is this class a problem fact or planning entity?
3.3.2. Problem fact
3.3.3. Planning entity and planning variables
3.3.4. Planning value and planning value ranges
3.3.5. Planning problem and planning solution
3.4. Solver
3.4.1. The Solver interface
3.4.2. Solving a problem
3.4.3. Environment mode: Are there bugs in my code?
3.4.4. Logging level: What is the Solver doing?
4. Score calculation with a rule engine
4.1. Rule based score calculation
4.2. Choosing a Score implementation
4.2.1. The ScoreDefinition interface
4.2.2. SimpleScore
4.2.3. HardAndSoftScore
4.2.4. Implementing a custom Score
4.3. Defining the score rules source
4.3.1. A scoreDrl resource on the classpath
4.3.2. A RuleBase (possibly defined by Guvnor)
4.4. Implementing a score rule
4.5. Aggregating the score rules into the Score
4.6. Delta based score calculation
4.7. Tips and tricks
5. Optimization algorithms
5.1. The size of real world problems
5.2. The secret sauce of Drools Planner
5.3. Optimization algorithms overview
5.4. Which optimization algorithms should I use?
5.5. SolverPhase
5.6. Termination
5.6.1. TimeMillisSpendTermination
5.6.2. ScoreAttainedTermination
5.6.3. StepCountTermination
5.6.4. UnimprovedStepCountTermination
5.6.5. Combining Terminations
5.6.6. Asynchronous termination from another thread
5.7. SolverEventListener
5.8. Custom SolverPhase
6. Exact methods
6.1. Overview
6.2. Brute Force
6.2.1. Algorithm description
6.2.2. Configuration
6.3. Branch and bound
6.3.1. Algorithm description
6.3.2. Configuration
7. Construction heuristics
7.1. Overview
7.2. First Fit
7.2.1. Algorithm description
7.2.2. Configuration
7.3. First Fit Decreasing
7.3.1. Algorithm description
7.3.2. Configuration
7.4. Best Fit
7.4.1. Algorithm description
7.4.2. Configuration
7.5. Best Fit Decreasing
7.5.1. Algorithm description
7.5.2. Configuration
7.6. Cheapest insertion
7.6.1. Algorithm description
7.6.2. Configuration
8. Local search solver
8.1. Overview
8.2. Hill climbing (simple local search)
8.2.1. Algorithm description
8.3. Tabu search
8.3.1. Algorithm description
8.4. Simulated annealing
8.4.1. Algorithm description
8.5. About neighborhoods, moves and steps
8.5.1. A move
8.5.2. Move generation
8.5.3. Generic MoveFactory
8.5.4. A step
8.5.5. Getting stuck in local optima
8.6. Deciding the next step
8.6.1. Selector
8.6.2. Acceptor
8.6.3. Forager
8.7. Using a custom Selector, Acceptor, Forager or Termination
9. Evolutionary algorithms
9.1. Overview
9.2. Evolutionary Strategies
9.3. Genetic algorithms
10. Benchmarking and tweaking
10.1. Finding the best configuration
10.2. Building a benchmarker
10.2.1. Adding the extra dependency
10.2.2. Building a PlannerBenchmark
10.2.3. ProblemIO: input and output of Solution files
10.2.4. Warming up the hotspot compiler
10.3. Summary statistics
10.3.1. Best score summary
10.4. Statistics per data set (graph and CSV)
10.4.1. Best score over time statistic (graph and CSV)
10.4.2. Calculate count per second statistic (graph and CSV)
10.4.3. Memory use statistic (graph and CSV)
11. Repeated planning
11.1. Introduction to repeated planning
11.2. Backup planning
11.3. Continuous planning (windowed planning)
11.4. Real-time planning (event based planning)
Index