Scippy

GCG

Branch-and-Price & Column Generation for Everyone

event_display.c
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* GCG --- Generic Column Generation */
5/* a Dantzig-Wolfe decomposition based extension */
6/* of the branch-cut-and-price framework */
7/* SCIP --- Solving Constraint Integer Programs */
8/* */
9/* Copyright (C) 2010-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file event_display.c
30 * @brief eventhdlr to disable the master display after the root node
31 * @author Martin Bergner
32 */
33
34/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35
36#include "gcg/event_display.h"
37#include "gcg/gcg.h"
38#include <string.h>
39
40#define EVENTHDLR_NAME "display"
41#define EVENTHDLR_DESC "event handler to disable the master display after the root node"
42
43
44/*
45 * Callback methods of event handler
46 */
47
48
49/** execution method of event handler */
50static
51SCIP_DECL_EVENTEXEC(eventExecDisplay)
52{ /*lint --e{715}*/
53 assert(scip != NULL);
54 assert(eventhdlr != NULL);
55 assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
56
57 /* solved node does not have to be the root node (can happen when solving was paused and resumed) */
58 SCIP_CALL( SCIPsetIntParam(scip, "display/verblevel", 0) );
60
61 return SCIP_OKAY;
62}
63
64/** activates the eventhandler in SCIP */
66 GCG* gcg /**< GCG data structure */
67 )
68{
69 SCIP* scip;
70 SCIP_EVENTHDLR* eventhdlr;
71
72 assert(gcg != NULL);
74 assert(GCGisMaster(scip));
75
77 assert(eventhdlr != NULL);
78
80
81 return SCIP_OKAY;
82}
83
84/** creates event handler for display event */
86 GCG* gcg /**< GCG data structure */
87 )
88{
89 SCIP_EVENTHDLR* eventhdlr = NULL;
90 SCIP* masterprob = GCGgetMasterprob(gcg);
91
92 assert(masterprob != NULL);
93 assert(GCGisMaster(masterprob));
94
95 /* include event handler into SCIP */
97 eventExecDisplay, NULL) );
98 assert(eventhdlr != NULL);
99
100 return SCIP_OKAY;
101}
#define SCIP_CALL(x)
SCIP_RETCODE GCGincludeEventHdlrDisplay(GCG *gcg)
Definition: event_display.c:85
static SCIP_DECL_EVENTEXEC(eventExecDisplay)
Definition: event_display.c:51
SCIP_RETCODE GCGactivateEventHdlrDisplay(GCG *gcg)
Definition: event_display.c:65
#define EVENTHDLR_DESC
Definition: event_display.c:41
#define EVENTHDLR_NAME
Definition: event_display.c:40
eventhdlr to disable the master display after the root node
GCG interface methods.
SCIP_Bool GCGisMaster(SCIP *scip)
Definition: misc.c:709
SCIP * GCGgetMasterprob(GCG *gcg)
Definition: gcg.cpp:99
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
#define NULL
Definition: struct_gcg.h:55
#define SCIP_EVENTTYPE_NODESOLVED
SCIP_OKAY
enum SCIP_Retcode SCIP_RETCODE