36 " 나는 식물 통조림 / 시애틀, 샌디에이고 / \n"
37 " j 마켓 / 뉴욕, 시카고, 토피카 / ; \n"
40 " a(i) 경우에 따라 공장 i의 용량 \n"
44 " b(j) 경우의 시장 j 수요 \n"
49 "테이블 d(i,j) 거리(천 마일 단위) \n"
52 " 샌디에고 2.5 1.8 1.4 ; \n"
54 "천 마일당 케이스당 달러 단위의 스칼라 f 운임 /90/;\n";
61 "나는 식물을 통조림으로 만들고 있습니다 \n"
65 " a(i) 경우에 따라 공장 i의 용량 \n"
66 " b(j) 경우의 시장 j 수요 \n"
67 " d(i,j) 거리(천 마일 단위) \n"
68 "천 마일당 케이스당 달러 단위의 스칼라 f 운임; \n"
70 "$if gdxincname $abort '제공된 데이터 파일에 대한 포함 파일 이름이 설정되지 않았습니다'\n"
71 "$gdxin %gdxincname% \n"
72 "$load i j a b d f \n"
75 " 매개변수 c(i,j) 운송 비용(케이스당 수천 달러) ; \n"
77 " c(i,j) = f * d(i,j) / 1000 ; \n"
80 " x(i,j) 케이스의 배송 수량 \n"
81 " z 총 운송 비용(수천 달러) ; \n"
88 " 공급(i) i 공장의 공급 제한 준수 \n"
89 " 수요(j)는 시장 j의 수요를 충족합니다. \n"
91 " 비용 .. z =e= sum((i,j), c(i,j)*x(i,j)) ; \n"
93 " 공급(i) .. sum(j, x(i,j)) =l= a(i) ; \n"
95 " 수요(j) .. sum(i, x(i,j)) =g= b(j) ; \n"
99 " z를 최소화하는 lp를 사용하여 전송 문제를 해결합니다. \n"
111int 메인(
intargc,
문자* argv[])
113cout <<
"---------- 수송 3 ------------"<< endl;
134cout <<
"x("<< Rec.key(0) <<
","<< Rec.key(1) <<
"):"<<
" 레벨="<< Rec.level() <<
" 한계="
135<< rec.marginal() << endl;
145cout <<
"x("<< Rec.key(0) <<
","<< Rec.key(1) <<
"):"<<
" 레벨="<< Rec.level() <<
" 한계="
146<< rec.marginal() << endl;
149cout <<
"슬롯 나라예외 발생: "<< ex.what() << endl;
151cout << ex.what() << endl;
void doExport(const std::string &filePath="")
GAMSVariable getVariable(const std::string &name)
void setAllModelTypes(const std::string &solver)
void setDefine(const std::string &key, const std::string &value)
void setSystemDirectory(const std::string &systemDir)
std::string WorkingDirectory() const
GAMSJob addJobFromString(const std::string &gamsSource, const std::string &jobName="")
int main(int argc, char *argv[])
string getDataText()
데이터를 문자열로 가져옵니다.
string getModelText()
모델을 문자열로 가져옵니다.