FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Folio - Advanced modelling and solving tasks

Description
Advanced modelling and solving tasks for a portfolio optimization problem:
  • Automated solver tuning (foliolptune.mos)
  • Defining an integer solution callback (foliocb.mos, callback specification by name: foliocbm.mos; using an 'mpsol' object: foliocb_sol.mos)
  • Using the solution enumerator for multiple MIP solutions (folioenumsol.mos)
  • Handling infeasibility
    • handling infeasibility through deviation variables (folioinfeas.mos)
    • retrieving infeasible row/column from presolve (folioinfcause.mos)
    • retrieving IIS - LP, MIP, NLP infeasible (folioiis.mos, foliomiis.mos, folionliis.mos)
    • using the built-in infeasibility repair functionality (foliorep.mos)
    • same as foliorep, using an 'mpsol' object (foliorep_sol.mos)
  • Data transfer in memory
    • running foliomemio.mos with data transfer in memory (runfolio.mos)
    • same running foliomemio2.mos, grouping tables with identical index sets in "initializations" blocks (runfolio2.mos)
    • main model running several model instances in parallel (runfoliopar.mos)
  • Remote models on a distributed architecture
    • running foliomemio.mos on a remote instance of Mosel (runfoliodistr.mos)
    • main model running several model instances in parallel, each on a different (remote) instance of Mosel (runfoliopardistr.mos)
  • Remote execution via XPRD
    • See examples in the Mosel Whitepapers directory moselpar/XPRD
  • XML and JSON data formats
    • reading data from an XML file, solution output in XML format on screen and to a new file (folioxml.mos, folioxmlqp.mos)
    • generate HTML output file as an XML document (runfolioxml.mos)
    • using JSON-format data files, reading data from a JSON file, solution output in JSON format on screen and to a new file (foliojson.mos)
  • HTTP
    • starting an HTTP server managing requests from HTTP clients (foliohttpsrv.mos)
    • HTTP client exchanging XML data files with an HTTP server (foliohttpclient.mos)


Source Files

Data Files





folio.json

{
 "share":[
   {"name":"treasury", "ret":"5", "dev":"0.1", "country":"Canada", "region":"NA", "risk":"low"}, 
   {"name":"hardware", "ret":"17", "dev":"19", "country":"USA", "region":"NA", "risk":"high"}, 
   {"name":"theater", "ret":"26", "dev":"28", "country":"USA", "region":"NA", "risk":"high"}, 
   {"name":"telecom",  "ret":"12", "dev":"22", "country":"USA", "region":"NA", "risk":"high"},
   {"name":"brewery",  "ret":"8", "dev":"4", "country":"UK", "region":"Europe", "risk":"low"},
   {"name":"highways", "ret":"9", "dev":"3.5", "country":"UK", "region":"Europe", "risk":"low"}, 
   {"name":"cars",  "ret":"7", "dev":"5", "country":"Germany", "region":"Europe", "risk":"low"},
   {"name":"bank", "ret":"6", "dev":"0.5", "country":"Luxemburg", "region":"Europe", "risk":"low"}, 
   {"name":"software", "ret":"31", "dev":"25", "country":"India", "region":"Asia", "risk":"high"}, 
   {"name":"electronics", "ret":"21", "dev":"16", "country":"Japan", "region":"Asia", "risk":"high"} ],
   
 "share2":[
   ["treasury", "5", "0.1", "Canada", "NA", "low"], 
   ["hardware", "17", "19", "USA", "NA", "high"], 
   ["theater", "26", "28", "USA", "NA", "high"], 
   ["telecom",  "12", "22", "USA", "NA", "high"],
   ["brewery",  "8", "4", "UK", "Europe", "low"],
   ["highways", "9", "3.5", "UK", "Europe", "low"], 
   ["cars",  "7", "5", "Germany", "Europe", "low"],
   ["bank", "6", "0.5", "Luxemburg", "Europe", "low"], 
   ["software", "31", "25", "India", "Asia", "high"], 
   ["electronics", "21", "16", "Japan", "Asia", "high"] ] 
}

Back to examples browserPrevious exampleNext example