此内容没有您所选择的语言版本。
Chapter 1. Business Resource Planner Introduction
1.1. What is Business Resource Planner 复制链接链接已复制到粘贴板!
Business Resource Planner is a lightweight, embeddable planning engine that optimizes planning problems. It helps normal Java™ programmers solve planning problems efficiently, and it combines optimization heuristics and metaheuristics with very efficient score calculations.
Business Resource Planner helps solve various use cases like the following:
- Employee/Patient Rosters. It helps create timetables for nurses and keeps track of patient bed management.
- Educational Timetables. It helps schedule lessons, courses, exams, and conference presentations.
- Shop Schedules: It tracks car assembly lines, machine queue planning, and workforce task planning.
- Cutting Stock: It minimizes waste by reducing the consumption of resources such as paper and steel.
Every organization faces planning problems; that is, they provide products and services with a limited set of constrained resources (employees, assets, time, and money).
Figure 1.1. Use Case Overview
Business Resource Planner is open source software under the Apache Software License 2.0. It is 100% pure Java™ and runs on any Java virtual machine.
1.2. Download Business Resource Planner 复制链接链接已复制到粘贴板!
Business Resource Planner is production ready. The API is stable but backward incompatible changes can occur. With the recipe called UpgradeFromPreviousVersionRecipe.txt, you can easily upgrade to a newer version and quickly deal with any backwards incompatible changes. This recipe file is included in every release.
Procedure: Get the release ZIP and run the examples
- Navigate to the Red Hat Customer Portal and log in with your user credentials.
-
Select Downloads
Red Hat JBoss Middleware Download Software. - From the Products drop-down menu, select BPM Suite or BRMS Platform.
- From the Version drop-down menu, select the product version 6.4.
- Select the Standalone or Deployable file and then click download.
- Unzip the files.
Open the directory
examples
and run the following script:Linux or Mac:
cd examples ./runExamples.sh
$ cd examples $ ./runExamples.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Windows:
cd examples runExamples.bat
$ cd examples $ runExamples.bat
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Figure 1.2. Download Business Resource Planner
The Examples GUI application will open. Just pick an example:
Business Resource Planner itself has no GUI dependencies. It runs just as well on a server or a mobile JVM as it does on the desktop.
1.3. Run the Examples 复制链接链接已复制到粘贴板!
Procedure: To run the examples in your favorite IDE:
Configure your IDE:
-
In IntelliJ and NetBeans, just open the file
examples/sources/pom.xml
as a new project, the Maven integration will take care of the rest. -
In Eclipse, open a new project for the directory
examples/sources
. -
Add all the JARs to the classpath from the directory
binaries
and the directoryexamples/binaries
, except for the fileexamples/binaries/optaplanner-examples-*.jar
. -
Add the Java source directory
src/main/java
and the Java resources directorysrc/main/resources
.
-
In IntelliJ and NetBeans, just open the file
Next, create a run configuration:
-
Main class:
org.optaplanner.examples.app.OptaPlannerExamplesApp
-
VM parameters (optional):
-Xmx512M -server
-
Working directory:
examples
(this is the directory that contains the directorydata
)
-
Main class:
- Run that run configuration.
Procedure: Use Business Resource Planner with Maven, Gradle, Ivy, Buildr or Ant:
- Get the Business Resource Planner JARs at the Central Repository (and also at the JBoss Nexus Repository).
If you use Maven, add a dependency to
optaplanner-core
in your project’spom.xml
:<dependency> <groupId>org.optaplanner</groupId> <artifactId>optaplanner-core</artifactId> <version>...</version> </dependency>
<dependency> <groupId>org.optaplanner</groupId> <artifactId>optaplanner-core</artifactId> <version>...</version> </dependency>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To identify the latest version, check the Central Repository. This is similar for Gradle, Ivy, and Buildr.
-
If you’re still using Ant (without Ivy), copy all the JARs from the downloaded ZIP’s
binaries
directory and manually verify that your classpath doesn’t contain duplicate JARs.
The downloaded ZIP’s binaries
directory contains far more JARs then optaplanner-core
actually uses. It also contains the JARs used by other modules, such as optaplanner-benchmark
.
Check the Maven repository pom.xml
files to determine the minimal dependency set for a specific version of a specific module.
Examples are not a part of supported distribution. Customers can use them for learning purposes but Red Hat does not provide support for example code.
Business Resource Planner will be known as Planner for the rest of this book.