insightdispatch
insightdispatch |
Purpose
Synopsis
procedure insightdispatch
Example
!@insight.execmodes.LOAD public procedure myproc1 ! Scenario is being 'loaded' through Xpress Insight ! Call user function to initialize input data and then terminate loaddata end-procedure !@insight.execmodes.RUN public procedure myproc2 ! Scenario is being 'run' through Xpress Insight ! Populate with Insight scenario data then call user function to solve model insightpopulate solvemodel end-procedure !@insight.execmodes.MY_CUSTOM_EXECUTION_MODE public procedure myproc3 ! This would be an execution mode defined with an @insight.execmodes ! annotation, to indicate some custom behavior insightpopulate ! Now take whatever custom action is appropriate... end-procedure !@insight.execmodes.NONE public procedure myproc4 ! Model is being run outside of Xpress Insight ! Call user function to initialize input data and call user function to solve model loaddata solvemodel end-procedure insightdispatch
Example of the basic flow of an Insight model, calling
loaddata to populate the input data entities when the scenario is loaded or the model is run from outside of Insight, and
insightpopulate to populate them when scenario is run within Insight.
Further information
This procedure can be used instead of a case statement on
insightgetmode; instead you annotate a procedure to call for each for each execution mode then call
insightdispatch. When you call
insightdispatch, Insight will expect to find a single, no-argument procedure with the
!@insight.execmodes.NAME annotation for each execution mode. At a minimum, if you use
insightdispatch you should have procedures annotated
@insight.execmodes.LOAD and
@insight.execmodes.RUN to accomodate the two default execution modes.