Scippy

SCIP

Solving Constraint Integer Programs

type_bandit.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-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 type_bandit.h
26  * @ingroup TYPEDEFINITIONS
27  * @brief type definitions for bandit selection algorithms
28  * @author Gregor Hendel
29  *
30  * This file defines the interface for bandit selection algorithms implemented in C.
31  * see \ref PublicBanditMethods for all publicly available bandit methods.
32  */
33 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 #ifndef __SCIP_TYPE_BANDIT_H__
37 #define __SCIP_TYPE_BANDIT_H__
38 
39 #include "scip/def.h"
40 #include "scip/type_scip.h"
41 #include "scip/type_result.h"
42 #include "scip/type_timing.h"
43 #include "blockmemshell/memory.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /** data structure for bandit algorithms */
50 typedef struct SCIP_Bandit SCIP_BANDIT;
51 
52 /** virtual function table for bandit callbacks */
54 
55 /** data structure for specific bandit algorithm implementation */
56 typedef struct SCIP_BanditData SCIP_BANDITDATA;
57 
58 /*
59  * callbacks for bandit virtual function table
60  */
61 
62 /** callback to free bandit specific data structures */
63 #define SCIP_DECL_BANDITFREE(x) SCIP_RETCODE x ( \
64  BMS_BLKMEM* blkmem, \
65  SCIP_BANDIT* bandit \
66 )
67 
68 /** selection callback for bandit selector */
69 #define SCIP_DECL_BANDITSELECT(x) SCIP_RETCODE x ( \
70  SCIP_BANDIT* bandit, \
71  int* selection \
72 )
73 
74 /** update callback for bandit algorithms */
75 #define SCIP_DECL_BANDITUPDATE(x) SCIP_RETCODE x ( \
76  SCIP_BANDIT* bandit, \
77  int selection, \
78  SCIP_Real score \
79 )
80 
81 /** reset callback for bandit algorithms */
82 #define SCIP_DECL_BANDITRESET(x) SCIP_RETCODE x ( \
83  BMS_BUFMEM* bufmem, \
84  SCIP_BANDIT* bandit, \
85  SCIP_Real* priorities \
86 )
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif
timing definitions for SCIP
type definitions for SCIP's main datastructure
struct SCIP_BanditData SCIP_BANDITDATA
Definition: type_bandit.h:56
result codes for SCIP callback methods
common defines and data types used in all packages of SCIP
memory allocation routines