Initializing help system before first use

VB.NET (Windows only)


Type: Programming
Rating: 3 (intermediate)
Description: ExSet.vb: Using sets in Mosel (requires burglari.mos)
  • retrieve a set by its model name
  • get the set size
  • get first and last set element
  • get the name or index of a set element
ExAs.vb: Using arrays with index sets (requires trans.mos)
  • get indexing sets of an array
  • get array type
  • enumerate array entries in usual and transposed order
  • enumerate true array entries
ExProb.vb: Accessing problems and solution information with Mosel (requires blend2.mos)
  • export problem to a file (MPS or LP format)
  • get problem status
  • get objective function value
  • get primal/dual solution values, and constraint activity
ExLib.vb: Working with models and accessing dynamic libraries in Mosel
  • load and unload BIM models
  • run a model in Mosel
  • display information about loaded models
  • display information about additional libraries required by the loaded models
DispMod.vb: Display the contents of a model; the information is read from a bim file
  • display run-time parameters, requirements, symbols, package/module dependencies, annotations
DispDso.vb: Display the contents of a module
  • display constants, types, control paramters, subroutines, I/O drivers
ExDrvs*.cb.: Use I/O drivers to handle Mosel output with a callback function, compile a model from memory to memory, load a bim file from memory, initialise arrays in the Model program from .NET objects and retrieve information from the model through memory.
  • ExDrvsCallback.vb: using 'dotnet:' I/O driver for data exchange via callbacks
  • ExDrvsRaw.vb: using 'dotnetraw:' I/O driver for data exchange in memory
  • ExDrvsStream.vb: using 'dotnetstream:' I/O driver working with streams for data exchange in memory
These .vb files can be run from the VB.NET project Mosel-VB.NET.vbproj (required auxiliary files: frmMain.vb, frmMain.resx, OptimizerLog.vb).
File(s): ExSet.vb, ExAs.vb, ExProb.vb, ExLib.vb, DispMod.vb, DispDso.vb, ExDrvsCallback.vb, ExDrvsRaw.vb, ExDrvsStream.vb, OptimizerLog.vb, frmMain.vb, frmMain.resx, Mosel-VB.NET.vbproj
Data file(s): burglari.mos, trans.mos, blend2.mos, chess2.mos

ExSet.vb
Imports System.IO
Imports Mosel

' Example of accessing sets in Mosel
Module ExSet

    Public Sub RunExSet(ByVal Log As TextWriter)
        Dim mosel As XPRM
        Dim model As XPRMModel
        Dim mySet As XPRMSet
        Dim first, last, i As Integer

        ' Initialise Mosel
        mosel = XPRM.Init
        ' Set Mosel work directory to folder containing our example source code
        mosel.WorkDir = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly.Location).FullName
        ' Compile and load model
        model = mosel.CompileAndLoad("Models/burglari.mos")
        ' And run it
        model.Run()

        ' Get the model object named 'ITEMS'
        ' (it must be a set)
        mySet = model.FindIdentifier("ITEMS")

        If (Not mySet.IsEmpty) Then
            ' Items in a set are indexed by numbers
            ' So get the first and last indexes
            first = mySet.FirstIndex
            last = mySet.LastIndex
            Log.WriteLine("Elements of set ITEMS:")
            For i = first To last
                Log.Write(" {0}, ", mySet.GetAsString(i))
            Next
            Log.WriteLine()

            ' We've written this out explicitly to demonstrate set access, but the
            ' set actually knows how to output itself.  Uncomment the following line
            ' to see this in action
            ' Log.WriteLine(mySet.ToString)

            If (mySet.GetIndex("CD player") < 0) Then
                Log.WriteLine("'CD player' is not contained in 'ITEMS'")
            End If

        End If
    End Sub

End Module

ExAs.vb
Imports System.IO
Imports Mosel

' Example of using arrays with index sets; different ways of enumerating arrays

Module ExAs
    Public Sub RunExAs(ByVal Log As TextWriter)
        Dim mosel As XPRM
        Dim model As XPRMModel
        Dim varr As XPRMArray
        Dim sets() As XPRMSet
        Dim vindex() As XPRMValue
        Dim indices() As Integer
        Dim dimensions As Integer
        Dim i As Integer

        ' Initialise Mosel
        mosel = XPRM.Init
        ' Set Mosel work directory to folder containing our example source code
        mosel.WorkDir = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly.Location).FullName

        ' Compile and load a MOS file
        model = mosel.CompileAndLoad("Models/trans.mos")
        ' Run the model
        model.Run()

        ' Get the model object named 'x'
        ' It must be an array
        varr = model.FindIdentifier("x")
        ' Get the number of dimensions of the array
        dimensions = varr.Dim
        ' Get the indexing sets
        sets = varr.IndexSets

        ' We could use varr.ToString to obtain a summary of the array contents,
        ' but instead we'll demonstrate how to interate over the array's content
        ' directly
        Log.WriteLine("1. Logic entries:")
        ' Get the first entry of varr
        For Each indices In varr.Indices
            Log.Write("x(")
            ' Get the values for this index
            vindex = varr.DereferenceIndex(indices)
            ' Now, output them.  Note that we could call the utility method
            ' varr.IndexToString(indices) instead of doing all this, but again
            ' this wouldn't be such a useful demonstration
            If (dimensions > 1) Then
                For i = 0 To dimensions - 2
                    Log.Write(vindex(i).AsString & ",")
                Next
            End If
            Log.Write(vindex(dimensions - 1).AsString & "), ")
        Next
        Log.WriteLine()

        ' Now enumerate over the true entries - in a dense array this would
        ' be no different from the previous demonstration, so only do it for
        ' a dynamic array
        If (varr.IsDynamic) Then
            Log.WriteLine("2. True entries:")
            For Each indices In varr.TEIndices
                ' Functionally the same as above, but this time we'll demonstrate
                ' using IndexToStringrasExAs
                Log.Write("x" & varr.IndexToString(indices) & ", ")
            Next
        End If
        Log.WriteLine()

        model.Reset()
    End Sub

End Module

ExProb.vb
Imports System.IO
Imports Mosel

' Example of accessing problems and solution information

Module ExProb
    Public Sub RunExProb(ByVal Log As TextWriter)
        Dim mosel As XPRM
        Dim model As XPRMModel
        Dim varr, darr As XPRMArray
        Dim lgrade As XPRMLinCtr

        ' Initialise Mosel
        mosel = XPRM.Init
        ' Set Mosel work directory to folder containing our example source code
        mosel.WorkDir = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly.Location).FullName
        ' Compile and load model
        model = mosel.CompileAndLoad("Models/blend2.mos")
        ' Run the model (it includes optimization)
        model.Run()

        ' Export the problem to a file in LP format (maximization)
        model.ExportProblem("p", "blend")

        ' Test whether optimal is found
        If (model.ProblemStatus = XPRMProblemStatus.PB_OPTIMAL) Then
            Log.WriteLine("Solution is optimal.")
        End If

        ' Print out the objective function value
        Log.WriteLine("Objective value: {0}", model.ObjectiveValue)

        ' Get the model objects 'x' and 'COST' (both arrays)
        varr = model.FindIdentifier("x")
        darr = model.FindIdentifier("COST")

        ' For each entry in array var, display solution value and corresponding
        ' cost
        Dim indices() As Integer
        For Each indices In varr.Indices
            Log.WriteLine( _
                "x{0}={1} (COST: {2})", _
                varr.IndexToString(indices), _
                varr.Get(indices).AsMPVar.Solution, _
                darr.GetAsReal(indices) _
            )
        Next

        ' Get the model object 'LoGrade'
        ' It must be a reference to a linear constraint
        lgrade = CType(model.FindIdentifier("LoGrade"), XPRMReference).Value.AsLinCtr
        Log.WriteLine( _
            "LoGrade: activity={0}, dual={1}", _
            lgrade.Activity, _
            lgrade.Dual _
        )

        model.Reset()
    End Sub
End Module

ExLib.vb
Imports System.IO
Imports Mosel

' Example of working with models and accessing Mosel dynamic libraries

Module ExLib
    Public Sub RunExLib(ByVal Log As TextWriter)
        Dim mosel As XPRM
        Dim models(2) As XPRMModel

        ' Initialise Mosel
        mosel = XPRM.Init
        ' Set Mosel work directory to folder containing our example source code
        mosel.WorkDir = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly.Location).FullName
        ' Compile and Load the BIM files
        models(0) = mosel.CompileAndLoad("Models/burglari.mos")
        models(1) = mosel.CompileAndLoad("Models/chess2.mos")
        models(2) = mosel.CompileAndLoad("Models/trans.mos")
        Log.WriteLine("Models loaded")

        ' Display basic information about the models
        Dim model As XPRMModel
        For Each model In models
            Log.WriteLine("  {0}: {1} ({2}, '{3}' size:{4})", _
                model.Number, model.Name, model.SysComment, _
                model.UserComment, model.Size)
        Next
        Log.WriteLine()

        ' Enumerate all loaded modules and display information
        Log.WriteLine("Additional libraries loaded:")
        Dim mo As XPRMModule
        For Each mo In mosel.Modules
            Log.WriteLine( _
                "  {0} (version {1}) used by {2} model(s)", _
                mo.Name, mo.Version, mo.NumberOfReferences)
        Next
    End Sub
End Module

DispMod.vb
Imports System.IO
Imports Mosel

' Displays the contents of a model

Module DispMod
    Public Sub RunDispMod(ByVal ModName As String, ByVal Log As TextWriter)
        Dim mosel As XPRM
        Dim model As XPRMModel
        Dim proc As XPRMProcedure

        ' Initialize Mosel and load the model
        mosel = XPRM.Init
        ' Set Mosel work directory to folder containing our example source code
        mosel.WorkDir = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly.Location).FullName

        Log.WriteLine("Compiling model {0}", ModName)
        model = mosel.CompileAndLoad(ModName)
        Log.WriteLine()

        ' List model parameters
        Dim p As XPRMParameter
        Log.WriteLine("Model parameters:")
        For Each p In model.Parameters
            Log.WriteLine(" {0}", p.Name)
        Next
        Log.WriteLine()

        ' List symbols
        Log.WriteLine("Symbols:")
        Dim symb As XPRMIdentifier
        For Each symb In model.Identifiers
            Select Case symb.StructCode

                Case XPRMVarStruct.CONST ' Constant: display value
                    Log.WriteLine(" {0}={1}", symb.Name, symb)

                Case XPRMVarStruct.REF ' Reference: display type
                    Log.WriteLine(" {0}: {1}", symb.Name, symb.TypeName)

                Case XPRMVarStruct.ARRAY ' Array: display type
                    Log.WriteLine(" {0}: array of {1}", symb.Name, symb.TypeName)

                Case XPRMVarStruct.SET ' Set: display type
                    Log.WriteLine(" {0}: set of {1}", symb.Name, symb.TypeName)

                Case XPRMVarStruct.PROC ' Subroutine
                    proc = CType(symb, XPRMProcedure)
                    Do ' look for all overloading procedures/functions
                        dispProcFct(proc, Log) ' display the prototype
                        proc = proc.Next
                    Loop While (Not proc Is Nothing)

                Case Else ' Unknown
                    Log.WriteLine(" {0}: ?", symb.Name)

            End Select
        Next
    End Sub

    ' Display a prototype from a signature
    Private Function dispProcFct(ByVal proc As XPRMProcedure, ByVal log As TextWriter)
        Dim parms() As Char
        Dim i As Integer

        If (proc.TypeCode <> XPRMVarType.NOT) Then
            Log.Write(" function {0}", proc.Name)
        Else
            Log.Write(" procedure {0}", proc.Name)
        End If

        If (proc.NbParameters > 0) Then
            Log.Write("(")
            parms = proc.ParameterTypes.ToCharArray
            i = 0
            Do While (i < parms.Length)
                If (i > 0) Then
                    Log.Write(",")
                End If
                i = dispType(i, parms, Log) + 1
            Loop
            Log.Write(")")
        End If

        If (proc.TypeCode <> XPRMVarType.NOT) Then
            Log.Write(":{0}", proc.TypeName)
        End If
        Log.WriteLine()
    End Function


    ' Display a type name from a signature
    Private Function dispType(ByVal i As Integer, ByVal parms As Char(), ByVal log As TextWriter)
        Dim j As Integer
        Select Case parms(i)
            Case "i"
                log.Write("integer")
            Case "r"
                log.Write("real")
            Case "s"
                log.Write("string")
            Case "b"
                log.Write("boolean")
            Case "v"
                log.Write("mpvar")
            Case "c"
                log.Write("linctr")
            Case "I"
                log.Write("range")
            Case "a"
                log.Write("array")
            Case "e"
                log.Write("set")
            Case "|"
                i = i + 1
                Do
                    log.Write(parms(i))
                    i = i + 1
                Loop While (parms(i) <> "|")
            Case "!"
                i = i + 1
                Do
                    log.Write(parms(i))
                    i = i + 1
                Loop While (parms(i) <> "!")
            Case "A"
                log.Write("array (")
                i = i + 1
                j = i
                Do While (parms(i) <> ".")
                    If (j <> i) Then
                        log.Write(",")
                    End If
                    i = dispType(i, parms, log) + 1
                Loop
                log.Write(") of ")
                i = dispType(i + 1, parms, log)
            Case "E"
                log.Write("set of ")
                i = i + 1
                i = dispType(i, parms, log)
            Case Else
                log.Write("?")
        End Select
        Return i
    End Function
End Module

DispDso.vb
Imports System.IO
Imports Mosel

' Displays information about a Mosel DSO module

Module DispDso
    Public Sub RunDispDso(ByVal ModName As String, ByVal log As TextWriter)
        log.WriteLine("Will interrogate module '{0}'", ModName)

        Dim mosel As XPRM
        Dim ourModule As XPRMModule

        ' Initialise Mosel
        mosel = XPRM.Init

        ' Load the module
        ourModule = mosel.LoadModule(ModName)

        ' Output basic information about the module
        log.WriteLine("Module '{0}', version {1}", ourModule.Name, ourModule.Version)
        If ((Not ourModule.Certificate Is Nothing) And (ourModule.Certificate.Length > 0)) Then
            log.WriteLine(" ({0})", ourModule.Certificate)
        Else
            log.WriteLine("")
        End If
        log.WriteLine()

        ' Output a list of types defined within the module
        log.WriteLine("Types:")
        Dim nt As XPRMNativeType
        For Each nt In ourModule.Types
            log.WriteLine(" {0} (", nt.Name)
            If (nt.HasCreate) Then
                log.Write("create")
            End If
            If (nt.HasDelete) Then
                log.Write(",delete")
            End If
            If (nt.HasToString) Then
                log.Write(",tostring")
            End If
            If (nt.HasPRTBL) Then
                log.Write("+")
            End If
            If (nt.HasFromString) Then
                log.Write(",fromstring")
            End If
            log.WriteLine()
        Next
        log.WriteLine()

        ' List of control parameters
        log.WriteLine("Control Parameters:")
        Dim p As XPRMParameter
        For Each p In ourModule.Parameters
            log.Write(" {0}: {1} (", p.Name, p.TypeName)
            If (Not p.Description Is Nothing And p.Description.Length > 0) Then
                log.Write("{0},", p.Description)
            End If
            log.WriteLine(rwstatus(p) + ")")
        Next
        log.WriteLine()

        ' List of subroutines
        log.WriteLine("Procedures and Functions:")
        Dim proc As XPRMProcedure
        For Each proc In ourModule.Procedures
            dispProcFct(proc, log)
        Next
        log.WriteLine()

        ' List of IO drivers
        log.WriteLine("I/O drivers:")
        Dim iod As XPRMIODriver
        For Each iod In ourModule.IODrivers
            log.WriteLine(" {0}:{1}", iod.Name, IIf(Not iod.Info Is Nothing, iod.Info, ""))
        Next

    End Sub

    ' Return the r/w status of a control parameter
    Private Function rwstatus(ByVal p As XPRMParameter) As String
        If (p.IsReadable) Then
            If (p.IsWriteable) Then
                Return "r/w"
            Else
                Return "r"
            End If
        Else
            If (p.IsWriteable) Then
                Return "w"
            Else
                Return "?"
            End If
        End If
    End Function


    ' Display a prototype from a signature
    Private Function dispProcFct(ByVal proc As XPRMProcedure, ByVal log As TextWriter)
        Dim parms() As Char
        Dim i As Integer

        If (proc.TypeCode <> XPRMVarType.NOT) Then
            log.Write(" function {0}", proc.Name)
        Else
            log.Write(" procedure {0}", proc.Name)
        End If

        If (proc.NbParameters > 0) Then
            log.Write("(")
            parms = proc.ParameterTypes.ToCharArray
            i = 0
            Do While (i < parms.Length)
                If (i > 0) Then
                    log.Write(",")
                End If
                i = dispType(i, parms, log) + 1
            Loop
            log.Write(")")
        End If

        If (proc.TypeCode <> XPRMVarType.NOT) Then
            log.Write(":{0}", proc.TypeName)
        End If
        log.WriteLine()
    End Function


    ' Display a type name from a signature
    Private Function dispType(ByVal i As Integer, ByVal parms As Char(), ByVal log As TextWriter)
        Dim j As Integer
        Select Case parms(i)
            Case "i"
                log.Write("integer")
            Case "r"
                log.Write("real")
            Case "s"
                log.Write("string")
            Case "b"
                log.Write("boolean")
            Case "v"
                log.Write("mpvar")
            Case "c"
                log.Write("linctr")
            Case "I"
                log.Write("range")
            Case "a"
                log.Write("array")
            Case "e"
                log.Write("set")
            Case "|"
                i = i + 1
                Do
                    log.Write(parms(i))
                    i = i + 1
                Loop While (parms(i) <> "|")
            Case "!"
                i = i + 1
                Do
                    log.Write(parms(i))
                    i = i + 1
                Loop While (parms(i) <> "!")
            Case "A"
                log.Write("array (")
                i = i + 1
                j = i
                Do While (parms(i) <> ".")
                    If (j <> i) Then
                        log.Write(",")
                    End If
                    i = dispType(i, parms, log) + 1
                Loop
                log.Write(") of ")
                i = dispType(i + 1, parms, log)
            Case "E"
                log.Write("set of ")
                i = i + 1
                i = dispType(i, parms, log)
            Case Else
                log.Write("?")
        End Select
        Return i
    End Function
End Module

ExDrvsCallback.vb
'********************************************************
'*  Mosel Library Examples                              *
'*  ======================                              *
'*                                                      *
'*  file ExDrvsCallback.vb                              *
'*  ```````````````````                                 *
'*  Example for the use of the Mosel libraries          *
'*  (using dotnet: I/O driver for data exchange via     *
'*  callbacks                                           *
'*                                                      *
'*  (c) 2011 Fair Isaac Corporation                     *
'*      author: J.Farmer, Y. Colombani, 2011            *
'********************************************************

Imports System
Imports System.IO
Imports Mosel

Module ExDrvsCallback

    Private OutputLog As TextWriter

    ' Define the Mosel source of our model
    Private source_of_model As String = _
      "model tstcb" & vbCrLf & _
      "uses 'mmsystem'" & vbCrLf & _
      "parameters" & vbCrLf & _
      " ICB_INITFROM=''" & vbCrLf & _
      " ICB_INITTO=''" & vbCrLf & _
      "end-parameters" & vbCrLf & _
 _
      "public declarations" & vbCrLf & _
      " v_i:integer" & vbCrLf & _
      " v_r:real" & vbCrLf & _
      " v_s:string" & vbCrLf & _
      " v_b:boolean" & vbCrLf & _
      " v_d:date" & vbCrLf & _
 _
      " s_i:set of integer" & vbCrLf & _
      " l_i:list of integer" & vbCrLf & _
 _
      " s_d:set of date" & vbCrLf & _
      " l_d:list of date" & vbCrLf & _
 _
      " a_i:array(range) of integer" & vbCrLf & _
      " Rx:range" & vbCrLf & _
      " a_s:array(Rx) of string" & vbCrLf & _
      " a_r:array(Rx) of real" & vbCrLf & _
 _
      " R=record" & vbCrLf & _
      "    public i:integer" & vbCrLf & _
      "    public s:set of integer" & vbCrLf & _
      "   end-record" & vbCrLf & _
      " r:R" & vbCrLf & _
      " a_R:array(range) of R" & vbCrLf & _
      "end-declarations" & vbCrLf & _
 _
      "initialisations from ICB_INITFROM" & vbCrLf & _
      " v_i" & vbCrLf & _
      " v_r" & vbCrLf & _
      " v_s" & vbCrLf & _
      " v_b" & vbCrLf & _
      " v_d" & vbCrLf & _
 _
      " s_i" & vbCrLf & _
      " l_i" & vbCrLf & _
 _
      " s_d" & vbCrLf & _
      " l_d" & vbCrLf & _
 _
      " a_i" & vbCrLf & _
      " [a_s,a_r] as 'ax'" & vbCrLf & _
 _
      " r" & vbCrLf & _
      " a_R" & vbCrLf & _
      "end-initialisations" & vbCrLf & _
 _
      " writeln('v_i=',v_i)" & vbCrLf & _
      " writeln('v_r=',v_r)" & vbCrLf & _
      " writeln('v_s=',v_s)" & vbCrLf & _
      " writeln('v_b=',v_b)" & vbCrLf & _
      " writeln('v_d=',v_d)" & vbCrLf & _
      " writeln('s_i=',s_i)" & vbCrLf & _
      " writeln('l_i=',l_i)" & vbCrLf & _
      " writeln('s_d=',s_d)" & vbCrLf & _
      " writeln('l_d=',l_d)" & vbCrLf & _
      " writeln('a_i=',a_i)" & vbCrLf & _
      " writeln('a_r=',a_r)" & vbCrLf & _
      " writeln('a_s=',a_s)" & vbCrLf & _
      " writeln('r=',r)" & vbCrLf & _
      " writeln('a_R=',a_R)" & vbCrLf & _
 _
      "initialisations to ICB_INITTO" & vbCrLf & _
      " v_i" & vbCrLf & _
      " v_r" & vbCrLf & _
      " v_s" & vbCrLf & _
      " v_b" & vbCrLf & _
      " v_d" & vbCrLf & _
 _
      " s_i" & vbCrLf & _
      " l_i" & vbCrLf & _
 _
      " s_d" & vbCrLf & _
      " l_d" & vbCrLf & _
 _
      " a_i" & vbCrLf & _
 _
      " r" & vbCrLf & _
      " a_R" & vbCrLf & _
      "end-initialisations" & vbCrLf & _
      "end-model"


    ' A function to initialize the Mosel data-structures via callback
    Private Function initializeFrom(ByVal ictx As XPRMInitializeContext, ByVal label As String, ByVal type As XPRMTyped) As Boolean

        Try

            Select Case label
                Case "v_i" ' v_i:999
                    ictx.Send(999)
                    Return True

                Case "v_r" ' v_r:999.99
                    ictx.Send(999.99)
                    Return True

                Case "v_b" ' v_b:false
                    ictx.Send(False)
                    Return True

                Case "v_s" ' v_s:"tralala"
                    ictx.Send("tralala")
                    Return True

                Case "v_d" ' v_d:"2012-12-12"
                    ictx.Send("2012-12-12")
                    Return True

                Case "s_i", "l_i" ' s_d:[10 20 30 ... ]
                    ictx.Send(XPRMInitializeControl.OpenList)
                    For i As Integer = 1 To 10
                        ictx.Send(i * 10)
                    Next
                    ictx.Send(XPRMInitializeControl.CloseList)
                    Return True

                Case "s_d", "l_d" ' s_d:["2001-01-11" "2002-02-21" ... ]
                    ictx.Send(XPRMInitializeControl.OpenList)
                    For i As Integer = 1 To 10
                        ictx.Send(String.Format("{0}-{1}-{2}", 2000 + i, i, i + 1))
                    Next
                    ictx.Send(XPRMInitializeControl.CloseList)
                    Return True

                Case "a_i" '  // a_i:[ (1) 10 (2) 20 ... ]
                    ictx.Send(XPRMInitializeControl.OpenList)
                    For i As Integer = 1 To 10
                        ictx.Send(XPRMInitializeControl.OpenIndices)
                        ictx.Send(i)
                        ictx.Send(XPRMInitializeControl.CloseIndices)
                        ictx.Send(i * 10)
                    Next
                    ictx.Send(XPRMInitializeControl.CloseList)
                    Return True

                Case "ax" '   ax:[ (1) [ "aa1" 1.23 ] (2) [ "aa2" 2.46 ] ... ]
                    ictx.Send(XPRMInitializeControl.OpenList)
                    For i As Integer = 1 To 10
                        ictx.Send(XPRMInitializeControl.OpenIndices)
                        ictx.Send(i)
                        ictx.Send(XPRMInitializeControl.CloseIndices)
                        ictx.Send(XPRMInitializeControl.OpenList)
                        ictx.Send(String.Format("aa{0}", i))
                        ictx.Send(CType(i * 1.23, Double))
                        ictx.Send(XPRMInitializeControl.CloseList)
                    Next
                    ictx.Send(XPRMInitializeControl.CloseList)
                    Return True

                Case "r" '   r:[ 123 [ 10 20 30 ] ]
                    ictx.Send(XPRMInitializeControl.OpenList)
                    ictx.Send(123)
                    ictx.Send(XPRMInitializeControl.OpenList)
                    For i As Integer = 1 To 3
                        ictx.Send(i * 10)
                    Next
                    ictx.Send(XPRMInitializeControl.CloseList)
                    ictx.Send(XPRMInitializeControl.CloseList)
                    Return True

                Case "a_R" '   a_R:[ (1) [10 [10 20 30] ] (1) [20 [20 40 60] ] ... ]
                    ictx.Send(XPRMInitializeControl.OpenList)
                    For i As Integer = 1 To 10
                        ictx.Send(XPRMInitializeControl.OpenIndices)
                        ictx.Send(i)
                        ictx.Send(XPRMInitializeControl.CloseIndices)
                        ictx.Send(XPRMInitializeControl.OpenList)
                        ictx.Send(i * 10)
                        ictx.Send(XPRMInitializeControl.OpenList)
                        For j As Integer = 1 To 3
                            ictx.Send(j * i * 10)
                        Next
                        ictx.Send(XPRMInitializeControl.CloseList)
                        ictx.Send(XPRMInitializeControl.CloseList)
                    Next
                    ictx.Send(XPRMInitializeControl.CloseList)
                    Return True

                Case Else
                    OutputLog.WriteLine("Label '{0}' not found", label)
                    Return False
            End Select

        Catch e As Exception
            OutputLog.WriteLine("Label '{0}' could not be initialized - {1}", label, e.Message)
            Return False
        End Try
    End Function


    ' A method to retrieve data from Mosel
    Private Function initializeTo(ByVal label As String, ByVal val As XPRMValue) As Boolean
        OutputLog.WriteLine(".NET: {0} = {1}", label, val)
        Return True
    End Function




    ' Main function
    Public Sub RunExDrvsCallback(ByVal Log As TextWriter)
        ' Initialize mosel
        Dim mosel As XPRM = XPRM.Init
        ' Set default output stream to stdout
        mosel.SetDefaultStream(XPRMStreamType.F_OUTPUT_LINEBUF, Log)
        mosel.SetDefaultStream(XPRMStreamType.F_ERROR, Log)
        OutputLog = Log

        ' Compile and load the model
        Dim model As XPRMModel = mosel.CompileAndLoad(New StringReader(source_of_model))

        ' Set the execution parameters and bind the variables
        model.SetExecParam("ICB_INITFROM", "dotnet:cbinitfrom")
        model.SetExecParam("ICB_INITTO", "dotnet:cbinitto")
        model.Bind("cbinitfrom", New XPRMInitializationFrom(AddressOf initializeFrom))
        model.Bind("cbinitto", New XPRMInitializationTo(AddressOf initializeTo))

        ' Run the model
        model.Run()

    End Sub

End Module


ExDrvsRaw.vb
Imports System.IO
Imports Mosel

' Example for use of Mosel libraries (using 'dotnetstream' IOdriver for data exchange)

Module ExDrvsRaw
    ' Defines the Mosel source of our model 
    Private source_of_model As String = _
      "model drivers" & vbCrLf & _
 _
      "parameters" & vbCrLf & _
      " DATA=''" & vbCrLf & _
      " SOL=''" & vbCrLf & _
      "end-parameters" & vbCrLf & _
 _
      "public declarations" & vbCrLf & _
      " S:set of string" & vbCrLf & _
      " R:range" & vbCrLf & _
      " data:array(S,R) of real" & vbCrLf & _
      " sol:array(1..10) of real" & vbCrLf & _
      "end-declarations" & vbCrLf & _
 _
      "initialisations from 'dotnetraw:'" & vbCrLf & _
      " data as 'DATA(s,r,v)'" & vbCrLf & _
      "end-initialisations" & vbCrLf & _
 _
      "writeln('set   S=',S)" & vbCrLf & _
      "writeln('range R=',R)" & vbCrLf & _
      "writeln('array data=',data)" & vbCrLf & _
 _
      "forall(i in 1..10) sol(i):=i^2" & vbCrLf & _
 _
      "initialisations to 'dotnetraw:noindex'" & vbCrLf & _
      " sol as 'SOL'" & vbCrLf & _
      "end-initialisations" & vbCrLf & _
 _
      "end-model"

    ' Define a structure to store initial values for the array 'data'
    Public Class ModelDataElement
        Public s As String
        Public r As Integer
        Public v As Double

        Public Sub New(ByVal s As String, ByVal r As Integer, ByVal v As Double)
            Me.s = s
            Me.r = r
            Me.v = v
        End Sub

    End Class

    Public Sub RunExDrvsRaw(ByVal Log As TextWriter)
        ' Initialize Mosel
        Dim moselRT As XPRM = XPRM.Init

        ' Use a StringReader to compile and load the Mosel model directly from a .NET string
        Log.WriteLine("Compiling from memory...")
        Dim modelSourceReader As New StringReader(source_of_model)
        Dim model As XPRMModel = moselRT.CompileAndLoad(modelSourceReader)

        ' Send the model's output directly to the log
        model.SetDefaultStream(XPRMStreamType.F_OUTPUT_LINEBUF, Log)

        ' Create an array containing the initialization data
        Dim ModelData(3) As ModelDataElement
        ModelData(0) = New ModelDataElement("one", 2, 12.5)
        ModelData(1) = New ModelDataElement("two", 1, 15)
        ModelData(2) = New ModelDataElement("three", 16, 9)
        ModelData(3) = New ModelDataElement("hundred", 2, 17)
        ' Bind this array to the name "DATA"
        moselRT.Bind("DATA", ModelData)

        ' Create an array to receive solution data and bind it to the name 'SOL'
        Dim Solution(9) As Double
        moselRT.Bind("SOL", Solution)

        ' Run the model
        model.Run()

        ' Print the solution
        Log.WriteLine()
        Log.WriteLine()
        Log.Write("Solution values: ")
        Dim i As Integer
        For i = 0 To 9
            Log.Write(" {0}", Solution(i))
        Next
        Log.WriteLine()
        Log.WriteLine()

    End Sub

End Module

ExDrvsStream.vb
Imports System.IO
Imports Mosel

' Example for use of Mosel libraries (using 'dotnetstream' IOdriver for data exchange)

Module ExDrvsStream
    ' Defines the Mosel source of our model 
    Private source_of_model As String = _
      "model Blend" & vbCrLf & _
      "uses ""mmxprs""" & vbCrLf & _
      "public declarations" & vbCrLf & _
      " ROres = 1..2" & vbCrLf & _
      " REV = 125" & vbCrLf & _
      " MINGRADE = 4" & vbCrLf & _
      " MAXGRADE = 5" & vbCrLf & _
      " COST: array(ROres) of real" & vbCrLf & _
      " AVAIL: array(ROres) of real" & vbCrLf & _
      " GRADE: array(ROres) of real" & vbCrLf & _
      " x: array(ROres) of mpvar" & vbCrLf & _
      "end-declarations" & vbCrLf & _
      "" & vbCrLf & _
      "initializations from 'dotnetstream:BlendIni'" & vbCrLf & _
      " COST" & vbCrLf & _
      " AVAIL" & vbCrLf & _
      " GRADE" & vbCrLf & _
      "end-initializations" & vbCrLf & _
      vbCrLf & _
      "Profit:= sum(o in ROres) (REV-COST(o))*x(o)" & vbCrLf & _
      "LoGrade:= sum(o in ROres) (GRADE(o)-MINGRADE) * x(o) >= 0" & vbCrLf & _
      "UpGrade:= sum(o in ROres) (MAXGRADE-GRADE(o)) * x(o) >= 0" & vbCrLf & _
      "" & vbCrLf & _
      "forall(o in ROres) x(o)<=AVAIL(o)" & vbCrLf & _
      "" & vbCrLf & _
      "maximize(Profit)" & vbCrLf & _
      "writeln(""Objective:"", getobjval)" & vbCrLf & _
      "end-model"

    ' Defines the initialisation data for our model
    Dim init_data As String = _
      "COST: [85 93]" & vbCrLf & _
      "AVAIL: [60 45]" & vbCrLf & _
      "GRADE: [2.1 6.3]" & vbCrLf


    Public Sub RunExDrvsStream(ByVal Log As TextWriter)
        ' Initialize Mosel
        Dim moselRT As XPRM = XPRM.Init

        ' Use a StringReader to compile and load the Mosel model directly from a .NET string
        Log.WriteLine("Compiling from memory...")
        Dim modelSourceReader As New StringReader(source_of_model)
        Dim model As XPRMModel = moselRT.CompileAndLoad(modelSourceReader)

        ' Bind a stream to read the initialization data to the name 'BlendIni'
        model.Bind("BlendIni", New StringReader(init_data))

        ' Send the model's output directly to the log
        model.SetDefaultStream(XPRMStreamType.F_OUTPUT_LINEBUF, Log)

        ' And finally run the model
        model.Run()
    End Sub

End Module

OptimizerLog.vb
Imports System.IO
Imports System.Windows.Forms.TextBox

' Simple class that logs output in a TextBox field on a form

Public Class OptimizerLog
    Inherits System.IO.StringWriter

    Private Field As System.Windows.Forms.TextBox

    Sub New(ByRef tb As System.Windows.Forms.TextBox)
        MyBase.New()
        Field = tb
        Field.Text = ""
        System.Windows.Forms.Application.DoEvents()
    End Sub

    Public Overloads Overrides Sub Flush()
        MyBase.Flush()
        Field.Text = Me.ToString

        ' We want to automatically scroll the textbox to show the last line.
        ' No easy way to scroll the textbox or set the caret position - so we have to
        ' select the last character, which will set the caret position, then scroll to
        ' that.
        Field.SelectionStart = Field.Text.Length
        Field.SelectionLength = 0
        Field.ScrollToCaret()

        System.Windows.Forms.Application.DoEvents()
    End Sub


    Public Overloads Overrides Sub WriteLine(ByVal val As String)
        If (Field.Text.Length = Me.ToString.Length) Then
            MyBase.WriteLine(val)
            Field.AppendText(val)
        Else
            MyBase.WriteLine(val)
            Field.Text = Me.ToString
        End If

        ' We want to automatically scroll the textbox to show the last line.
        ' No easy way to scroll the textbox or set the caret position - so we have to
        ' select the last character, which will set the caret position, then scroll to
        ' that.
        Field.SelectionStart = Field.Text.Length
        Field.SelectionLength = 0
        Field.ScrollToCaret()

        System.Windows.Forms.Application.DoEvents()
    End Sub


    Public Overloads Overrides Sub WriteLine(ByVal fmt As String, ByVal ParamArray arg() As Object)
        Me.WriteLine(String.Format(fmt, arg))
    End Sub

End Class

frmMain.vb
Public Class frmMain
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents tbxLog As System.Windows.Forms.TextBox
    Friend WithEvents cmdRun As System.Windows.Forms.Button
    Friend WithEvents lblInstructions As System.Windows.Forms.Label
    Friend WithEvents radDispDso As System.Windows.Forms.RadioButton
    Friend WithEvents radDispMod As System.Windows.Forms.RadioButton
    Friend WithEvents radExAs As System.Windows.Forms.RadioButton
    Friend WithEvents radExLib As System.Windows.Forms.RadioButton
    Friend WithEvents radExProb As System.Windows.Forms.RadioButton
    Friend WithEvents radExSet As System.Windows.Forms.RadioButton
    Friend WithEvents radExDrvsCallback As System.Windows.Forms.RadioButton
    Friend WithEvents radExDrvsRaw As System.Windows.Forms.RadioButton
    Friend WithEvents radExDrvsStream As System.Windows.Forms.RadioButton
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.radDispDso = New System.Windows.Forms.RadioButton
        Me.radDispMod = New System.Windows.Forms.RadioButton
        Me.radExAs = New System.Windows.Forms.RadioButton
        Me.radExLib = New System.Windows.Forms.RadioButton
        Me.radExDrvsCallback = New System.Windows.Forms.RadioButton
        Me.tbxLog = New System.Windows.Forms.TextBox
        Me.cmdRun = New System.Windows.Forms.Button
        Me.lblInstructions = New System.Windows.Forms.Label
        Me.radExProb = New System.Windows.Forms.RadioButton
        Me.radExSet = New System.Windows.Forms.RadioButton
        Me.radExDrvsRaw = New System.Windows.Forms.RadioButton
        Me.radExDrvsStream = New System.Windows.Forms.RadioButton
        Me.SuspendLayout()
        '
        'radDispDso
        '
        Me.radDispDso.Location = New System.Drawing.Point(16, 32)
        Me.radDispDso.Name = "radDispDso"
        Me.radDispDso.Size = New System.Drawing.Size(136, 16)
        Me.radDispDso.TabIndex = 0
        Me.radDispDso.Text = "DispDSO"
        '
        'radDispMod
        '
        Me.radDispMod.Location = New System.Drawing.Point(16, 56)
        Me.radDispMod.Name = "radDispMod"
        Me.radDispMod.Size = New System.Drawing.Size(136, 16)
        Me.radDispMod.TabIndex = 1
        Me.radDispMod.Text = "DispMod"
        '
        'radExAs
        '
        Me.radExAs.Location = New System.Drawing.Point(160, 32)
        Me.radExAs.Name = "radExAs"
        Me.radExAs.Size = New System.Drawing.Size(136, 16)
        Me.radExAs.TabIndex = 2
        Me.radExAs.Text = "ExAs"
        '
        'radExLib
        '
        Me.radExLib.Location = New System.Drawing.Point(304, 32)
        Me.radExLib.Name = "radExLib"
        Me.radExLib.Size = New System.Drawing.Size(136, 16)
        Me.radExLib.TabIndex = 3
        Me.radExLib.Text = "ExLib"
        '
        'radExDrvsCallback
        '
        Me.radExDrvsCallback.Location = New System.Drawing.Point(448, 56)
        Me.radExDrvsCallback.Name = "radExDrvsCallback"
        Me.radExDrvsCallback.Size = New System.Drawing.Size(136, 16)
        Me.radExDrvsCallback.TabIndex = 4
        Me.radExDrvsCallback.Text = "ExDrvsCallback"
        '
        'tbxLog
        '
        Me.tbxLog.Location = New System.Drawing.Point(16, 120)
        Me.tbxLog.Multiline = True
        Me.tbxLog.Name = "tbxLog"
        Me.tbxLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.tbxLog.Size = New System.Drawing.Size(520, 224)
        Me.tbxLog.TabIndex = 5
        Me.tbxLog.Text = ""
        '
        'cmdRun
        '
        Me.cmdRun.Location = New System.Drawing.Point(416, 88)
        Me.cmdRun.Name = "cmdRun"
        Me.cmdRun.Size = New System.Drawing.Size(120, 24)
        Me.cmdRun.TabIndex = 6
        Me.cmdRun.Text = "Run"
        '
        'lblInstructions
        '
        Me.lblInstructions.Location = New System.Drawing.Point(16, 8)
        Me.lblInstructions.Name = "lblInstructions"
        Me.lblInstructions.Size = New System.Drawing.Size(512, 16)
        Me.lblInstructions.TabIndex = 7
        Me.lblInstructions.Text = "Select the example to run..."
        Me.lblInstructions.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'radExProb
        '
        Me.radExProb.Location = New System.Drawing.Point(16, 80)
        Me.radExProb.Name = "radExProb"
        Me.radExProb.Size = New System.Drawing.Size(136, 16)
        Me.radExProb.TabIndex = 8
        Me.radExProb.Text = "ExProb"
        '
        'radExSet
        '
        Me.radExSet.Location = New System.Drawing.Point(448, 32)
        Me.radExSet.Name = "radExSet"
        Me.radExSet.Size = New System.Drawing.Size(136, 16)
        Me.radExSet.TabIndex = 9
        Me.radExSet.Text = "ExSet"
        '
        'radExDrvsRaw
        '
        Me.radExDrvsRaw.Location = New System.Drawing.Point(304, 56)
        Me.radExDrvsRaw.Name = "radExDrvsRaw"
        Me.radExDrvsRaw.Size = New System.Drawing.Size(136, 16)
        Me.radExDrvsRaw.TabIndex = 10
        Me.radExDrvsRaw.Text = "ExDrvsRaw"
        '
        'radExDrvsStream
        '
        Me.radExDrvsStream.Location = New System.Drawing.Point(160, 56)
        Me.radExDrvsStream.Name = "radExDrvsStream"
        Me.radExDrvsStream.Size = New System.Drawing.Size(136, 16)
        Me.radExDrvsStream.TabIndex = 11
        Me.radExDrvsStream.Text = "ExDrvsStream"
        '
        'frmMain
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(552, 349)
        Me.Controls.Add(Me.radExDrvsStream)
        Me.Controls.Add(Me.radExDrvsRaw)
        Me.Controls.Add(Me.radExSet)
        Me.Controls.Add(Me.radExProb)
        Me.Controls.Add(Me.lblInstructions)
        Me.Controls.Add(Me.cmdRun)
        Me.Controls.Add(Me.tbxLog)
        Me.Controls.Add(Me.radExDrvsCallback)
        Me.Controls.Add(Me.radExLib)
        Me.Controls.Add(Me.radExAs)
        Me.Controls.Add(Me.radDispMod)
        Me.Controls.Add(Me.radDispDso)
        Me.Name = "frmMain"
        Me.Text = "Mosel VB.NET Examples"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub cmdRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRun.Click
        Dim Log As OptimizerLog
        Log = New OptimizerLog(Me.tbxLog)
        Me.Cursor = Cursors.WaitCursor
        If Me.radDispDso.Checked Then
            Log.WriteLine("Running DispDSO...")
            Log.WriteLine("")
            DispDso.RunDispDso("mmxprs", Log)
        ElseIf Me.radDispMod.Checked Then
            Log.WriteLine("Running DispMod...")
            Log.WriteLine("")
            DispMod.RunDispMod("Models\blend2.mos", Log)
        ElseIf Me.radExAs.Checked Then
            Log.WriteLine("Running ExAs...")
            Log.WriteLine("")
            ExAs.RunExAs(Log)
        ElseIf Me.radExLib.Checked Then
            Log.WriteLine("Running ExLib...")
            Log.WriteLine()
            ExLib.RunExLib(Log)
        ElseIf Me.radExSet.Checked Then
            Log.WriteLine("Running ExSet...")
            Log.WriteLine()
            ExSet.RunExSet(Log)
        ElseIf Me.radExProb.Checked Then
            Log.WriteLine("Running ExProb...")
            Log.WriteLine()
            ExProb.RunExProb(Log)
        ElseIf Me.radExDrvsStream.Checked Then
            Log.WriteLine("Running ExDrvsStream...")
            Log.WriteLine()
            ExDrvsStream.RunExDrvsStream(Log)
        ElseIf Me.radExDrvsCallback.Checked Then
            Log.WriteLine("Running ExDrvsCallback...")
            Log.WriteLine()
            ExDrvsCallback.RunExDrvsCallback(Log)
        ElseIf Me.radExDrvsRaw.Checked Then
            Log.WriteLine("Running ExDrvsRaw")
            Log.WriteLine()
            ExDrvsRaw.RunExDrvsRaw(Log)
        Else
            Log.WriteLine("ERROR: No example selected.")
            MsgBox("Please select which example you wish to execute")
        End If
        Log.WriteLine()
        Log.WriteLine("Example ended.")
        Me.Cursor = Cursors.Default
    End Sub
End Class

frmMain.resx
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 1.3
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">1.3</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1">this is my long string</data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        [base64 mime encoded serialized .NET Framework object]
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        [base64 mime encoded string representing a byte array form of the .NET Framework object]
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used forserialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>1.3</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="radDispDso.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radDispDso.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radDispDso.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radDispMod.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radDispMod.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radDispMod.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExAs.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radExAs.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExAs.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExLib.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radExLib.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExLib.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExDrvsCallback.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radExDrvsCallback.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExDrvsCallback.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="tbxLog.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="tbxLog.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="tbxLog.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="cmdRun.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="cmdRun.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="cmdRun.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="lblInstructions.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="lblInstructions.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="lblInstructions.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExProb.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radExProb.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExProb.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExSet.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radExSet.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExSet.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExDrvsRaw.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radExDrvsRaw.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExDrvsRaw.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExDrvsStream.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="radExDrvsStream.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="radExDrvsStream.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>(Default)</value>
  </data>
  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="$this.Name">
    <value>frmMain</value>
  </data>
  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>8, 8</value>
  </data>
  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>True</value>
  </data>
  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>80</value>
  </data>
  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>True</value>
  </data>
  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Assembly</value>
  </data>
</root>

Mosel-VB.NET.vbproj
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net5.0-windows</TargetFramework>
    <RootNamespace>optimizer.vb.net</RootNamespace>
    <StartupObject>optimizer.vb.net.frmMain</StartupObject>
    <UseWindowsForms>true</UseWindowsForms>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="../Models/**">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      <LinkBase>Models</LinkBase>
    </Content>
  </ItemGroup>

  <ItemGroup>
    <Import Include="System.Data" />
    <Import Include="System.Drawing" />
    <Import Include="System.Windows.Forms" />
    <Import Include="Microsoft.VisualBasic" />
    <PackageReference Include="FICO.Xpress.XPRMdn" Version="5.6.1" />  <!-- Compatible with Mosel .NET 5.6.1 and later -->
  </ItemGroup>

</Project>

© 2001-2025 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.