Help in MIP

Dear all:
I use GAMS to solve a MIP problem using Cplex, and I’m trying to generate a code that evaluate an expansion rute. For example, for the first period, we can have 3 possible work shifts, 1, 2 or 3; for the second period the same, 3 possibilities: 1,2 or 3 work shift…and so on.

A rute for 4 periods is like that (work shift for period1-period2-period3-period4): 1-1-1-1, 1-1-1-2, 1-1-1-3, 1-1-2-1,…3-1-1-1, 3-1-1-2, …3-3-3-3 and so on.

The question is how can I do that GAMS recognizes this parameteres: i, j, k l and evaluates the rute? Furthermore, how can I save the result of this rute for the model evaluate the optimal rute?

This is the code that I have, but I don’t know how define i, j,k and l…also, should I use some loop?

rute = 1;

for (i=1 to 3,
W(‘1’)=i
for (j=1 to 3,
W(‘2’)=j
for (k=1 to 3,
W’('3)=k
for (l=1 to 3,
W(‘4’)=l
);
rute=rute+1;

Thank you!


Saluda atentamente,

David Ramírez Saldívar
Alumno Ing. Civil Industrial
UTFSM


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hola David,

Eres de la Santa Maria. Yo soy de la cato, pero estoy estudiando en Londres ahora. Sali de la U hace rato y ahora estoy en un postgrado. Hace algun tiempo que uso GAMS.

Algunas preguntas:

  1. Quieres evaluar todas las posibles combinaciones?
  2. Cuantos periodos vas a tener?

Si es el caso de la pregunta 1:

SETS
i /13/
j /1
3/
k /13/
l /1
3/

LOOP(i,
LOOP(j,
LOOP(k,
LOOP(l,
SOLVE MODELO
Calcular y guardar parametros de interes
Ojo que los parametros tienen que ser de la forma PAR(i,j,k,l)
y las variables tambien, de esta forma puedes guardar todos los
parametros de interes
);
);
);
);


Si es el caso de la pregunta 2, quizas es mas facil definir dos sets, uno para el periodo y otro para la opcion que quieres evaluar, de la siguiente forma:

SETS
t Periodo de tiempo (t = 1…T) /14/
i Work shift (i = 1…I) /1
3/

Luego puedes definir el modelo con ecuaciones que relacionen un periodo con el siguiente, pero no estoy seguro si es eso lo que quieres.


Ojo que con muchos periodos el numero de casos que quieres evaluar aumente rapidamente y por ende el tiempo de simulacion.


Saludos,
Pedro




On Tue, Aug 9, 2011 at 10:49 PM, David Ramírez Saldívar wrote:

Dear all:
I use GAMS to solve a MIP problem using Cplex, and I’m trying to generate a code that evaluate an expansion rute. For example, for the first period, we can have 3 possible work shifts, 1, 2 or 3; for the second period the same, 3 possibilities: 1,2 or 3 work shift…and so on.

A rute for 4 periods is like that (work shift for period1-period2-period3-period4): 1-1-1-1, 1-1-1-2, 1-1-1-3, 1-1-2-1,…3-1-1-1, 3-1-1-2, …3-3-3-3 and so on.

The question is how can I do that GAMS recognizes this parameteres: i, j, k l and evaluates the rute? Furthermore, how can I save the result of this rute for the model evaluate the optimal rute?

This is the code that I have, but I don’t know how define i, j,k and l…also, should I use some loop?

rute = 1;

for (i=1 to 3,
W(‘1’)=i
for (j=1 to 3,
W(‘2’)=j
for (k=1 to 3,
W’('3)=k
for (l=1 to 3,
W(‘4’)=l
);
rute=rute+1;

Thank you!


Saluda atentamente,

David Ramírez Saldívar
Alumno Ing. Civil Industrial
UTFSM


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

PEDRO JAVIER RAMÍREZ TORREALBA
Ingeniero Civil Eléctrico PUC
MSc en Ingeniería Eléctrica PUC
Londres, REINO UNIDO

Celular: +44-(0)-75-806-93119
Casa: +44-(0)-20-785-22010


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.