ContentsIndexHome
PreviousUpNext
IAimmsMathProgramCallback::PassProgressLines Method

Passes progress information to AIMMS, whereby the user decides which information should be printed to the progress window of AIMMS.

virtual void PassProgressLines(
    _LONG_T no_lines, 
    char * titles, 
    char * values, 
    size_t mem_used
) = 0;
Parameters 
Description 
_LONG_T no_lines 
The number of lines to be displayed in the progress window. 
char * titles 
Character buffer containing the title parts of the lines to be printed in the progress window. All no_lines titles should be placed in this buffer on a starting position that is a multiple of the defined parameter AOSI_PROGRESS_TITLE_LEN
char * values 
Character buffer containing the value parts of the lines to be printed in the progress window. All no_lines value strings should be placed in this buffer on a starting position that is a multiple of the defined parameter AOSI_PROGRESS_VALUE_LEN
size_t mem_used 
The current amount of memory in use (in bytes). 

The PassProgressLines method has no return value.

Other than in the PassProgressInfo method where the type of progress is categorized, this method allows you to pass any kind of progress suitable for your solver as free text strings. Via this method you can fill up to 10 lines in the progress window, where each line consists of a title (e.g., 'Iteration') and a value (e.g. '115'). 

The PassProgressLines method should be called just before the actual solve starts, and just before returning the control to AIMMS. If the solver is capable of doing callbacks during the solution process itself, then this method should also be called every n iterations where n is the value of the AIMMS option IntegerGeneralOption::IOPT_progress_solution.

  1. The PassProgressLines method is an alternative for the two methods PassProgressInfo and PassPhaseInfo, and provides more control. You should choose to pass progress information using either of the two approaches, you should not mix both.
  2. The number of lines should be equal to the value of parameter IntegerSolverInfo::IINFO_PROGRESS as passed to the GetInitialInfo method.

void SLVMathProgramCallback::TellProgress() 

{ 

char titles[ 5*AOSI_PROGRESS_TITLE_LEN ], 

values[ 5*AOSI_PROGRESS_VALUE_LEN ]; 

 

/* SLV_current is a handle to a structure in which all kind 

of information for the current solve is stored. */ 

 

strcpy( titles, "Phase0" ); 

strcpy( values, "MIP0" ); 

 

strcpy( &titles[ AOSI_PROGRESS_TITLE_LEN ], "Iterations0" ); 

sprintf( &values[ AOSI_PROGRESS_VALUE_LEN ], "%d0", 

SLV_current.iterations ); 

 

strcpy( &titles[ 2*AOSI_PROGRESS_TITLE_LEN ], "Nodes0" ); 

sprintf( &values[ 2*AOSI_PROGRESS_VALUE_LEN ], "%d0", 

SLV_current.nodes ); 

 

strcpy( &titles[ 3*AOSI_PROGRESS_TITLE_LEN ], "Objective0" ); 

sprintf( &values[ 3*AOSI_PROGRESS_VALUE_LEN ], "%.8f0", 

SLV_current.objective ); 

 

strcpy( &titles[ 4*AOSI_PROGRESS_TITLE_LEN ], "0" ); 

strcpy( &values[ 4*AOSI_PROGRESS_VALUE_LEN ], "0" ); 

 

PassProgressLines( 5, titles, values, 

SLV_current.mem_in_use ); 

} 

 

void SLVMathProgramCallback::TellPhase() 

{ 

char titles[ AOSI_PROGRESS_TITLE_LEN ], 

values[ AOSI_PROGRESS_VALUE_LEN ]; 

 

strcpy( titles, "Phase0" ); 

strcpy( values, "MIP presolve0" ); 

 

PassProgressLines( 1, titles, values, 

SLV_current.mem_in_use ); 

} 

Copyright © 1993–2016 by AIMMS B.V. All rights reserved.