로드 중...
검색 중...
일치하는 항목 없음
Interrupt.cs
1사용 중시스템;
2사용 중System.Threading;
3사용 중무료 슬롯;
4
5네임스페이스인터럽트
6{
14 클래스인터럽트
15{
16 정적 무효interruptGams(GAMSJob직업)
17{
18스레드.수면(2000);
19직업.인터럽트();
20}
21
22
23 정적 무효메인(문자열[] 인수)
24{
25부울 nonInteractive =거짓;
26 문자열sysDir =문자열.비어 있음;
27
29 if(2 == Environment.GetCommandLineArgs().Length)
30{
31nonInteractive = String.Equals(Environment.GetCommandLineArgs()[1],"-nonInteractive", StringComparison.OrdinalIgnoreCase);
32 if(!nonInteractive)
33sysDir = Environment.GetCommandLineArgs()[1];
34}
35 그밖에 if(3 == Environment.GetCommandLineArgs().Length)
36{
37nonInteractive = String.Equals(Environment.GetCommandLineArgs()[1],"-nonInteractive", StringComparison.OrdinalIgnoreCase);
38 if(!nonInteractive)
39{
40sysDir = Environment.GetCommandLineArgs()[1];
41nonInteractive = String.Equals(Environment.GetCommandLineArgs()[2],"-nonInteractive", StringComparison.OrdinalIgnoreCase);
42}
43 그밖에
44sysDir = Environment.GetCommandLineArgs()[2];
45}
46
47 if(문자열.비어 있음 != sysDir)
48ws =신규 무료 슬롯작업공간(systemDirectory: sysDir);
49 그밖에
50ws =신규 무료 슬롯작업공간();
51
52 // 해결하는 데 시간이 필요한 모델-솔버 조합을 사용합니다.
53 GAMSJob직업 = ws.AddJobFromGamsLib("서클팩");
55opt.AllModelTypes ="린도";
56
57 if(비대화형)
58{
59 // 2초 후에 GamsJob을 중단하는 스레드를 비동기적으로 시작합니다.
60스레드 waitAndInterrupt =신규스레드(신규ThreadStart(delegate() InterruptGams(job); ));
61waitAndInterrupt.Start();
62}
63 그밖에
64 // 실행 중인 작업에 해당 신호를 보내기 위해 Ctrl+C를 누르는 기본 동작을 변경합니다.
65Console.CancelKeyPress += 위임(객체발신자, ConsoleCancelEventArgs a) 작업.인터럽트(); a.취소 =사실; };
66
67 // 작업을 실행합니다. Ctrl+C를 누르면 무료 슬롯 작업이 중단되지만 이 전체 애플리케이션은 중단되지 않습니다.
68직업.실행(선택, 출력: Console.Out);
69}
70}
71}
void Run(GAMSOptions gamsOptions=null, GAMSCheckpoint 체크포인트=null, TextWriter 출력=null, Boolean createOutDB=true)
GAMSJob AddJobFromGamsLib(문자열 모델, GAMSCheckpoint 체크포인트=null, 문자열 jobName=null)
GAMSOptions AddOptions(GAMSOptions optFrom=null)