Scippy

SCIP

Solving Constraint Integer Programs

scip_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 scip_bandit.h
26  * @ingroup PUBLICCOREAPI
27  * @brief public methods for bandit algorithms
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_BANDIT_H__
41 #define __SCIP_SCIP_BANDIT_H__
42 
43 
44 #include "scip/def.h"
45 #include "scip/type_bandit.h"
46 #include "scip/type_retcode.h"
47 #include "scip/type_scip.h"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 /**@addtogroup PublicBanditMethods
54  *
55  * @{
56  */
57 
58 /** includes a bandit algorithm virtual function table */
59 SCIP_EXPORT
61  SCIP* scip, /**< SCIP data structure */
62  SCIP_BANDITVTABLE** banditvtable, /**< bandit algorithm virtual function table */
63  const char* name, /**< a name for the algorithm represented by this vtable */
64  SCIP_DECL_BANDITFREE ((*banditfree)), /**< callback to free bandit specific data structures */
65  SCIP_DECL_BANDITSELECT((*banditselect)), /**< selection callback for bandit selector */
66  SCIP_DECL_BANDITUPDATE((*banditupdate)), /**< update callback for bandit algorithms */
67  SCIP_DECL_BANDITRESET ((*banditreset)) /**< update callback for bandit algorithms */
68  );
69 
70 /** returns the bandit virtual function table of the given name, or NULL if not existing */
71 SCIP_EXPORT
73  SCIP* scip, /**< SCIP data structure */
74  const char* name /**< name of bandit algorithm virtual function table */
75  );
76 
77 /** calls destructor and frees memory of bandit algorithm */
78 SCIP_EXPORT
80  SCIP* scip, /**< SCIP data structure */
81  SCIP_BANDIT** bandit /**< pointer to bandit algorithm data structure */
82  );
83 
84 /** reset the bandit algorithm */
85 SCIP_EXPORT
87  SCIP* scip, /**< SCIP data structure */
88  SCIP_BANDIT* bandit, /**< pointer to bandit algorithm data structure */
89  SCIP_Real* priorities, /**< priorities for every action, or NULL if not needed */
90  unsigned int seed /**< initial random seed for bandit selection */
91  );
92 
93 /** @} */
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPfreeBandit(SCIP *scip, SCIP_BANDIT **bandit)
Definition: scip_bandit.c:107
type definitions for SCIP&#39;s main datastructure
#define SCIP_DECL_BANDITRESET(x)
Definition: type_bandit.h:82
SCIP_BANDITVTABLE * SCIPfindBanditvtable(SCIP *scip, const char *name)
Definition: scip_bandit.c:80
type definitions for bandit selection algorithms
SCIP_RETCODE SCIPincludeBanditvtable(SCIP *scip, SCIP_BANDITVTABLE **banditvtable, const char *name, SCIP_DECL_BANDITFREE((*banditfree)), SCIP_DECL_BANDITSELECT((*banditselect)), SCIP_DECL_BANDITUPDATE((*banditupdate)), SCIP_DECL_BANDITRESET((*banditreset)))
Definition: scip_bandit.c:48
#define SCIP_DECL_BANDITFREE(x)
Definition: type_bandit.h:63
#define SCIP_Real
Definition: def.h:186
SCIP_RETCODE SCIPresetBandit(SCIP *scip, SCIP_BANDIT *bandit, SCIP_Real *priorities, unsigned int seed)
Definition: scip_bandit.c:91
#define SCIP_DECL_BANDITUPDATE(x)
Definition: type_bandit.h:75
#define SCIP_DECL_BANDITSELECT(x)
Definition: type_bandit.h:69
common defines and data types used in all packages of SCIP