1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 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   scip_nodesel.h
26   	 * @ingroup PUBLICCOREAPI
27   	 * @brief  public methods for node selector plugins
28   	 * @author Tobias Achterberg
29   	 * @author Timo Berthold
30   	 * @author Thorsten Koch
31   	 * @author Alexander Martin
32   	 * @author Marc Pfetsch
33   	 * @author Kati Wolter
34   	 * @author Gregor Hendel
35   	 * @author Leona Gottwald
36   	 */
37   	
38   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39   	
40   	#ifndef __SCIP_SCIP_NODESEL_H__
41   	#define __SCIP_SCIP_NODESEL_H__
42   	
43   	
44   	#include "scip/def.h"
45   	#include "scip/type_nodesel.h"
46   	#include "scip/type_retcode.h"
47   	#include "scip/type_scip.h"
48   	#include "scip/type_tree.h"
49   	
50   	#ifdef __cplusplus
51   	extern "C" {
52   	#endif
53   	
54   	/**@addtogroup PublicNodeSelectorMethods
55   	 *
56   	 * @{
57   	 */
58   	
59   	/** creates a node selector and includes it in SCIP.
60   	 *
61   	 *  @note method has all node selector callbacks as arguments and is thus changed every time a new
62   	 *        callback is added in future releases; consider using SCIPincludeNodeselBasic() and setter functions
63   	 *        if you seek for a method which is less likely to change in future releases
64   	 */
65   	SCIP_EXPORT
66   	SCIP_RETCODE SCIPincludeNodesel(
67   	   SCIP*                 scip,               /**< SCIP data structure */
68   	   const char*           name,               /**< name of node selector */
69   	   const char*           desc,               /**< description of node selector */
70   	   int                   stdpriority,        /**< priority of the node selector in standard mode */
71   	   int                   memsavepriority,    /**< priority of the node selector in memory saving mode */
72   	   SCIP_DECL_NODESELCOPY ((*nodeselcopy)),   /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
73   	   SCIP_DECL_NODESELFREE ((*nodeselfree)),   /**< destructor of node selector */
74   	   SCIP_DECL_NODESELINIT ((*nodeselinit)),   /**< initialize node selector */
75   	   SCIP_DECL_NODESELEXIT ((*nodeselexit)),   /**< deinitialize node selector */
76   	   SCIP_DECL_NODESELINITSOL((*nodeselinitsol)),/**< solving process initialization method of node selector */
77   	   SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)),/**< solving process deinitialization method of node selector */
78   	   SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
79   	   SCIP_DECL_NODESELCOMP ((*nodeselcomp)),   /**< node comparison method */
80   	   SCIP_NODESELDATA*     nodeseldata         /**< node selector data */
81   	   );
82   	
83   	/** Creates a node selector and includes it in SCIP with its most fundamental callbacks. All non-fundamental
84   	 *  (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
85   	 *  Optional callbacks can be set via specific setter functions, see SCIPsetNodeselCopy(), SCIPsetNodeselFree(),
86   	 *  SCIPsetNodeselInit(), SCIPsetNodeselExit(), SCIPsetNodeselInitsol(), and SCIPsetNodeselExitsol()
87   	 *
88   	 *  @note if you want to set all callbacks with a single method call, consider using SCIPincludeNodesel() instead
89   	 */
90   	SCIP_EXPORT
91   	SCIP_RETCODE SCIPincludeNodeselBasic(
92   	   SCIP*                 scip,               /**< SCIP data structure */
93   	   SCIP_NODESEL**        nodesel,            /**< reference to a node selector, or NULL */
94   	   const char*           name,               /**< name of node selector */
95   	   const char*           desc,               /**< description of node selector */
96   	   int                   stdpriority,        /**< priority of the node selector in standard mode */
97   	   int                   memsavepriority,    /**< priority of the node selector in memory saving mode */
98   	   SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
99   	   SCIP_DECL_NODESELCOMP ((*nodeselcomp)),   /**< node comparison method */
100  	   SCIP_NODESELDATA*     nodeseldata         /**< node selector data */
101  	   );
102  	
103  	/** sets copy method of node selector */
104  	SCIP_EXPORT
105  	SCIP_RETCODE SCIPsetNodeselCopy(
106  	   SCIP*                 scip,               /**< SCIP data structure */
107  	   SCIP_NODESEL*         nodesel,            /**< node selector */
108  	   SCIP_DECL_NODESELCOPY ((*nodeselcopy))    /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
109  	   );
110  	
111  	/** sets destructor method of node selector */
112  	SCIP_EXPORT
113  	SCIP_RETCODE SCIPsetNodeselFree(
114  	   SCIP*                 scip,               /**< SCIP data structure */
115  	   SCIP_NODESEL*         nodesel,            /**< node selector */
116  	   SCIP_DECL_NODESELFREE ((*nodeselfree))    /**< destructor of node selector */
117  	   );
118  	
119  	/** sets initialization method of node selector */
120  	SCIP_EXPORT
121  	SCIP_RETCODE SCIPsetNodeselInit(
122  	   SCIP*                 scip,               /**< SCIP data structure */
123  	   SCIP_NODESEL*         nodesel,            /**< node selector */
124  	   SCIP_DECL_NODESELINIT ((*nodeselinit))    /**< initialize node selector */
125  	   );
126  	
127  	/** sets deinitialization method of node selector */
128  	SCIP_EXPORT
129  	SCIP_RETCODE SCIPsetNodeselExit(
130  	   SCIP*                 scip,               /**< SCIP data structure */
131  	   SCIP_NODESEL*         nodesel,            /**< node selector */
132  	   SCIP_DECL_NODESELEXIT ((*nodeselexit))    /**< deinitialize node selector */
133  	   );
134  	
135  	/** sets solving process initialization method of node selector */
136  	SCIP_EXPORT
137  	SCIP_RETCODE SCIPsetNodeselInitsol(
138  	   SCIP*                 scip,               /**< SCIP data structure */
139  	   SCIP_NODESEL*         nodesel,            /**< node selector */
140  	   SCIP_DECL_NODESELINITSOL ((*nodeselinitsol))/**< solving process initialization method of node selector */
141  	   );
142  	
143  	/** sets solving process deinitialization method of node selector */
144  	SCIP_EXPORT
145  	SCIP_RETCODE SCIPsetNodeselExitsol(
146  	   SCIP*                 scip,               /**< SCIP data structure */
147  	   SCIP_NODESEL*         nodesel,            /**< node selector */
148  	   SCIP_DECL_NODESELEXITSOL ((*nodeselexitsol))/**< solving process deinitialization method of node selector */
149  	   );
150  	
151  	/** returns the node selector of the given name, or NULL if not existing */
152  	SCIP_EXPORT
153  	SCIP_NODESEL* SCIPfindNodesel(
154  	   SCIP*                 scip,               /**< SCIP data structure */
155  	   const char*           name                /**< name of node selector */
156  	   );
157  	
158  	/** returns the array of currently available node selectors */
159  	SCIP_EXPORT
160  	SCIP_NODESEL** SCIPgetNodesels(
161  	   SCIP*                 scip                /**< SCIP data structure */
162  	   );
163  	
164  	/** returns the number of currently available node selectors */
165  	SCIP_EXPORT
166  	int SCIPgetNNodesels(
167  	   SCIP*                 scip                /**< SCIP data structure */
168  	   );
169  	
170  	/** sets the priority of a node selector in standard mode */
171  	SCIP_EXPORT
172  	SCIP_RETCODE SCIPsetNodeselStdPriority(
173  	   SCIP*                 scip,               /**< SCIP data structure */
174  	   SCIP_NODESEL*         nodesel,            /**< node selector */
175  	   int                   priority            /**< new standard priority of the node selector */
176  	   );
177  	
178  	/** sets the priority of a node selector in memory saving mode */
179  	SCIP_EXPORT
180  	SCIP_RETCODE SCIPsetNodeselMemsavePriority(
181  	   SCIP*                 scip,               /**< SCIP data structure */
182  	   SCIP_NODESEL*         nodesel,            /**< node selector */
183  	   int                   priority            /**< new memory saving priority of the node selector */
184  	   );
185  	
186  	/** returns the currently used node selector */
187  	SCIP_EXPORT
188  	SCIP_NODESEL* SCIPgetNodesel(
189  	   SCIP*                 scip                /**< SCIP data structure */
190  	   );
191  	
192  	/** @} */
193  	
194  	#ifdef __cplusplus
195  	}
196  	#endif
197  	
198  	#endif
199