Initializing help system before first use

Xpress Insight Model Requirements

Mosel model developers must implement several behaviors in a model to use it in Xpress Insight.
  • Load the mminsight package which includes the mminsight.dso Mosel module and implements the necessary interactions between Xpress Insight and the model.
  • The model must implement the LOAD mode by writing model code to initialize all managed model entities. The execution of this loading code must be conditional on insightgetmode = INSIGHT_MODE_LOAD. Any calls to finalize must be included in the loading code.
  • The model must implement the RUN mode. The execution of this code must be conditional on insightgetmode = INSIGHT_MODE_RUN and begin with a call to insightpopulate. The RUN mode code will typically include statements to construct the model from the scenario data, optimize it and process results.
  • Replace any call to minimize and maximize with insightminimize and insightmaximize.
  • Only entities declared as public (the entity type declaration or the entire declaration block prefixed by the public keyword) will be visible to Insight, irrespective of how the model is compiled. Private entities would be visible in versions of Xpress insight earlier than 4.50 if the model was compiled without the -s option to strip private symbols. Neither Workbench or (legacy)IVE editors apply the -s option by default.
    Note Developers migrating an older app to Insight 4.50 should mark all entities as public to avoid the upgrade being rejected. If some entities being marked as public are not strictly required then they can be excluded with the manage=ignore annotation or by removing the public keyword in a future upgrade.
A typical model will have the following basic structure:
model mymodel
uses "mminsight"
uses "mmxprs"
forward procedure datainput
case insightgetmode of
  INSIGHT_MODE_LOAD: do  
    datainput
    exit(0) ! Stop after data initialization
  end-do
  INSIGHT_MODE_RUN:
    insightpopulate ! Inject scenario data and continue
else
  datainput ! Default (non-Xpress Insight): initialize data and continue
end-case

! load input data
procedure datainput
  writeln("loading data")
end-procedure

! create model constraints
! optimize
! post-process results

end-model

The case statement (equivalent to if .. else if .. else) implements the flow control for each mode. The RUN mode logic in the example above is implemented in the global scope of the model after the case statement. Larger models often encapsulate the RUN mode logic in one or more procedures called from the case statement.

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.