CONOPT
Loading...
Searching...
No Matches
MsgHandler Class Reference

Public Member Functions

 MsgHandler (String name)
 
void close ()
 
int message (int smsg, int dmsg, int nmsg, String[] msgv)
 
int errorMessage (int rowno, int colno, int posno, String msg)
 
- Public Member Functions inherited from jconopt.MessageHandler
synchronized void delete ()
 
void swigReleaseOwnership ()
 
void swigTakeOwnership ()
 
 MessageHandler ()
 
int progress (ConoptAlgProgress progressdata)
 
int sendMessage (String msg)
 
void setVerbosityLevel (VerbosityLevel verblevel)
 

Additional Inherited Members

- Protected Member Functions inherited from jconopt.MessageHandler
 MessageHandler (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 
void swigDirectorDisconnect ()
 
- Static Protected Member Functions inherited from jconopt.MessageHandler
static long getCPtr (MessageHandler obj)
 
static long swigRelease (MessageHandler obj)
 
- Protected Attributes inherited from jconopt.MessageHandler
transient boolean swigCMemOwn
 

Detailed Description

Definition at line 5 of file MsgHandler.java.

Constructor & Destructor Documentation

◆ MsgHandler()

MsgHandler.MsgHandler ( String name)
inline

Definition at line 9 of file MsgHandler.java.

Member Function Documentation

◆ close()

void MsgHandler.close ( )
inline

Definition at line 19 of file MsgHandler.java.

◆ message()

int MsgHandler.message ( int smsg,
int dmsg,
int nmsg,
String[] msgv )
inline

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 jconopt.MessageHandler.

Definition at line 29 of file MsgHandler.java.

◆ errorMessage()

int MsgHandler.errorMessage ( int rowno,
int colno,
int posno,
String msg )
inline

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 jconopt.MessageHandler.

Definition at line 49 of file MsgHandler.java.


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