Interactive CP Optimizer

Users can invoke CP Optimizer from the command line.

Starting the CP Interactive Optimizer

To start the CP Interactive Optimizer, type the command cpoptimizer at your operating system prompt. A message similar to the following one appears on the screen:


Welcome to IBM(R) ILOG(R) CP Interactive Optimizer 12.7.0.0
5724-Y48 5724-Y49 5724-Y54 5724-Y55 5725-A06 5725-A29
Copyright IBM Corp. 1990, 2016.  All Rights Reserved

Type 'help' for a list of available commands
Type 'help' followed by a command name for more
information on commands

CP-Optimizer> 

The last line, CP-Optimizer>, is the prompt, showing that the product is running and is ready to accept one of the available CP Optimizer commands. Use the help command to see a list of these commands.

Flags for the CP Interactive Optimizer

The CP Interactive Optimizer supports the flags -h to display the usage, -f to run commands from a specified file, -c to run specified commands, and -i to start the interactive shell.

Usage: ./cpoptimizer.bin [-h] [-i] [-f filename] [-c "cmd1" .. "cmdn"]
    <filename> contains commands, one per line
    "<cmdi>" is a single command enclosed in quotes
Execution:
    All commands specified via -f and -c are executed in order.
    Then, if neither -f nor -c were specified, or -i was
    specified, the interactive shell is started and additional
    commands can be entered interactively.
For example:
 
cpoptimizer -c "read mymodel.cpo" -i
starts the interactive optimizer after first loading mymodel.cpo. The command
 
cpoptimizer -f myfile.txt
where myfile.txt contains interactive optimizer commands such as:
 
read mymodel.cpo
set Workers 4
set TimeLimit 60
opt
runs the commands in file myfile.txt before exiting the interactive optimizer.

Invoking the CP Interactive Optimizer

If launching the CP Interactive Optimizer from the prompt of your operating system is not your preferred way of working, you can configure an integrated development environment (IDE) to launch the interactive optimizer or launch the interactive optimizer from certain file browsers.

If you use an integrated development environment (IDE) based on Eclipse, such as IBM ILOG CPLEX Optimization Studio or Rational Team Concert (RTC), you can configure your IDE to launch the interactive optimizer. To do so, follow these steps.

  1. Open your IDE.
  2. Click Run (the menu item) and select External Tools > External Tools Configurations.
  3. Select Program as the type of configuration and then click New.
  4. In the dialog, supply a Name for your new configuration. For example, type CP Interactive Optimizer.
  5. On the Main tab of the dialog, supply the Location, that is, the path to the executable file of the CP Interactive Optimizer in your installation on your platform. For example, on a typical Windows installation, the default path is:
    C:\IBM\ILOG\CPLEX Optimization Studio\cpoptimizer\bin\x64_win64\cpoptimizer.exe
    or on a typical GNU/Linux installation, the default path resembles:
    /opt/IBM/ILOG/CPLEX_Optimization_Studio/cpoptimizer/bin/port/cpoptimizer
  6. Still on the Main tab, you can optionally supply a Working Directory, that is, a directory or folder where you have write permission and where you want CP Optimizer to write logs and to search for data.
  7. After completing the dialog, click Apply and Run.

After those steps, the new run configuration appears in the list of Run Configurations in your IDE. There, you can run the new configuration from your IDE in the usual way to launch the executable file of CP Interactive Optimizer.

If you use a file browser, such as the file explorer on Windows, you can also launch the interactive optimizer by browsing to the location of the executable file and double clicking it.
C:\IBM\ILOG\CPLEX Optimization
Studio\cpoptimizer\bin\x64_win64\cpoptimizer.exe
or
/opt/IBM/ILOG/CPLEX_Optimization_Studio/cpoptimizer/bin/port/cpoptimizer
Tip: The precise location of the executable file of the CP Interactive Optimizer may differ slightly from the path in those examples. For example, your path may include the version number, especially if you have more than one installation of the product, or you may have installed the product in a customized location. In such cases, adapt the paths shown in these examples to your particular situation.