26 정적 intnumberOfThreads = 16;
35파일 WorkingDirectory =
신규파일(System.getProperty(
"user.dir"),
"창고");
36workingDirectory.mkdir();
44결과DB.
addSet(
"공급지도",3,
"레벨에 따른 공급 연결");
49Map<String, WarehouseThread> WarehousesMap =
신규HashMap<String, WarehouseThread>();
50 for (
inti=10; i<=numberOfThreads; 나++)
51창고쓰레드 wh =
신규WarehouseThread(ws, i, resultDB, dbLock);
52warehousesMap.put(Integer.toString(i), wh);
57 for(WarehouseThread wh : WarehousesMap.values())
60}
잡기(InterruptedException e)
76 공개 정적 무효notifyException(
슬롯예외e)
91numberOfWarehouses = 숫자;
99GAMSOptions opt = 작업공간.
추가옵션();
101opt.defines(
"창고", Integer.toString(numberOfWarehouses));
102opt.defines(
"상점",
"65");
103opt.defines(
"고정",
"22");
104opt.defines(
"분리",
"0");
109직업.
실행(선택, System.out);
113결과.
getParameter(
"objrep").addRecord(Integer.toString(numberOfWarehouses)).setValue( 작업.
아웃DB().
get변수(
"obj").findRecord().getLevel() );
117 if(supplyRec.getLevel() > 0.5)
119문자열[] 키 =
신규String[] Integer.toString(numberOfWarehouses), SupplyRec.getKey(0), SupplyRec.getKey(1) ;
120결과.
getSet(
"공급지도").addRecord( 키 );
125 창고.notifyException(e) ;
134 "$SetDDList 창고 저장소 고정 분리 // 허용 가능한 정의 \n" +
135 "$창고가 설정되지 않은 경우 $창고 10으로 설정 \n" +
136 "$저장소를 설정하지 않은 경우 $설정 저장 50 \n" +
137 "$설정되지 않은 경우 고정 $set 고정 20 \n" +
138 "$if set not set disaggregate $set disaggregate 1 // 더 엄격한 bigM 제약 조건에 대한 표시 \n" +
139 "$ife %store%<=%슬롯% $abort 매장 수 증가 (>%슬롯) \n" +
141 "창고 설정 /w1*w%슬롯% / \n" +
142 " 저장 /s1*s%store% / \n" +
143 "별칭 (창고,w), (상점,s); \n" +
145 " 창고 개설을 위한 고정 고정 비용 / %fixed% / \n" +
148 " 공급 비용(상점,창고); \n" +
150 "$eval storeDIVwarehouse trunc(카드(스토어)/카드(창고)) \n" +
151 "용량(w) = %storeDIVwarehouse% + mod(ord(w),%storeDIVwarehouse%);\n" +
152 "공급 비용(s,w) = 1+mod(ord(s)+10*ord(w), 100); \n" +
165 "defobj.. obj =e= sum(w,fixed*open(w)) + sum((w,s), SupplyCost(s,w)*supply(s,w)); \n" +
167 "하나의 창고.. 합계(w, 공급(들,w)) =e= 1; \n" +
169 "defopen(w).. sum(s, 공급(s,w)) =l= open(w)*capacity(w); \n" +
171 "$ifthen %disaggregate%==1 \n" +
173 " defopen2(s,w); \n" +
174 "defopen2(s,w).. 공급(s,w) =l= 개방(w); \n" +
178 "Mip를 사용하여 최소 obj 분포를 해결합니다. \n" +
179 "중단$(distrib.solvestat<>%SolveStat.NormalCompletion% 또는 \n" +
180 " distrib.modelstat<>%ModelStat.Optimal% 및 \n" +
181 " distrib.modelstat<>%ModelStat.IntegerSolution%) '해결책 없음!'; \n" +