Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

MODELO RED MULTIESLABON, MULTICLIENTE Y MULTIPRODUCTO

12 views
Skip to first unread message

Alejandra Baena

unread,
May 29, 2024, 4:12:45 PM5/29/24
to AMPL Modeling Language
#Modelo RED MULTIESLABON

set I; #Plantas
set J; #CEDIS
set K; #Clientes
set P; #Productos

#subconjuntos
set PM within P; #Productos
set PS within P;
set SS within K; #single sourcing
set MS within K; #multiple sourcing

#PARAMETROS

param CAP_PLANTA{i in I};
param CAP_CEDI{j in J};
param FLETE_1{i in I,j in J};
param FLETE_2{j in J,k in K};
param DEMANDA{k in K,p in P};
param CFIJO{j in J};

#VARIABLES

var X{i in I,j in J, p in P}>=0;
var Y{j in J, k in K, p in P}>=0;
var Z{j in J,k in SS} binary;
var W{j in J} binary;

#FUNCIÓN OBJETIVO

minimize costos:
sum{i in I, j in J, p in P}X[i,j,p] *FLETE_1[i,j] +
sum{j in J} W[j]*CFIJO[j]+
sum{j in J, k in MS, p in P}Y[j,k,p]*FLETE_2[j,k]+
sum{j in J, k in SS, p in P}Z[j,k]*FLETE_2[j,k]
;


#RESTRICCIONES


subject to R1_CAP_PLANT{i in I}:
    sum{j in J, p in P} X[i,j,p] <= CAP_PLANTA[i];

subject to R2_CAP_CED{j in J}:
    sum{i in I, p in P} X[i,j,p] <= CAP_CEDI[j] * W[j];

subject to R3_DEM{k in MS, p in P}:
    sum{j in J}Y[j,k,p]>=DEMANDA[k,p];

subject to R4_DEM{k in SS}:
    sum{j in J}Z[j,k]=1;


subject to R5_BALANCE{j in J, p in P}:
    sum{i in I} X[i,j,p] = sum{k in K} Y[j,k,p];


#DATOS ABONOS
#Conjuntos

set I:= PP1 PP2; #Plantas
set J:= CEDIMA CEDIIB CEDIBOG CEDIG; #CEDIS
set K:= CLI CLV  CLA  CLT;   #Clientes
set P:= PAO  PCO  PAQ; #Productos

#Subconjuntos
set PM:= PAO PCO; #productos clientes MS
set PS:= PAQ; #productos clientes SS
set SS:=  CLI CLV;  #clientes_internacionales
set MS:=  CLA  CLT;  #clientes_nacionales


#Parametros

param CAP_PLANTA:=
PP1 13000
PP2 13000
;
param CAP_CEDI:=
CEDIMA 5000
CEDIIB 4000
CEDIBOG 6000
CEDIG 2800
;

param DEMANDA: #Demanda

     PAO   PCO   PAQ:=
CLI   0     0     1600
CLV   0     0     1200
CLA  1000   125   0
CLT  300    25     0
;

param CFIJO:=

CEDIMA  8000000
CEDIIB  10000000
CEDIBOG  8500000
CEDIG  7000000
;

param FLETE_1:  #Plantas a CEDIS

     CEDIMA      CEDIIB     CEDIBOG    CEDIG:=
PP1  500000       650000     1000000   400000
PP2  405000       600000     800000    480000
;

param FLETE_2: #CEDIS a clientes SS y MS

        CLI       CLV        CLA      CLT:=
CEDIMA  760000    800000    480000  600000
CEDIIB  200000    900000   400000   300000
CEDIBOG 800000    300000    50000    300000
CEDIG   300000     250000    200000   450000
;







AMPL Google Group

unread,
May 31, 2024, 5:24:04 PM5/31/24
to AMPL Modeling Language
Your question has been moved to our new user forum at discuss.ampl.com, and a response has been posted there. To see the response, use this link:

https://discuss.ampl.com/t/ampl-25045-modelo-red-multieslabon-multicliente-y-multiproducto/1116/2

To reply, click the red "Reply" button that follows the response. (Do not send an email reply to this message.)


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2611149006-125216#}
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/ea9c2d6a-d6f9-422b-a1cb-e8c8644dc7f6n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages