Initializing help system before first use

XPRMModel Class

A model in Mosel. This class contains the methods for executing models with Mosel.
Inheritance Hierarchy
SystemObject
   MoselXPRMObjectBase
     MoselXPRMModel

Namespace:   Mosel
Assembly:  xprmdn (in xprmdn.dll) Version: 5.0.2.0
Syntax
C#
public class XPRMModel : XPRMObjectBase, IDisposable

The XPRMModel type exposes the following members.

Properties
  Name Description
Public property AnnotatedIdentifiers
Array containing the annotations of the given identifier in this model
Public property Date
This is model compilation date
Public property ExecStatus
Get execution status. The execution status indicates whether the execution terminated normally.
Public property 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
Public property Identifiers
All identifiers of the model (list of XPRMIdentifier objects)
Public property IsLoaded
Check if the model is loaded. A model will be loaded from when it is created until when UnLoad is called.
Public property IsRunning
Check whether the model is being executed.
Public property LastLineIndex
Maximum value to be used with GetLocation(Int32). This value is -1 when no debugging information is available for the model.
Public property 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.)
Public property Name
Name of the problem. This name is generated automatically when the model is loaded into memory.
Public property Number
Model number. An order number is assigned to the model when it is loaded into memory.
Public property ObjectiveValue
Objective value of the main problem, or 0 if no problem has been solved.
Public property Owner
Used to fetch the XPRM object to which this object belongs
(Inherited from XPRMObjectBase.)
Public property Parameters
List containing all parameters in the model (XPRMParameter objects)
Public property 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.
Public property ProblemStatus
Get main problem status after execution.
Public property 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
Public property 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).
Public property SolutionAvailable
Check whether a solution is available.
Public property SysComment
System comment. The system comment is generated by the compiler.
Public property UserComment
User comment. The user comment is provided by the user at compile time (see Compile(String, String, String, String))
Public property Version
Get Model version.
Top
Methods
  Name Description
Public method 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.
Public method ClearAllBreakpoints
Clear all breakpoints. Remove all defined breakpoints for this model.
Public method 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.
Public method ClearExecParams
Clear the execution parameters string
Public method dependencies
Get an iterator to enumerate all dependencies (modules+packages) of the model.
Public method 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.
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method ExpandType(Int32)
Public method ExpandType(XPRMVarType)
Public method ExpandType(XPRMVarType, XPRMVarStruct)
Public method ExportProblem
Export the active problem to an MPS or LP format matrix file
Protected method Finalize
Destructor; deallocates XPRMModel when object is garbage collected. Unloads model in Mosel if not already unloaded.
(Overrides ObjectFinalize.)
Public method FindIdentifier
Find an identifier of the model.
Public method FindTypeCode
Find a code of a type
Public method GetAnnotations(String)
Array containing the globally defined annotations with the given prefix.
Public method GetAnnotations(String, String)
Array containing the annotations of the given identifier in this model
Public method GetAnnotations(XPRMIdentifier, String)
Array containing the annotations of the given identifier in this model
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method 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.
Public methodStatic member getStructName Obsolete.
Public method GetStructName(XPRMVarStruct)
Public method GetStructName(XPRMVarType, XPRMVarStruct)
Public method GetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodStatic member getTypeName Obsolete.
Public method GetTypeName(Int32)
Public method GetTypeName(XPRMVarType)
Public method GetTypeName(XPRMVarType, XPRMVarStruct)
Public method getVersion Obsolete.
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method requirements
Get an iterator to enumerate all requirements of the model.
Public method Reset
Reset model. Restore the state of the model before it was executed: all data is released, problem is cleared.
Public method ResetExecParam
Remove the value associated with the given name from the execution parameters.
Public method 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).
Public method SelectMainProblem
Select the main problem
Public method SelectProblem(XPRMExternal)
Select the active problem
Public method SelectProblem(XPRMProblem)
Select the active problem
Public method 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.
Public method 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))
Public method 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))
Public method SetDefaultStream(XPRMStreamType, String)
Set default input/output streams. This method defines the default streams that are opened when execution of the model starts.
Public method SetExecParam
Set the value associated to an execution parameter This routine adds or replaces the assignment name=val in the execution parameter string
Public method 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.
Public method Stop
Interrupt execution.
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public method 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.
Top
Fields
  Name Description
Public field Debugger
Debugger. The function debugger.Debug() is called whenever the execution of the model is interrupted.
Public field ExecParams
Execution parameters. This string is used to initialise model parameters when execution of the model starts.
Top
See Also

Reference

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