XPRMModel Class
A model in Mosel. This class contains the methods for executing models with Mosel.

Namespace: Mosel
Assembly: xprmdn (in xprmdn.dll) Version: 5.0.2.0

C#
public class XPRMModel : XPRMObjectBase, IDisposable
The XPRMModel type exposes the following members.

Name | Description | |
---|---|---|
![]() |
AnnotatedIdentifiers |
Array containing the annotations of the given identifier in this model
|
![]() |
Date |
This is model compilation date
|
![]() |
ExecStatus |
Get execution status. The execution status indicates whether the execution terminated normally.
|
![]() |
ExitCode |
Result of the execution of the model. This method returns the result of the execution of a model (i.e. the parameter value of the exit procedure) with method
Run
|
![]() |
Identifiers |
All identifiers of the model (list of XPRMIdentifier objects)
|
![]() |
IsLoaded |
Check if the model is loaded. A model will be loaded from when it is created until when UnLoad is called.
|
![]() |
IsRunning |
Check whether the model is being executed.
|
![]() |
LastLineIndex |
Maximum value to be used with
GetLocation(Int32). This value is -1 when no debugging information is available for the model.
|
![]() |
Model |
Used to fetch the XPRM model to which this object belongs, or else 'null' if there is no model anywhere among this Object's ancestors.
(Inherited from XPRMObjectBase.) |
![]() |
Name |
Name of the problem. This name is generated automatically when the model is loaded into memory.
|
![]() |
Number |
Model number. An order number is assigned to the model when it is loaded into memory.
|
![]() |
ObjectiveValue |
Objective value of the main problem, or 0 if no problem has been solved.
|
![]() |
Owner |
Used to fetch the XPRM object to which this object belongs
(Inherited from XPRMObjectBase.) |
![]() |
Parameters |
List containing all parameters in the model (XPRMParameter objects)
|
![]() |
ProblemIsValid |
Check whether the problem in the optimizer is valid. The problem may have been modified between the last optimisation and the end of the execution. In this case the solution returned may not be valid.
|
![]() |
ProblemStatus |
Get main problem status after execution.
|
![]() |
Result | Obsolete.
Result of the execution of the model. This method returns the result of the execution of a model (i.e. the parameter value of the exit procedure) with method
Run
|
![]() |
Size |
This is the amount of memory (in bytes) used by the model. Note that memory allocated by modules is not counted (for instance memory used by the optimizer is not reported by this property).
|
![]() |
SolutionAvailable |
Check whether a solution is available.
|
![]() |
SysComment |
System comment. The system comment is generated by the compiler.
|
![]() |
UserComment |
User comment. The user comment is provided by the user at compile time (see
Compile(String, String, String, String))
|
![]() |
Version |
Get Model version.
|

Name | Description | |
---|---|---|
![]() |
Bind |
Bind an object to a name. This method is used to associate a name with an object; this name can then be used to locate the object from the 'dotnetstream' and 'dotnetraw' I/O drivers within this Mosel model. Binding an object also prevents it from being garbage collected until the name is unbound or another object is bound to this name, or until the XPRMModel object is disposed.
|
![]() |
ClearAllBreakpoints |
Clear all breakpoints. Remove all defined breakpoints for this model.
|
![]() |
ClearBreakpoint |
Clear the breakpoint at the specified location. Remove a breakpoint previously set up using
SetBreakpoint(XPRMLocation). This function has no effect if no breakpoint was defined at the specified location.
|
![]() |
ClearExecParams |
Clear the execution parameters string
|
![]() |
dependencies |
Get an iterator to enumerate all dependencies (modules+packages) of the model.
|
![]() |
Dispose |
Mosel models can be rather large; if you'd rather not wait for the garbage collector to decide they're done with, you can call Dispose to instruct Mosel to deallocate any internal memory used by them.
|
![]() |
Equals | (Inherited from Object.) |
![]() |
ExpandType(Int32) | |
![]() |
ExpandType(XPRMVarType) | |
![]() |
ExpandType(XPRMVarType, XPRMVarStruct) | |
![]() |
ExportProblem |
Export the active problem to an MPS or LP format matrix file
|
![]() |
Finalize |
Destructor; deallocates XPRMModel when object is garbage collected. Unloads model in Mosel if not already unloaded.
(Overrides ObjectFinalize.) |
![]() |
FindIdentifier |
Find an identifier of the model.
|
![]() |
FindTypeCode |
Find a code of a type
|
![]() |
GetAnnotations(String) |
Array containing the globally defined annotations with the given prefix.
|
![]() |
GetAnnotations(String, String) |
Array containing the annotations of the given identifier in this model
|
![]() |
GetAnnotations(XPRMIdentifier, String) |
Array containing the annotations of the given identifier in this model
|
![]() |
GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
![]() |
GetLocation |
Create a location based on a line index. All statements of a model and numbered from 0 to lastLineIndex. This function can be used to generate a location object (which provides information on the location of the statement in terms of line number and file name) based on a line index.
|
![]() ![]() |
getStructName | Obsolete. |
![]() |
GetStructName(XPRMVarStruct) | |
![]() |
GetStructName(XPRMVarType, XPRMVarStruct) | |
![]() |
GetType |
Gets the type of the current instance.
(Inherited from Object.) |
![]() ![]() |
getTypeName | Obsolete. |
![]() |
GetTypeName(Int32) | |
![]() |
GetTypeName(XPRMVarType) | |
![]() |
GetTypeName(XPRMVarType, XPRMVarStruct) | |
![]() |
getVersion | Obsolete. |
![]() |
MemberwiseClone |
Creates a shallow copy of the current
Object.
(Inherited from Object.) |
![]() |
requirements |
Get an iterator to enumerate all requirements of the model.
|
![]() |
Reset |
Reset model. Restore the state of the model before it was executed: all data is released, problem is cleared.
|
![]() |
ResetExecParam |
Remove the value associated with the given name from the execution parameters.
|
![]() |
Run |
Run the model. This method starts the execution of the model. The model parameters are initialised using
ExecParams. Execution may be interrupted by calling
Stop. After this function returns, execution status may be examined in the
ExecStatus property and exit code can be obtained with
ExitCode (i.e. the parameter value of the Mosel exit procedure).
|
![]() |
SelectMainProblem |
Select the main problem
|
![]() |
SelectProblem(XPRMExternal) |
Select the active problem
|
![]() |
SelectProblem(XPRMProblem) |
Select the active problem
|
![]() |
SetBreakpoint |
Set a breakpoint at the specified location. Execution is interrupted when a breakpoint is reached. Breakpoints can be installed both before and during execution (from the debugger). Breakpoinst can be removed using
ClearBreakpoint(XPRMLocation) or
ClearAllBreakpoints(). The model has to be compiled with option
"-G" for this function to be effective.
|
![]() |
SetDefaultStream(XPRMStreamType, TextReader) |
Set default input/output streams. This method defines the default streams that are opened when execution of the model starts. Using an empty string as the file name implies resetting to the corresponding original default stream (defined using
SetDefaultStream(XPRMStreamType, TextReader))
|
![]() |
SetDefaultStream(XPRMStreamType, TextWriter) |
Set default input/output streams. This method defines the default streams that are opened when execution of the model starts. Using an empty string as the file name implies resetting to the corresponding original default stream (defined using
SetDefaultStream(XPRMStreamType, TextWriter))
|
![]() |
SetDefaultStream(XPRMStreamType, String) |
Set default input/output streams. This method defines the default streams that are opened when execution of the model starts.
|
![]() |
SetExecParam |
Set the value associated to an execution parameter This routine adds or replaces the assignment name=val in the execution parameter string
|
![]() |
SetStackFrame |
Set the current stack frame to the specified level. This function changes the current stack frame of the program: the initial level is 0, positive values indicate higher levels. The location returned corresponds to the function call or the current statement if the level is 0. Changing the stack frame modifies the behaviour of
FindIdentifier(String) regarding local symbols: symbols returned are those of the specified stack level and not those of the interruption (level 0). This function can be called only from the debugger function.
|
![]() |
Stop |
Interrupt execution.
|
![]() |
ToString |
Returns a string that represents the current object.
(Inherited from Object.) |
![]() |
Unbind |
Unbinds the object associated with this name; the object can now be garbage collected (if no other references to it exist), and can no longer be referred to by this name from the 'dotnetstream' or 'dotnetraw' I/O drivers. This method should be called once a name is not to be used again in Mosel.
|

Name | Description | |
---|---|---|
![]() |
Debugger |
Debugger. The function debugger.Debug() is called whenever the execution of the model is interrupted.
|
![]() |
ExecParams |
Execution parameters. This string is used to initialise model parameters when execution of the model starts.
|
