此内容没有您所选择的语言版本。

Chapter 32. Downloading Red Hat build of OptaPlanner examples


You can download the Red Hat build of OptaPlanner examples as a part of the Red Hat Process Automation Manager add-ons package available on the Red Hat Customer Portal.

Procedure

  1. Navigate to the Software Downloads page in the Red Hat Customer Portal (login required), and select the product and version from the drop-down options:

    • Product: Process Automation Manager
    • Version: 7.11
  2. Download Red Hat Process Automation Manager 7.11 Add Ons.
  3. Extract the rhpam-7.11.0-add-ons.zip file. The extracted add-ons folder contains the rhpam-7.11.0-planner-engine.zip file.
  4. Extract the rhpam-7.11.0-planner-engine.zip file.

Result

The extracted rhpam-7.11.0-planner-engine directory contains example source code under the following subdirectories:

  • examples/sources/src/main/java/org/optaplanner/examples
  • examples/sources/src/main/resources/org/optaplanner/examples

32.1. Running OptaPlanner examples

Red Hat build of OptaPlanner includes several examples that demonstrate a variety of planning use cases. Download and use the examples to explore different types of planning solutions.

Prerequisites

Procedure

  1. To run the examples, in the rhpam-7.11.0-planner-engine/examples directory enter one of the following commands:

    Linux or Mac:

    $ ./runExamples.sh

    Windows:

    $ runExamples.bat

    The OptaPlanner Examples window opens.

  2. Select an example to run that example.
Note

Red Hat build of OptaPlanner has no GUI dependencies. It runs just as well on a server or a mobile JVM as it does on the desktop.

32.2. Running the Red Hat build of OptaPlanner 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 OptaPlanner examples within your development environment.

Prerequisites

Procedure

  1. Open the OptaPlanner 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 /examples/binaries directory, located under the rhpam-7.11.0-planner-engine directory.
  2. Add all the JAR files that are in the binaries directory to the classpath, except for the examples/binaries/optaplanner-examples-7.52.0.Final-redhat-00007.jar file.
  3. Add the Java source directory src/main/java and the Java resources directory src/main/resources, located under the rhpam-7.11.0-planner-engine/examples/sources/ directory.
  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.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.