Está en la página 1de 20

INTEGRACIN DE CPLEX Y

CONCERT TECHNOLOGY EN
PROGRAMAS DE C++

Alejandro Duque Gmez


aduque55@utp.edu.co

Universidad Tecnolgica de Pereira


Noviembre, 2013
1

1. Introduccin
CPLEX es una herramienta desarrollada para resolver
problemas de programacin lineal (PL), problemas de flujo
en redes, programacin cuadrtica (QP) y programacin
lineal entera mixta (MIP).

Viene en varios formatos para atender las necesidades de


una amplia gama de usuarios:

CPLEX Interactive Optimizer


Concert Technology
CPLEX callable library
2

1. Introduccin
Concert Technology es un conjunto de libreras de C++, java
y .NET en las que se aprovecha la programacin orientada a
objetos para facilitar la creacin de modelos matemticos,
permitiendo al usuario incorporar el solver CPLEX en sus
aplicaciones.

Modelo Tcnica de
matemtico solucin
3

2. Objetivo
Conocer los conceptos bsicos necesarios para desarrollar
aplicaciones en C++ que incorporen los objetos definidos
en las libreras de Concert Technology para finalmente
resolver diversos problemas de optimizacin dentro de
dichas aplicaciones.

Para tal fin, es necesario contar con conocimiento previo


sobre programacin en lenguaje C++ y programacin
orientada a objetos.
4

3. Software requerido

Microsoft Visual Studio 2010 IBM ILOG CPLEX Optimization Studio


5

4. Configuracin Inicial
En Visual Studio:
File New Project Win32 Console Application *Dar nombre* OK
6

En la ventana Win 32 Application Wizard:


Next Empty Project Finish
7

En Solution Explorer:
Source Files *Click derecho* AddNew Item
8

En la ventana Add New Item:


C++ file *Dar nombre* Add
9

En Solution Explorer:
Nombre Proyecto *Click derecho* Properties
10

En Property Pages: Configuration Manager


En Configuration Manager: Active solution configurationRelease
Active solution platform New
En New Solution Platform: Type or select new platform x64
Copy settings from Win32 OK Close
11

En Property Pages:
C/C++General Additional Include Directories Edit
En la ventana emergente: *Directorio\cplex\include*
Seleccionar carpeta
*Directorio\concert\include*
Seleccionar carpeta OK
12

En Property Pages C/C++General :


Debug Information Format C7 compatible (/Z7) Aplicar
13

En Property Pages:
C/C++ Preprocessor Preprocessor Definitions *Escribir IL_STD;
junto a Win32 Aplicar
14

En Property Pages:
C/C++ Code Generation Runtime Library Multi-threaded (/MT)
Aplicar
15

En Property Pages:
LinkerGeneral Additional Library Directories Edit
En la ventana : *\cplex\lib\x64_windows_vs2010\stat_mta*
Seleccionar carpeta
*\concert\lib\x64_windows_vs2010\stat_mta*
Seleccionar carpeta OK Aplicar
16

En Property Pages:
Linker Input Additional Dependencies *Escribir cplex125.lib;
ilocplex.lib; concert.lib; junto a kernel32.lib Aplicar Aceptar
17

5. Modelar con Concert Technology


Entorno IloEnv env

Modelo IloModel mod(env) Cplex IloCplex cplex(env)

IloNumVar cplex.extract(mod)
IloBoolVar cplex.exportModel(Modelo.lp)
IloArray cplex.solve()
IloNumVarArray cplex.getValue()
IloBoolVarArray cplex.getObjValue()
IloExpr IloCplex::FractionalCutCallbackI
IloRange IloCplex::DisjunctiveCutCallbackI
IloConstraint IloCplex::CutCallbackI
IloConstraintArray IloCplex::HeuristicCallbackI
IloObjective IloCplex::NodeCallbackI

**Incluir la librera: #include <ilcplex/ilocplex.h>


18

6. Ejemplo de aplicacin

max x1 2 x2 3 x3
s.a.
x1 x2 x3 20
1. Generar por expresiones

2. Generar por columnas


x1 3 x2 x3 30
0 x1 40
x2 , x3 0
19

7. Manual de referencia IBM


http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r2/index.jsp

También podría gustarte