Transport9.cs
39 Console.WriteLine("x(" + rec.Key(0) + "," + rec.Key(1) + "): level=" + rec.Level + " marginal=" + rec.Marginal);
46 static void ReadSet(OleDbConnection connect, GAMSDatabase db, string strAccessSelect, string setName, int setDim, string setExp = "")
74 Console.WriteLine("Error: Failed to retrieve the required data from the database.\n{0}", ex.Message);
83 static void ReadParameter(OleDbConnection connect, GAMSDatabase db, string strAccessSelect, string parName, int parDim, string parExp = "")
111 Console.WriteLine("Error: Failed to retrieve the required data from the database.\n{0}", ex.Message);
126 string strAccessConn = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Path.Combine(ws.SystemDirectory, @"apifiles/Data/transport.accdb");
143 ReadParameter(connection, db, "SELECT Plant,Capacity FROM Plant", "a", 1, "capacity of plant i in cases");
144 ReadParameter(connection, db, "SELECT Market,Demand FROM Market", "b", 1, "demand at market j in cases");
145 ReadParameter(connection, db, "SELECT Plant,Market,Distance FROM Distance", "d", 2, "distance in thousands of miles");
150 static void WriteVariable(OleDbConnection connect, GAMSDatabase db, string varName, params string[] Domains)
208 string strAccessConn = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Path.Combine(ws.SystemDirectory, @"apifiles/Data/transport.accdb");
GAMSVariable GetVariable(string variableIdentifier)
GAMSSet AddSet(string identifier, int dimension, string explanatoryText="", SetType setType=SetType.multi)
string Name
GAMSParameter AddParameter(string identifier, int dimension, string explanatoryText="")
void Run(GAMSOptions gamsOptions=null, GAMSCheckpoint checkpoint=null, TextWriter output=null, Boolean createOutDB=true)
Dictionary< string, string > Defines
double Value
new GAMSParameterRecord AddRecord(params string[] keys)
new GAMSSetRecord AddRecord(params string[] keys)
string Key(int index)
string[] Keys
int Dim
double Marginal
GAMSJob AddJobFromString(string gamsSource, GAMSCheckpoint checkpoint=null, string jobName=null)
string SystemDirectory
GAMSDatabase AddDatabase(string databaseName=null, string inModelName=null)
GAMSOptions AddOptions(GAMSOptions optFrom=null)
This is the 9th model in a series of tutorial examples. Here we show: How to fill a GAMSDatabase by r...
Definition: Transport9.cs:20
Definition: Transport1.cs:8