Home | Research Interests | Publications | Positions | Personal | Models | Seminar Abstracts | Powerpoint Talks
 

 

» Agprice
» Constraint
» Curve
» Decent
» Distrib
» Economy
» Efficient
» Factory
» Farm
» Food
» Hydro
  Logic
» Manpower
» Market
» Milk
» Mining
» OandX
» Opencast
» Refinery
» Tariff
» TSP
» Yield
 

Model Logic

  MODEL LOGIC
  SET
    maxi = {1 .. 7},
    maxii = {1 .. 3},
    maxj = {1 .. 2},
 

 

maxk = {1 .. 4};
  DATA
 

 

alpha[maxk,maxj] = [0,0,0,1,1,0,1,1];
  VARIABLES
    in1[maxi,maxj] integer,
    out[maxi,maxk] integer;
 

 

nor[maxi] integer,
  OBJECTIVE
 

 

MINIMIZE number = sum {i in maxi} nor[i];
  CONSTRAINTS
 

 

enor{i in maxi, j in maxj} : nor[i]-in1[i,j] >= 0,
 

 

innor{i in {1 .. 1}} : nor[2]+nor[3] + sum{j in maxj} in1[i,j] <= 2,
 

 

innor{i in {2 .. 2}} : nor[4]+nor[5] + sum{j in maxj} in1[i,j] <= 2,
 

 

innor{i in {3 .. 3}} : nor[6]+nor[7] + sum{j in maxj} in1[i,j] <= 2,
 

 

loga{k in maxk, i in maxii} : out[2*i,k]+out[i,k] <= 1,
 

 

logb{k in maxk, i in {1 .. 1}} : out[3,k]+out[i,k] <= 1,
 

 

logb{k in maxk, i in {2 .. 2}} : out[5,k]+out[i,k] <= 1,
 

 

logb{k in maxk, i in {3 .. 3}} : out[7,k]+out[i,k] <= 1,
 

 

lc{k in maxk, i in maxi, j in maxj} : alpha[k,j]*in1[i,j]+out[i,k] <= 1,
 

 

logc{k in maxk, i in {1 .. 1}} : out[2,k]+out[3,k]+sum{j in maxj}
 

 

(alpha[k,j]*in1[i,j])+out[i,k]-nor[i] >= 0, logc{k in maxk, i in {2 .. 2}} : out[4,k]+out[5,k]+sum{j in maxj}
 

 

(alpha[k,j]*in1[i,j])+out[i,k]-nor[i] >= 0, logc{k in maxk, i in {3 .. 3}} : out[6,k]+out[7,k]+sum{j in maxj}
 

 

(alpha[k,j]*in1[i,j])+out[i,k]-nor[i] >= 0, logc{k in maxk, i in {4 .. 7}} : sum{j in maxj}
 

 

(alpha[k,j]*in1[i,j])+out[i,k]-nor[i] >= 0,
 

 

pout{i in maxi, k in maxk} : nor[i]-out[i,k] >= 0,
 

 

bounds{i in maxi} : nor[i] <= 1,
   

bounds{i in maxi, j in maxj} : in1[i,j] <= 1,

   

bounds{i in {2 .. 7}, k in maxk} : out[i,k] <= 1,,

   

bounds{i in {1 ..1}, k in {1 .. 1}} : out[i,k] = 0,

   

bounds{i in {1 ..1}, k in {2 .. 2}} : out[i,k] = 1,

   

bounds{i in {1 ..1}, k in {3 .. 3}} : out[i,k] = 1,

   

bounds{i in {1 ..1}, k in {4 .. 4}} : out[i,k] = 0,

   

bounds : nor[1] >= 1;

  END MODEL
   

solve Logic;

   

print solution for Logic >> "Logic.sol";

   

quit;

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

 

 

 

 

 

 

 

 
         
 
Site updated December 2021 | email: h.p.williams@lse.ac.uk