help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] syntax error in literal set


From: Jack Johnson
Subject: [Help-glpk] syntax error in literal set
Date: Sun, 20 Nov 2011 22:28:15 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi Everyone,


I'm just getting into GLPK....I can't get past the syntax error in literal set 
idetnified in line 25 where the constraint is defined....any help would be 
much appreciated....I'm sure I have problems after getting over that issue 
too:)

/* sets */
set TECHNICIANS;
set GOODWEATHERDAYS;
set SITES;

/* parameters */
param DAYSOFSITEWORK  {j in SITES};
param SITERISK {j in SITES};
param WORKABLEDAYS {j in SITES, k in GOODWEATHERDAYS};

/* decision variables: yi, i in {1,..,5}. yi = 1 -> technician i is assigned 
to a site i on day k*/
var y {i in TECHNICIANS, j in SITES, k in GOODWEATHERDAYS} binary >=0;
      
/* objective function */
minimize z: ((sum{j in SITES} SITERISK[j])-(sum{j in SITES} SITERISK[j]))/(sum
{j in SITES} DAYSOFSITEWORK[j])* sum{i in TECHNICIANS, j in SITES, k in 
GOODWEATHERDAYS} y[i,j,k];
     
/* Constraints */
s.t. WORKDAYCONSTRAINT{j in SITES}:sum{i in TECHNICIANS, j in SITES, k in 
GOODWEATHERDAYS} y[i,j,k] <= sum{j in SITES} DAYSOFSITEWORK[j]; 


/*Define data sets*/ 
data;

/*define total number of technicians, etc*/
set TECHNICIANS := 1 2 3 4 5;
set GOODWEATHERDAYS := DayA DayB DayC DayD DayE;
set SITES := SITEA SITEB SITEC SITED SITEE;

/*define total days of work required in 2012 for each site*/
param DAYSOFSITEWORK:=  SITEA   5            
                         SITEB   1
                         SITEC   1
                         SITED   1
                         SITEE   1;

/*define total siterisk of work required in 2012 for each site*/ 
param SITERISK :=      SITEA    10  
                        SITEB    8
                        SITEC    6
                        SITED    4
                        SITEE    1;


/*define total days that work can be performed*/        
Param WORKABLEDAYS: DayA DayB DayC DayD DayE:=
          SITEA           1    1    1    1    1
          SITEB           0    0    0    0    1
          SITEC           0    0    0    0    1
          SITED           0    0    0    0    1
          SITEE           0    0    0    0    1;
          
end;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]