Download IBM ILOG CPLEX Optimizer, then install it step by step.
Visual C++ Redistributable Packages for Visual Studio 2013
SPSS Modeler prefer Anaconda python (2.7).
Go to {CPLEX Optimization Studio install folder}\cplex\python\2.7{os} and run "python setup.py install"
Notes:
- a. refer to this link for more detail information.
Ensure pip enable, and run pip install docplex
to install docplex package.
Download sample code from github docplex example.
python \examples\mp\modeling\diet.py
Model: diet
- number of variables: 9
- binary=0, integer=0, continuous=9
- number of constraints: 7
- linear=7
- parameters: defaults
* model solved as function:
objective: 2.690
"Spaghetti W/ Sauce"=2.155
"Lowfat Milk"=1.831
"Chocolate Chip Cookies"=10.000
"Hotdog"=0.930
* KPI: Total Calories=2000.000
* KPI: Total Calcium=800.000
* KPI: Total Iron=11.278
* KPI: Total Vit_A=8518.433
* KPI: Total Dietary_Fiber=25.000
* KPI: Total Carbohydrates=256.806
* KPI: Total Protein=51.174