System.Collections.Generic;
8usingSystem.Diagnostics;
9usingSystem.Text.RegularExpressions;
29 static intMain(
string[] args)
32 if(Environment.GetCommandLineArgs().Length > 1)
33ws =
new GAMSWorkspace(systemDirectory: Environment.GetCommandLineArgs()[1]);
41 using(StreamWriter outfile =
newStreamWriter(Path.Combine(ws.
WorkingDirectory,
"cplex.opt")))
44outfile.WriteLine(
"epgap 0");
46outfile.WriteLine(
"interactive 1");
48outfile.WriteLine(
"iafile cplex.op2");
57StringWriter sw =
newStringWriter();
60Thread optThread =
newThread(
newThreadStart(delegate() { j1.
Run(output: sw, gamsOptions: opt); }));
64List<Tuple<int, String>> steps =
newList<Tuple<int, String>>();
65steps.Add(
newTuple<int, String>(5,
"epgap 0.1"));
66steps.Add(
newTuple<int, String>(10,
"epgap 0.2"));
67steps.Add(
newTuple<int, String>(20,
"epagap 1e9"));
70 foreach(var s
insteps)
73 if(optThread.Join(TimeSpan.FromSeconds(s.Item1 - prevStep)))
77 using(StreamWriter outfile =
newStreamWriter(Path.Combine(ws.WorkingDirectory,
"cplex.op2")))
78outfile.WriteLine(s.Item2);
81Console.WriteLine(
"Interrupted Cplex to continue with new option: "+ s.Item2);
85 if(optThread.IsAlive)
89String log = sw.ToString();
90 if(!log.Contains(
"Interrupted..."))
92Console.WriteLine(
"Expected the solver to be interrupted at least once.");
void Run(GAMSOptions gamsOptions=null, GAMSCheckpoint checkpoint=null, TextWriter output=null, Boolean createOutDB=true)
GAMSJob AddJobFromGamsLib(string model, GAMSCheckpoint checkpoint=null, string jobName=null)
GAMSOptions AddOptions(GAMSOptions optFrom=null)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4