CONOPT
|
Data Structures | |
class | pyconopt.MessageHandler |
The message handler class. More... | |
Functions | |
pyconopt.MessageHandler.message (self, smsg, dmsg, nmsg, msgv) | |
virtual method for handling the messages. | |
pyconopt.MessageHandler.errorMessage (self, rowno, colno, posno, msg) | |
virtual method for handling error messages. | |
pyconopt.MessageHandler.sendMessage (self, msg) | |
sends a message to the message handler | |
pyconopt.MessageHandler.setVerbosityLevel (self, verblevel) | |
sets the verbosity level for messaging. | |
An optional class for providing a custom message handler.
pyconopt.MessageHandler.message | ( | self, | |
smsg, | |||
dmsg, | |||
nmsg, | |||
msgv ) |
virtual method for handling the messages.
This can be redefined by the user for alternative message handling
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:
SMSG
lines are intended for this file.NMSG
lines are intended for this file.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
.
smsg | The number of lines in the message that should go to the Screen file. Between 0 and 30. |
dmsg | The number of lines in the message that should go to the Status file. Between 0 and 30. |
nmsg | The number of lines in the message that should go to the Documentation file. Between 0 and 30. |
msgv | Vector with the actual message lines. |
Definition at line 2290 of file pyconopt.py.
pyconopt.MessageHandler.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:
ROWNO
will be between 0 and NumCon-1
.COLNO
will be between 0 and NumVar-1
.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.
rowno | The number of a row in the matrix. |
colno | The number of a column in the matrix. |
posno | The number of a Jacobian element in the matrix. |
msg | The actual message. |
Definition at line 2308 of file pyconopt.py.
pyconopt.MessageHandler.sendMessage | ( | self, | |
msg ) |
sends a message to the message handler
Definition at line 2359 of file pyconopt.py.
pyconopt.MessageHandler.setVerbosityLevel | ( | self, | |
verblevel ) |
sets the verbosity level for messaging.
The effect of this will depend on how the user implements the custom message handler
Definition at line 2368 of file pyconopt.py.