39파일 WorkingDirectory =
신규파일(System.getProperty(
"user.dir"),
"클래드");
40workingDirectory.mkdir();
45목록<Map.Entry<Long,String>> 단계 =
신규ArrayList<Map.Entry<Long,String>>();
46단계.추가(
신규AbstractMap.SimpleEntry<긴 문자열>(
신규긴(5),
"epgap 0.1") );
47단계.추가(
신규AbstractMap.SimpleEntry<긴 문자열>(
신규장(10),
"epgap 0.2"));
48단계.추가(
신규AbstractMap.SimpleEntry<긴 문자열>(
신규장(20),
"epagap 1e9"));
54BufferedWriter 아웃파일 =
신규버퍼링라이터(
신규파일 작성기(로그파일));
55outfile.write(
"epgap 0"); outfile.newLine();
56outfile.write(
"대화형 1"); outfile.newLine();
57outfile.write(
"iafile cplex.op2"); outfile.newLine();
64GAMSOptions opt = ws.
추가옵션();
67opt.setSolveLink( GAMSOptions.ESolveLink.LoadLibrary );
70ByteArrayOutputStream os =
신규ByteArrayOutputStream();
71PrintStream ps =
신규PrintStream(os);
73근로자 w =
신규근로자(직업, 선택, ps);
77 for(Map.Entry<Long, String> 항목 : 단계)
78 긴diffInSeconds =entry.getKey().longValue() - prevStep ;
80System.out.println(
"** 기다리고 있습니다"+ diffInSeconds * 1000+
"밀리초");
81w.join( diffInSeconds * 1000 );
83System.out.println(
"** 예외가 발생했습니다: "+e);
87prevStep = Entry.getKey().longValue();
90BufferedWriter 아웃파일 =
신규버퍼링라이터(
신규파일 작성기(로그파일));
91outfile.write(entry.getValue()); outfile.newLine();
98System.out.println(
"** 새 옵션을 계속하기 위해 Cplex가 중단되었습니다: "+ Entry.getValue());
103}
잡기(InterruptedException e)
106문자열 로그 = os.toString();
107 if(!log.contains(
"중단되었습니다...")) {
108System.out.println(
"** 솔버 로그 **");
109System.out.println(로그);
111System.out.println(
"** 솔버가 적어도 한 번은 중단될 것으로 예상됩니다.");
114System.out.println(
"** 중단되었습니다...");
129 공개노동자(
GAMSJobjb, GAMSOptions 선택, PrintStream 출력)