TransportEngine.cs
38 GAMSEngineConfiguration engineConf = new GAMSEngineConfiguration(host: Environment.GetEnvironmentVariable("ENGINE_URL"),
58 Dictionary<string, double> expectedLevels = new Dictionary<string, double> { { "seattle.new-york", 0.0 }, { "seattle.chicago", 300.0 }, {"seattle.topeka", 0.0 },
71 tEmodel.RunEngine(engineConf, new HashSet<string> { "tdata.gdx" }, new Dictionary<string, string> { { "inex_string", "{\"type\": \"include\", \"files\": [\"*.gdx\"]}" } }, opt, output: Console.Out);
81 Console.WriteLine("x(" + rec.Key(0) + "," + rec.Key(1) + "): level=" + rec.Level + " marginal=" + rec.Marginal);
84 Console.WriteLine("Unexpected result, expected level: " + expectedLevels[rec.Key(0) + "." + rec.Key(1)].ToString());
117 tEb.RunEngine(engineConf, gamsOptions: opt, checkpoint: cp, output: Console.Out, databases: tEa.OutDB);
126 Console.WriteLine("x(" + rec.Key(0) + "," + rec.Key(1) + "): level=" + rec.Level + " marginal=" + rec.Marginal);
129 Console.WriteLine("Unexpected result, expected level: " + expectedLevels[rec.Key(0) + "." + rec.Key(1)].ToString());
135 bmultExpected[0] = new Dictionary<string, double>() { { "bmult", 0.9 }, { "ms", 1 }, { "ss", 1 }, { "obj", 138.31 } };
136 bmultExpected[1] = new Dictionary<string, double>() { { "bmult", 1.2 }, { "ms", 4 }, { "ss", 1 }, { "obj", 184.41 } };
141 GAMSJob tEbmult = ws.AddJobFromString("bmult=" + scen["bmult"].ToString(CultureInfo.CreateSpecificCulture("en-US")) + "; solve transport min z use lp; ms=transport.modelstat; ss=transport.solvestat;", cp);
149 if (tEbmult.OutDB.GetParameter("bmult").FirstRecord().Value != scen["bmult"]) { Console.WriteLine("Unexpected input, expected bmult: " + scen["bmult"].ToString()); return 1; }
150 if (tEbmult.OutDB.GetParameter("ms").FirstRecord().Value != scen["ms"]) { Console.WriteLine("Unexpected result, expected ms: " + scen["ms"].ToString()); return 1; }
151 if (tEbmult.OutDB.GetParameter("ss").FirstRecord().Value != scen["ss"]) { Console.WriteLine("Unexpected result, expected ss: " + scen["ss"].ToString()); return 1; }
152 if (Math.Round(tEbmult.OutDB.GetVariable("z").FirstRecord().Level,2) != scen["obj"]) { Console.WriteLine("Unexpected result, expected obj: " + scen["obj"].ToString()); return 1; }
193 Thread optThread = new Thread(new ThreadStart(delegate () { jc.RunEngine(engineConf, new HashSet<string> { optFile1Path, optFile2Path, "claddat.gdx" }, gamsOptions: opt, output: logFile); }));
GAMSVariable GetVariable(string variableIdentifier)
GAMSParameter GetParameter(string parameterIdentifier)
string Name
void Export(string filePath=null)
bool Interrupt()
GAMSDatabase OutDB
void RunEngine(GAMSEngineConfiguration engineConfiguration, HashSet< string > extraModelFiles=null, Dictionary< string, string > engineOptions=null, GAMSOptions gamsOptions=null, GAMSCheckpoint checkpoint=null, TextWriter output=null, Boolean createOutDB=true, Boolean removeResults=true, params GAMSDatabase[] databases)
Dictionary< string, string > Defines
ESolveLink
double Value
new GAMSParameterRecord FirstRecord()
string Key(int index)
double Level
double Marginal
new GAMSVariableRecord FirstRecord()
string WorkingDirectory
GAMSJob AddJobFromString(string gamsSource, GAMSCheckpoint checkpoint=null, string jobName=null)
GAMSJob AddJobFromGamsLib(string model, GAMSCheckpoint checkpoint=null, string jobName=null)
GAMSCheckpoint AddCheckpoint(string checkpointName=null)
GAMSOptions AddOptions(GAMSOptions optFrom=null)
This is an example how to run a GAMSJob on GAMS Engine using the run_engine method: How to send along...
Definition: TransportEngine.cs:23
Definition: Transport1.cs:8