CONOPT
Loading...
Searching...
No Matches
std.TutMessageHandler Class Reference

Public Member Functions

 __init__ (self, name)
 
 message (self, smsg, dmsg, nmsg, msgv)
 virtual method for handling the messages.
 
 errorMessage (self, rowno, colno, posno, msg)
 virtual method for handling error messages.
 
- Public Member Functions inherited from conopt.MessageHandler
 __init__ (self)
 Constructor.
 
 progress (self, progressdata)
 progress(MessageHandler self, ConoptAlgProgress progressdata) -> int
 
 sendMessage (self, msg)
 sends a message to the message handler
 
 setVerbosityLevel (self, verblevel)
 sets the verbosity level for messaging.
 
 __disown__ (self)
 
synchronized void delete ()
 
void swigReleaseOwnership ()
 
void swigTakeOwnership ()
 
 MessageHandler ()
 
int message (int smsg, int dmsg, int nmsg, String[] msgv)
 
int errorMessage (int rowno, int colno, int posno, String msg)
 
int progress (ConoptAlgProgress progressdata)
 
int sendMessage (String msg)
 
void setVerbosityLevel (VerbosityLevel verblevel)
 

Data Fields

 name = name
 
 fs = open(f'{name}.sta', 'w')
 
 fd = open(f'{name}.lst', 'w')
 

Additional Inherited Members

- Protected Member Functions inherited from conopt.MessageHandler
 MessageHandler (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 
void swigDirectorDisconnect ()
 
- Static Protected Member Functions inherited from conopt.MessageHandler
static long getCPtr (MessageHandler obj)
 
static long swigRelease (MessageHandler obj)
 
- Protected Attributes inherited from conopt.MessageHandler
transient boolean swigCMemOwn
 
- Properties inherited from conopt.MessageHandler
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Detailed Description

Definition at line 9 of file std.py.

Constructor & Destructor Documentation

◆ __init__()

std.TutMessageHandler.__init__ ( self,
name )

Definition at line 10 of file std.py.

Member Function Documentation

◆ message()

std.TutMessageHandler.message ( self,
smsg,
dmsg,
nmsg,
msgv )

virtual method for handling the messages.

This can be redefined by the user for alternative message handling

Attention
Mandatory callback routine. (Fortran and C API only. A default implementation is available in the other languages.)

General messages can be information for the iteration log, error messages, termination messages, and other generally useful information. The messages can be more than one line long and each line can be up to 132 characters long. There may be blank lines identified by LLEN(I) = 1 and MSGV(I)(1:1) = " " used to space the messages nicely, and some of the lines may be indented with leading blanks.

Messages are sent to three simultaneous streams or files and parts of the messages can be intended for one or more streams. These streams/files are:

  • The Screen file: These messages are intended for immediate display, showing the modeler the progress as it happens. The file has a small number of small messages plus an iteration log with lines for a subset of the iterations. The first SMSG lines are intended for this file.
  • The Status file: A summary file that after the model has been solved can be used to determine the status of the solution and whether there were any problems during the solution process. Error messages are more detailed than in the Screen file, but there is no iteration log. The file is intended to be saved with the solution. The first NMSG lines are intended for this file.
  • The Documentation file: A detailed description of the iteration process with one line per iteration plus detailed versions of all error and termination messages. The file is intended for experimentation and debugging. The first DMSG lines are intended for this file.

The modeler may implement all three streams or a subset of them. Note that SMSG, NMSG, or DMSG can be zero indicating that there are only messages for a subset for the files. Also note that the status file always will be a subset of the documentation file, i.e. NMSG will be less than or equal to DMSG. All messages start with the first line in MSGV.

Parameters
smsgThe number of lines in the message that should go to the Screen file. Between 0 and 30.
dmsgThe number of lines in the message that should go to the Status file. Between 0 and 30.
nmsgThe number of lines in the message that should go to the Documentation file. Between 0 and 30.
msgvVector with the actual message lines.

Reimplemented from conopt.MessageHandler.

Definition at line 16 of file std.py.

◆ errorMessage()

std.TutMessageHandler.errorMessage ( self,
rowno,
colno,
posno,
msg )

virtual method for handling error messages.

This can be redefined by the user for alternative message handling

Messages about particular parts of a model are all one line long. The messages can be related to an error or it can be a general informative message related to a row or column or Jacobian element. The modeler is responsible for combining the row and column identification and the message text and for displaying the overall message.

There are some special cases for the three first arguments and the message should be interpreted accordingly. The special cases are:

  • COLNO = -1: The message is about a row and ROWNO will be between 0 and NumCon-1.
  • ROWNO = -1: The message is about a column and COLNO will be between 0 and NumVar-1.
  • ROWNO and COLNO both non-negative: The message is about a position in the Jacobian if POSNO is non-negative and about a (row,column)-pair if POSNO is -1.

Examples of message texts are "Inconsistent lower and upper bounds." and "The variable has reached 'infinity.'" for a column, "The slack has reached 'infinity.'" for a row and "Initial Jacobian element was not defined." for a Jacobian element.

Parameters
rownoThe number of a row in the matrix.
colnoThe number of a column in the matrix.
posnoThe number of a Jacobian element in the matrix.
msgThe actual message.

Reimplemented from conopt.MessageHandler.

Definition at line 26 of file std.py.

Field Documentation

◆ name

std.TutMessageHandler.name = name

Definition at line 11 of file std.py.

◆ fs

std.TutMessageHandler.fs = open(f'{name}.sta', 'w')

Definition at line 12 of file std.py.

◆ fd

std.TutMessageHandler.fd = open(f'{name}.lst', 'w')

Definition at line 13 of file std.py.


The documentation for this class was generated from the following file: