第12章 Examples provided with Red Hat Business Optimizer


Several Red Hat Business Optimizer examples are shipped with Red Hat Decision Manager. You can review the code for examples and modify it as necessary to suit your needs.

注記

Red Hat does not provide support for the example code included in the Red Hat Decision Manager distribution.

12.1. Downloading and running the examples

You can download the Red Hat Business Optimizer examples from the Red Hat Software Downloads website and run them.

12.1.1. Downloading Red Hat Business Optimizer examples

You can download the examples as a part of the Red Hat Decision Manager add-ons package.

Procedure

  1. Download the rhdm-7.10.0-add-ons.zip file from the Software Downloads page.
  2. Decompress the file.
  3. Decompress the rhdm-7.10-planner-engine.zip file from the decompressed directory.

Result

In the decompressed rhdm-7.10-planner-engine directory, you can find example source code under the following subdirectories: * examples/sources/src/main/java/org/optaplanner/examples * examples/sources/src/main/resources/org/optaplanner/examples * webexamples/sources/src/main/java/org/optaplanner/examples * webexamples/sources/src/main/resources/org/optaplanner/examples

The table of examples in 「Table of Business Optimizer examples」 lists directory names that are used for individual examples.

12.1.2. Running Business Optimizer examples

Red Hat Business Optimizer includes a number of examples to demonstrate a variety of use cases.

Prerequisites

Procedure

  1. In the rhdm-7.10.0-planner-engine folder, open the examples directory and use the appropriate script to run the examples:

    Linux or Mac:

    $ cd examples
    $ ./runExamples.sh

    Windows:

    $ cd examples
    $ runExamples.bat

Select and run an example from the GUI application window:

plannerExamplesAppScreenshot
注記

Red Hat Business Optimizer itself has no GUI dependencies. It runs just as well on a server or a mobile JVM as it does on the desktop.

12.1.3. Running the Red Hat Business Optimizer examples in an IDE (IntelliJ, Eclipse, or Netbeans)

If you use an integrated development environment (IDE), such as IntelliJ, Eclipse, or Netbeans, you can run your downloaded Red Hat Business Optimizer examples within your development environment.

Prerequisites

Procedure

  1. Open the Red Hat Business Optimizer examples as a new project:

    1. For IntelliJ or Netbeans, open examples/sources/pom.xml as the new project. The Maven integration guides you through the rest of the installation; skip the rest of the steps in this procedure.
    2. For Eclipse, open a new project for the directory examples/sources.
  2. Add all the JARs to the classpath from the directory binaries and the directory examples/binaries , except for the examples/binaries/optaplanner-examples-*.jar file.
  3. Add the Java source directory src/main/java and the Java resources directory src/main/resources.
  4. Create a run configuration:

    • Main class: org.optaplanner.examples.app.OptaPlannerExamplesApp
    • VM parameters (optional): -Xmx512M -server -Dorg.optaplanner.examples.dataDir=examples/sources/data
    • Working directory: examples/sources
  5. Run the run configuration.

12.1.4. Running the web examples

Besides the GUI examples, Red Hat Decision Manager also includes a set of web examples for Red Hat Business Optimizer. The web examples include:

  • Vehicle routing: Calculating the shortest possible route to pick up all items required for a number of different customers using either Leaflet or Google Maps visualizations.
  • Cloud balancing: Assigning processes across computers with different specifications and costs.

Prerequisites

The web examples require several JEE APIs to run, such as the following APIs:

  • Servlet
  • JAX-RS
  • CDI

These APIs are not required for Business Optimizer itself.

Procedure

  1. Download a JEE application server, such as JBoss EAP or WildFly and unzip it.
  2. In the decompressed rhdm-7.10.0-planner-engine directory, open the subdirectory webexamples/binaries and deploy the optaplanner-webexamples-*.war file on the JEE application server.

    If using JBoss EAP in standalone mode, this can be done by adding the optaplanner-webexamples-*.war file to the JBOSS_home/standalone/deployments folder.

  3. Open the following address in a web browser: http://localhost:8080/optaplanner-webexamples/.
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る