/********************************************************/ /* Mosel Library Examples */ /* ====================== */ /* */ /* file mmexlib.cs */ /* ``````````````` */ /* Example for the use of the Mosel libraries */ /* (working with models and accessing the dynamic */ /* libraries loaded by Mosel) */ /* */ /* (c) 2008 Fair Isaac Corporation */ /* author: J.Farmer / S. Heipcke */ /********************************************************/ using System; using Mosel; namespace mmexlib { public class mmexlibClass { /// /// Main entry point for the application /// [STAThread] static void Main(string[] args) { XPRM mosel; XPRMModel[] mods = new XPRMModel[3]; // Initialise Mosel mosel = XPRM.Init(); // Load the BIM files mods[0] = mosel.LoadModel("Models/burglari.bim"); mods[1] = mosel.LoadModel("Models/chess2.bim"); mods[2] = mosel.LoadModel("Models/trans.bim"); Console.WriteLine("Models loaded"); // Display basic information about the models foreach (XPRMModel m in mods) { Console.WriteLine( " {0}: {1} ({2}, `{3}' size:{4})", m.Number, m.Name, m.SysComment, m.UserComment, m.Size ); } Console.WriteLine(); // Enumerate all loaded modules and display information Console.WriteLine("Additional libraries loaded:"); foreach (XPRMModule mo in mosel.Modules) { Console.WriteLine( " {0} (version {1}) used by {2} model(s)", mo.Name, mo.Version, mo.NumberOfReferences ); } } } }