FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserNext example

Folio - Embedding examples from 'Getting started'

Simple embedding tasks for a portfolio optimization problem:
  • loading and running a BIM file (foliorun.cs)
  • executing a Mosel model (folioexec.cs)
  • parameterized model execution (folioparam.cs)
  • exporting a matrix (foliomat.cs)
  • accessing model results (folioobj.cs)
  • data exchange in memory (runfolio.cs,runfoliob.cs)
  • retrieving solution output from Optimizer callbacks in foliocbio.mos during optimization (runfoliocbio.cs)[download all files]

Source Files

Data Files


  Mosel Library Example Problems

  file foliorun.cs
  Loading and running a BIM file.

  (c) 2009 Fair Isaac Corporation
      author: J.Farmer, Jun. 2009, rev. May. 2021

using System;
using System.IO;
using Mosel;

namespace mosel_getting_started {
 public class foliorun
  public static void Main(string[] args)
   XPRM mosel;
   XPRMModel mod;
   mosel = XPRM.Init();                        // Initialize Mosel
   mosel.WorkDir = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).FullName;
                                              // Set Mosel work directory to folder containing our example files
   mod = mosel.LoadModel("foliodata.bim");     // Load compiled model
   Console.WriteLine("`foliodata' returned: " + mod.Result);

Back to examples browserNext example