2016-09-02 8 views
1

인 경우 모델에 익숙하지만 GAMS가 제약 조건을 위반한다고 생각하기 때문에 결과에 대해 불편합니다. 내가 GAMS에 말하고 싶은 것은 :GAMS의 기능이

는 "처음 수요를 확인 -> 당시 주식 확인 ->을 충분히 주식은 현재 주식에서 판매하고있다 경우 ->하지 충분한 주식이 경우 먼저 구매 (생산) 한 다음 판매하십시오. "

GAMS는 어떤 요구 (판매)를 따르지 않으며 모든 최소값을 구매하지 않고 모든 것을 판매한다고 생각합니다.

모델은 이하입니다 :

Sets 
i items /s,p,b/ 
t time in quarters /1,2,3/ 

Parameters 
price(i)  selling price per unit i per quarter in euros /s 6.34, p 6.46, b 5.93/ 
inistock(i) initial stock in units /s 320000, p 296199, b 104208/ 
cap(i)   capacity limit for each unit /s 400000, p 350000, b 150000/ 
c    cost of holding 1 unit of i /s 10, p 15, b 12/ 

Scalars 
tcap   total capacity of warehouse /650000/ 

Variables 
stock(i,t)  stock stored at time t 
sell(i,t)  stock sold at time t 
buy(i,t)  stock bought at time t 
cost   total cost 

Positive Variables stock,sell,buy 

Equations 
cst   total cost occurs 
stck(i,t)  stock balance of unit i at time t; 

cst..   cost=e=sum((i,t),price(i)*(buy(i,t)-sell(i,t))+c(i)*stock(i,t)); 
stck(i,t).. stock(i,t)=e=inistock(i)+stock(i,t-1)+buy(i,t)-sell(i,t); 
stck.up(i,t)=tcap; 

Option LP=Cplex ; 

Option optcr=0; 

Model TWH The Warehouse Problem/all /; 

Solve TWH minimizing cost using lp; 

당신의 지원을위한 미리 감사합니다!

답변

0

수요 제한을 설정하지 않았으며 최소값은 변수를 양수로 정의하는 제로 범위입니다.

GAMS가 지켜야 할 다른 제약 조건은 무엇입니까?

모든 것을 판매하는 것은 정의한 문제에 대한 올바른 해결책입니다.

stck.up(i,t)=tcap; 

당신은 아마 오히려 'STCK'가 아닌 '주식'쓰기 의미 :

나는이 부분은 실수라고 생각합니다. 이것이 하한 ('up'대신 'lo'를 쓰는 경우) 인 경우웨어 하우스가 최대 용량으로 채워야한다는 제한 조건을 추가하기 때문에 문제는 드뭅니다.