/********************************************************/ /* Mosel Library Examples */ /* ====================== */ /* */ /* file mmexlst.cs */ /* ``````````````` */ /* Accessing modeling objects */ /* (enumerating the elements of a list) */ /* */ /* (c) 2008 Fair Isaac Corporation */ /* author: J. Farmer */ /********************************************************/ using System; using Mosel; namespace mmexlst { /// /// Records example /// class mmexlstClass { [STAThread] static void Main(string[] args) { /* Initialize Mosel */ XPRM mosel = XPRM.Init(); /* Compile & load the model */ mosel.Compile("Models/euler.mos"); XPRMModel mod = mosel.LoadModel("Models/euler.bim"); /* Run the model */ mod.Run(); /* Get the model object named 'TOUR' */ XPRMList lst = (XPRMList) mod.FindIdentifier("TOUR"); /* Print out all the list elements */ Console.Write("Tour: "); int count=0; foreach (XPRMValue val in lst) { Console.Write(val.AsInteger()); if ((++count) "); } Console.WriteLine(); } } }