dialog_explore.cpp
Go to the documentation of this file.
34 * The explore menu gives the user detailed information about all decompositions and a possibility to edit such.
37 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
62 const char* DEFAULT_COLUMNS[] {"nr", "id", "nbloc", "nmacon", "nlivar", "nmavar", "nstlva", "score", "history", "pre", "nopcon", "nopvar", "sel"};
110 Column(const char* columnHeader, const char* columnDesc, T (*columnCallback)(SCIP*, int), RETTYPE columnType) :
155 if( newnpartialdecs != npartialdecs || (includeopenpartialdecs != (npartialdecs == idlist.size())) )
199 std::stable_sort(idlist.begin(), idlist.end(), [&](const int a, const int b) { return column->compareValues(scip, a, b) < 0; });
201 std::stable_sort(idlist.begin(), idlist.end(), [&](const int a, const int b) { return column->compareValues(scip, b, a) < 0; });
225 SCIPdialogMessage(scip, NULL, "Please specify the amount of entries to be shown in this menu:\n");
274 SCIPdialogMessage(scip, NULL, "0: max white, \n1: border area, \n2: classic, \n3: max foreseeing white, \n4: ppc-max-white, \n");
275 SCIPdialogMessage(scip, NULL, "5: max foreseeing white with aggregation info, \n6: ppc-max-white with aggregation info, \n7: experimental benders score\n");
277 SCIPdialogMessage(scip, NULL, "Note: Sets the detection/score/scoretype parameter to the given score.\n");
339 /* update partialdec list in case it changed (in which case the amount of partialdecs should have changed)*/
342 /* sort partialdec ids by score, descending (in case score was changed or id list was updated)*/
369 * a border line of the length of the column width as '-' for each column and a space between the columns,
501 SCIPdialogMessage(scip, NULL, "%30s %4c\n", DECdetectorGetName(detector), DECdetectorGetChar(detector));
507 SCIPdialogMessage(scip, NULL, "=================================================================================================== \n");
531 SCIPdialogMessage(scip, NULL, "%30s %s\n", GCGscoretypeGetShortName(GCGconshdlrDecompGetScoretype(scip)),
536 SCIPdialogMessage(scip, NULL, "\n=================================================================================================== \n");
552 SCIPdialogMessage(scip, NULL, "=================================================================================================== \n");
559 SCIPdialogMessage(scip, NULL, "%30s %s\n", "legend", "displays the legend for table header and history abbreviations");
560 SCIPdialogMessage(scip, NULL, "%30s %s\n", "select", "selects/unselects decomposition with given nr");
561 SCIPdialogMessage(scip, NULL, "%30s %s\n", "previous", "displays the preceding decompositions (if there are any)");
562 SCIPdialogMessage(scip, NULL, "%30s %s\n", "next", "displays the subsequent decompositions (if there are any)");
565 SCIPdialogMessage(scip, NULL, "%30s %s\n", "entries", "modifies the number of decompositions to display per page");
566 SCIPdialogMessage(scip, NULL, "%30s %s\n", "export", "generates visualization of the specified decomposition in gnuplot format");
567 SCIPdialogMessage(scip, NULL, "%30s %s\n", "visualize", "generates visualization and opens it (requires gnuplot)");
568 SCIPdialogMessage(scip, NULL, "%30s %s\n", "inspect", "displays detailed information for the specified decomposition");
569 SCIPdialogMessage(scip, NULL, "%30s %s\n", "score", "sets the score by which the quality of decompositions is evaluated");
570 SCIPdialogMessage(scip, NULL, "%30s %s\n", "sort", "sets the column by which the decompositions are sorted (default: by score)");
571 SCIPdialogMessage(scip, NULL, "%30s %s\n", "ascending", "sort decompositions in ascending (true) or descending (false) order");
572 SCIPdialogMessage(scip, NULL, "%30s %s\n", "list", "specify whether all decompositions should be listed");
575 SCIPdialogMessage(scip, NULL, "\n=================================================================================================== \n");
600 SCIPdialogMessage(scip, NULL, "Please specify the nr of the decomposition to be visualized:\n");
650 SCIPdialogMessage( scip, NULL, "Please specify the nr of the decomposition to be inspected:\n");
668 "Please specify the detail level:\n 0 - brief overview\n 1 - block and detector info (default)\n 2 - cons and var assignments\n" );
711 SCIPdialogMessage(scip, NULL, "\nPlease specify the nr of the decomposition to be selected:\n");
753 SCIPdialogMessage(scip, NULL, "\nPlease enter \"true\"/\"1\" for ascending or \"false\"/\"0\" for descending order:\n");
812 SCIPdialogMessage(scip, NULL, "\nPlease enter the table header of the column by which you would like to sort:\n");
849 SCIPdialogMessage(scip, NULL, "\nShould incomplete decompositions be listed? Please enter \"true\" or \"false\":\n");
908 else if( strncmp( command, "quit", commandlen) == 0 || strncmp( command, "..", commandlen) == 0 )
990 std::string sortby = DEFAULT_SORT_HEADER; /**< table header, identifies by which column to sort by */
994 unsigned int npartialdecs = 0; /**< stores the last known number of partialdecs, is handed down to check for changes in partialdec number */
1000 SCIPdialogMessage( scip, NULL, "There are no decompositions to explore yet, please detect first.\n" );
1005 /* the column information has the header, a getter for the column info and the return type of the getter */
1015 /* special case: "nr" represents the position in the menu table and is determined by the menu */
1027 "id of the decomposition (identifies the decomposition in reports/statistics/visualizations/etc.)",
1135 GCGdialogShowMenu(scip, columns, npartialdecs, startindex, menulength, idlist, sortasc, sortby, listopenpartialdecs);
1140 GCGdialogExecCommand(scip, dialoghdlr, dialog, columns, command, startindex, menulength, finished, idlist, sortasc, sortby, listopenpartialdecs);
static SCIP_RETCODE GCGdialogSetNEntires(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, int listlength, int &menulength)
Definition: dialog_explore.cpp:212
const char * DECdetectorGetName(DEC_DETECTOR *detector)
returns the name of the provided detector
Definition: cons_decomp.cpp:2618
SCIP_RETCODE GCGdialogExecExplore(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
method to handle user input for "explore" command
Definition: dialog_explore.cpp:980
miscellaneous methods for working with SCORETYPE
static SCIP_RETCODE GCGdialogSelect(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< int > idlist)
Definition: dialog_explore.cpp:695
std::string GCGconshdlrDecompGetDetectorHistoryByPartialdecId(SCIP *scip, int id)
gets detector history of partialdec with given id
Definition: cons_decomp.cpp:5224
std::string getValueAsString(SCIP *scip, int id) override
Definition: dialog_explore.cpp:117
virtual ~AbstractColumn()=default
static int partialdecIdDummyGetter(SCIP *scip, int id)
Definition: dialog_explore.cpp:970
float GCGconshdlrDecompGetScoreByPartialdecId(SCIP *scip, int id)
gets score of partialdec with given id
Definition: cons_decomp.cpp:5581
const char * GCGscoretypeGetShortName(SCORETYPE sctype)
Gets the shortname of the given scoretype.
Definition: scoretype.c:80
static SCIP_RETCODE GCGdialogShowMenu(SCIP *scip, std::vector< AbstractColumn * > &columns, unsigned int &npartialdecs, const int startindex, int menulength, std::vector< int > &idlist, bool sortasc, std::string sortby, bool listopenpartialdecs)
show current menu containing partialdec information
Definition: dialog_explore.cpp:325
~Column() override=default
void displayInfo(int detailLevel)
displays the relevant information of the partialdec
Definition: class_partialdecomp.cpp:2933
static SCIP_RETCODE GCGdialogChangeScore(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
Definition: dialog_explore.cpp:263
constraint handler for structure detection
static SCIP_RETCODE GCGdialogSortBy(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< AbstractColumn * > &columns, std::string &sortby)
Definition: dialog_explore.cpp:797
static SCIP_RETCODE GCGdialogSortAsc(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, bool &asc)
Definition: dialog_explore.cpp:739
const char * GCGscoretypeGetDescription(SCORETYPE sctype)
returns the description of the given scoretype
Definition: scoretype.c:73
Definition: class_conspartition.cpp:43
static SCIP_RETCODE GCGdialogShowLegend(SCIP *scip, std::vector< AbstractColumn * > &columns)
Definition: dialog_explore.cpp:479
bool isComplete()
Gets whether this partialdec is complete, i.e. it has no more open constraints and variables.
Definition: class_partialdecomp.cpp:4494
void GCGconshdlrDecompSetScoretype(SCIP *scip, SCORETYPE sctype)
Sets the currently used scoretype.
Definition: cons_decomp.cpp:5796
unsigned int GCGconshdlrDecompGetNPartialdecs(SCIP *scip)
Gets the number of all partialdecs.
Definition: cons_decomp.cpp:5505
void showVisualization()
generates and opens a gp visualization of the partialdec
Definition: class_partialdecomp.cpp:5359
static void sortPartialdecList(SCIP *scip, std::vector< int > &idlist, std::string &header, std::vector< AbstractColumn * > &columns, bool asc)
local sorting function for partialdec id vectors
Definition: dialog_explore.cpp:181
virtual std::string getValueAsString(SCIP *scip, int id)=0
int GCGconshdlrDecompGetNStairlinkingVarsByPartialdecId(SCIP *scip, int id)
gets number of stairlinking variables of partialdec with given id
Definition: cons_decomp.cpp:5544
std::vector< PARTIALDECOMP * > * GCGconshdlrDecompGetPartialdecs(SCIP *scip)
gets vector of all partialdecs
Definition: cons_decomp.cpp:5555
DEC_DETECTOR ** GCGconshdlrDecompGetDetectors(SCIP *scip)
Gets an array of all detectors.
Definition: cons_decomp.cpp:5238
void exportVisualization()
generates a gp visualization of the partialdec without compilation or opening
Definition: class_partialdecomp.cpp:5427
int GCGconshdlrDecompGetNMasterConssByPartialdecId(SCIP *scip, int id)
gets number of master constraints of partialdec with given id
Definition: cons_decomp.cpp:5405
Definition: struct_detector.h:46
char DECdetectorGetChar(DEC_DETECTOR *detector)
Gets the character of the detector.
Definition: cons_decomp.cpp:2598
static SCIP_RETCODE GCGdialogChangeListMode(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, bool &listopenpartialdecs)
Definition: dialog_explore.cpp:835
int GCGconshdlrDecompGetNOpenVarsByPartialdecId(SCIP *scip, int id)
gets number of open variables of partialdec with given id
Definition: cons_decomp.cpp:5438
Column(const char *columnHeader, const char *columnDesc, T(*columnCallback)(SCIP *, int), RETTYPE columnType)
Definition: dialog_explore.cpp:110
static SCIP_RETCODE GCGdialogShowHelp(SCIP *scip)
Shows help section of explore menu.
Definition: dialog_explore.cpp:546
C++ interface of cons_decomp.
static UNKNOWN_DUMMY_TYPE UNKNOWN_DUMMY_CALLBACK(SCIP *scip, int id)
Definition: dialog_explore.cpp:79
virtual int compareValues(SCIP *scip, int firstId, int secondId)=0
int compareValues(SCIP *scip, int firstId, int secondId) override
Definition: dialog_explore.cpp:124
static SCIP_RETCODE GCGdialogSelectVisualize(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< int > &idlist, SCIP_Bool open)
Definition: dialog_explore.cpp:585
void setSelected(bool selected)
set the selection status of this partialdecs
Definition: class_partialdecomp.cpp:5047
SCIP_Bool GCGconshdlrDecompIsPresolvedByPartialdecId(SCIP *scip, int id)
gets whether partialdec with given id is presolved
Definition: cons_decomp.cpp:5647
static bool isHeader(std::string &header, std::vector< AbstractColumn * > &columns)
Definition: dialog_explore.cpp:777
int GCGconshdlrDecompGetNBlocksByPartialdecId(SCIP *scip, int id)
gets block number of partialdec with given id
Definition: cons_decomp.cpp:5316
PARTIALDECOMP * GCGconshdlrDecompGetPartialdecFromID(SCIP *scip, int partialdecid)
local method to find a partialdec for a given id or NULL if no partialdec with such id is found
Definition: cons_decomp.cpp:317
Definition: dialog_explore.cpp:85
static SCIP_RETCODE outputCharXTimes(SCIP *scip, const char letter, int x)
Definition: dialog_explore.cpp:306
static SCIP_RETCODE GCGdialogInspectPartialdec(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< int > &idlist)
Definition: dialog_explore.cpp:632
int GCGconshdlrDecompGetNLinkingVarsByPartialdecId(SCIP *scip, int id)
gets number of linking variables of partialdec with given id
Definition: cons_decomp.cpp:5394
int GCGconshdlrDecompGetNDetectors(SCIP *scip)
Gets the number of all detectors.
Definition: cons_decomp.cpp:5348
SCIP_Bool GCGconshdlrDecompIsSelectedByPartialdecId(SCIP *scip, int id)
gets whether partialdec with given id is selected
Definition: cons_decomp.cpp:5658
class storing (potentially incomplete) decompositions
SCORETYPE GCGconshdlrDecompGetScoretype(SCIP *scip)
Gets the currently selected scoretype.
Definition: cons_decomp.cpp:5601
AbstractColumn(const char *columnHeader, const char *columnDesc, RETTYPE columnType)
Definition: dialog_explore.cpp:88
int GCGconshdlrDecompGetNMasterVarsByPartialdecId(SCIP *scip, int id)
gets number of master variables of partialdec with given id
Definition: cons_decomp.cpp:5416
Definition: dialog_explore.cpp:107
int GCGconshdlrDecompGetNOpenConssByPartialdecId(SCIP *scip, int id)
gets number of open constraints of partialdec with given id
Definition: cons_decomp.cpp:5427
bool isAssignedToOrigProb()
Gets whether the partialdec is from the presolved problem.
Definition: class_partialdecomp.cpp:4533
static SCIP_RETCODE GCGdialogExecCommand(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< AbstractColumn * > &columns, char *command, int &startindex, int &menulength, bool &finished, std::vector< int > &idlist, bool &sortasc, std::string &sortby, bool &listopenpartialdecs)
Definition: dialog_explore.cpp:868
bool updateIdList(SCIP *scip, std::vector< int > &idlist, unsigned int &npartialdecs, bool includeopenpartialdecs)
Definition: dialog_explore.cpp:147