Changeset 2384 for trunk/Cbc


Ignore:
Timestamp:
Sep 6, 2018 4:37:14 PM (10 months ago)
Author:
unxusr
Message:

example for event handler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/examples/inc.cpp

    r2383 r2384  
    1 // inc.cpp: example of callback, saving every
    2 // incumbent solution to a new file
     1// inc.cpp: example of event handler to save
     2// every incumbent solution to a new file
    33
    44#include <cstdio>
     
    1212
    1313static int callBack(CbcModel * model, int whereFrom)
    14 {/*
    15     OsiSolverInterface *solver = model->solver();
    16 
    17     printf("called code %d\n", whereFrom); fflush(stdout);
    18 
    19     if (whereFrom==6)
    20     {
    21     char str[256] = "original";
    22     if (solver->getPreProcessor())
    23     {
    24     strcpy(str, "preprocessed");
    25     }
    26     printf("\n< SOLUTION FOUND model is %s >\n", str);
    27     fflush( stdout );
    28     }*/
    29 
     14{
    3015    return 0;
    3116}
Note: See TracChangeset for help on using the changeset viewer.