38 "나는 식물을 통조림으로 만들고 있습니다 \n"
42 " a(i) 경우에 따라 공장 i의 용량 \n"
43 " b(j) 경우의 시장 j 수요 \n"
44 " d(i,j) 거리(천 마일 단위) \n"
45 "천 마일당 케이스당 달러 단위의 스칼라 f 운임; \n"
47 "$if gdxincname $abort '제공된 데이터 파일에 대한 포함 파일 이름이 설정되지 않았습니다'\n"
48 "$gdxin %gdxincname% \n"
49 "$load i j a b d f \n"
52 " 매개변수 c(i,j) 운송 비용(케이스당 수천 달러) ; \n"
54 " c(i,j) = f * d(i,j) / 1000 ; \n"
58 " z 총 운송 비용(수천 달러) ; \n"
65 " 공급(i) 공장 i의 공급 제한 준수 \n"
66 " 수요(j)는 시장 j의 수요를 충족시킵니다. \n"
68 " 비용 .. z =e= sum((i,j), c(i,j)*x(i,j)) ; \n"
70 " 공급(i) .. sum(j, x(i,j)) =l= a(i) ; \n"
72 " 수요(j) .. sum(i, x(i,j)) =g= b(j) ; \n"
76 " z를 최소화하는 lp를 사용하여 전송 문제를 해결합니다. \n"
87int 메인(
intargc,
문자* argv[])
89cout <<
"---------- 수송 4 ------------"<< endl;
104map<string, double> 용량 =
105{
"시애틀", 350.0 }, {
"샌디에고", 600.0 }
107map<string, double> 수요 =
108{
"뉴욕", 325.0 }, {
"시카고", 300.0 }, {
"토피카", 275.0 }
110맵<튜플<문자열, 문자열>,
더블> 거리 =
111make_tuple(
"시애틀",
"뉴욕"), 2.5 },
112make_tuple(
"시애틀",
"시카고"), 1.7 },
113make_tuple(
"시애틀",
"토피카"), 1.8 },
114make_tuple(
"샌디에고",
"뉴욕"), 2.5 },
115make_tuple(
"샌디에고",
"시카고"), 1.8 },
116make_tuple(
"샌디에이고",
"토피카"), 1.4 }
140d.
추가기록(get<0>(t.first), get<1>(t.first)).
세트값(t.초);
153cout <<
"x("<< Rec.key(0) <<
","<< Rec.key(1) <<
"):"<<
" 레벨="<< Rec.level() <<
" 한계="
154<< rec.marginal() << endl;
157cout <<
"슬롯 커뮤니티예외 발생: "<< ex.what() << endl;
159cout << ex.what() << endl;
GAMSSet addSet(const std::string &name, const int 차원, const std::string &explanatoryText="", GAMSEnum::SetType setType=GAMSEnum::SetType::Multi)
GAMSParameter addParameter(const std::string &name, const int 차원, const std::string &explanatoryText="")
GAMSVariable getVariable(const std::string &name)
void setAllModelTypes(const std::string &solver)
void setDefine(const std::string &key, const std::string &value)
void setValue(const double val)
GAMSParameterRecord addRecord(const std::벡터< std::string > &keys)
GAMSSetRecord addRecord(const std::벡터< std::string > &keys)
void setSystemDirectory(const std::string &systemDir)
GAMSJob addJobFromString(const std::string &gamsSource, const std::string &jobName="")
GAMSDatabase addDatabase(const std::string &databaseName="", const std::string &inModelName="")
int main(int argc, char *argv[])
string getModelText()
모델을 문자열로 가져옵니다.