Scippy

SCIP

Solving Constraint Integer Programs

EventhdlrNewSol.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file EventhdlrNewSol.h
26  * @brief event handler for new solutions in TSP
27  * @author Timo Berthold
28  */
29 
30 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
31 
32 #ifndef __EVENTHDLRNEWSOL_H__
33 #define __EVENTHDLRNEWSOL_H__
34 
35 #include "objscip/objscip.h"
36 
37 namespace tsp
38 {
39 
40 /** C++ wrapper object for event handlers */
42 {
43 public:
44  /** default constructor */
46  SCIP* scip
47  )
48  : ObjEventhdlr(scip, "newsol","event handler for new solutions in TSP")
49  {
50  }
51 
52  /** destructor */
53  virtual ~EventhdlrNewSol()
54  {
55  }
56 
57  /** destructor of event handler to free user data (called when SCIP is exiting) */
58  virtual SCIP_DECL_EVENTFREE(scip_free);
59 
60  /** initialization method of event handler (called after problem was transformed) */
61  virtual SCIP_DECL_EVENTINIT(scip_init);
62 
63  /** deinitialization method of event handler (called before transformed problem is freed) */
64  virtual SCIP_DECL_EVENTEXIT(scip_exit);
65 
66  /** solving process initialization method of event handler (called when branch and bound process is about to begin)
67  *
68  * This method is called when the presolving was finished and the branch and bound process is about to begin.
69  * The event handler may use this call to initialize its branch and bound specific data.
70  *
71  */
72  virtual SCIP_DECL_EVENTINITSOL(scip_initsol);
73 
74  /** solving process deinitialization method of event handler (called before branch and bound process data is freed)
75  *
76  * This method is called before the branch and bound process is freed.
77  * The event handler should use this call to clean up its branch and bound data.
78  */
79  virtual SCIP_DECL_EVENTEXITSOL(scip_exitsol);
80 
81  /** frees specific constraint data */
82  virtual SCIP_DECL_EVENTDELETE(scip_delete);
83 
84  /** execution method of event handler
85  *
86  * Processes the event. The method is called every time an event occurs, for which the event handler
87  * is responsible. Event handlers may declare themselves resposible for events by calling the
88  * corresponding SCIPcatch...() method. This method creates an event filter object to point to the
89  * given event handler and event data.
90  */
91  virtual SCIP_DECL_EVENTEXEC(scip_exec);
92 }; /*lint !e1712*/
93 
94 } /* namespace tsp */
95 
96 #endif
virtual SCIP_DECL_EVENTINITSOL(scip_initsol)
virtual SCIP_DECL_EVENTEXIT(scip_exit)
EventhdlrNewSol(SCIP *scip)
virtual SCIP_DECL_EVENTEXEC(scip_exec)
ObjEventhdlr(SCIP *scip, const char *name, const char *desc)
Definition: objeventhdlr.h:67
virtual SCIP_DECL_EVENTEXITSOL(scip_exitsol)
C++ wrapper classes for SCIP.
virtual SCIP_DECL_EVENTFREE(scip_free)
virtual SCIP_DECL_EVENTINIT(scip_init)
C++ wrapper for event handlers.
Definition: objeventhdlr.h:52
virtual SCIP_DECL_EVENTDELETE(scip_delete)