A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.gams.com/latest/docs/apis/examples_dotnet/Clad_8cs_source.html below:

Clad/Clad.cs Source File

2using

System.Collections.Generic;

8using

System.Diagnostics;

9using

System.Text.RegularExpressions;

29 static int

Main(

string

[] args)

32 if

(Environment.GetCommandLineArgs().Length > 1)

33

ws =

new GAMSWorkspace

(systemDirectory: Environment.GetCommandLineArgs()[1]);

41 using

(StreamWriter outfile =

new

StreamWriter(Path.Combine(ws.

WorkingDirectory

,

"cplex.opt"

)))

44

outfile.WriteLine(

"epgap 0"

);

46

outfile.WriteLine(

"interactive 1"

);

48

outfile.WriteLine(

"iafile cplex.op2"

);

57

StringWriter sw =

new

StringWriter();

60

Thread optThread =

new

Thread(

new

ThreadStart(delegate() { j1.

Run

(output: sw, gamsOptions: opt); }));

64

List<Tuple<int, String>> steps =

new

List<Tuple<int, String>>();

65

steps.Add(

new

Tuple<int, String>(5,

"epgap 0.1"

));

66

steps.Add(

new

Tuple<int, String>(10,

"epgap 0.2"

));

67

steps.Add(

new

Tuple<int, String>(20,

"epagap 1e9"

));

70 foreach

(var s

in

steps)

73 if

(optThread.Join(TimeSpan.FromSeconds(s.Item1 - prevStep)))

77 using

(StreamWriter outfile =

new

StreamWriter(Path.Combine(ws.WorkingDirectory,

"cplex.op2"

)))

78

outfile.WriteLine(s.Item2);

81

Console.WriteLine(

"Interrupted Cplex to continue with new option: "

+ s.Item2);

85 if

(optThread.IsAlive)

89

String log = sw.ToString();

90 if

(!log.Contains(

"Interrupted..."

))

92

Console.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