/******************************************************* Mosel Example Problems ====================== file runfoliocbio.cs ```````````````````` Running a Mosel model from a C# application with data exchange between model and host application during the optimization run. (Passing data via callback) *** The model started by this program cannot be run with a Community Licence for the provided data instance *** (c) 2012 Fair Isaac Corporation author: S. Heipcke, July 2011 J. Farmer, May 2012 ********************************************************/ using System; using System.IO; using Mosel; namespace mosel_examples { // Class to receive solution values of decision variables public class MySolArray { public string ind; // index name public double val; // solution value } public class runfoliocbio { static MySolArray[] solfrac; static MySolArray[] solbuy; static bool ifprint; /*************************************************/ /* A method to initialize model data via callback */ /*************************************************/ /**** Retrieving data from Mosel ****/ public static bool initializeTo(string label, XPRMValue value) { double retsol; int numshares, solcount; XPRMArray solarr; XPRMSet[] sets; int[] indices; int asize, ct; if(label.Equals("FRAC")) { solarr=(XPRMArray)value; asize=solarr.Size; solfrac = new MySolArray[asize]; for(int i=0;i