Scippy

SCIP

Solving Constraint Integer Programs

bandit_ucb.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 bandit_ucb.h
26  * @ingroup INTERNALAPI
27  * @brief internal methods for UCB bandit algorithm
28  * @author Gregor Hendel
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_BANDIT_UCB_H__
34 #define __SCIP_BANDIT_UCB_H__
35 
36 
37 #include "blockmemshell/memory.h"
38 #include "scip/def.h"
39 #include "scip/type_bandit.h"
40 #include "scip/type_retcode.h"
41 #include "scip/type_scip.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /** include virtual function table for UCB bandit algorithms */
49  SCIP* scip /**< SCIP data structure */
50  );
51 
52 /*
53  * Callback methods of bandit algorithm
54  */
55 
56 /** callback to free bandit specific data structures */
57 SCIP_DECL_BANDITFREE(SCIPbanditFreeUcb);
58 
59 /** selection callback for bandit selector */
60 SCIP_DECL_BANDITSELECT(SCIPbanditSelectUcb);
61 
62 /** update callback for bandit algorithm */
63 SCIP_DECL_BANDITUPDATE(SCIPbanditUpdateUcb);
64 
65 /** reset callback for bandit algorithm */
66 SCIP_DECL_BANDITRESET(SCIPbanditResetUcb);
67 
68 /** internal method to create and reset UCB bandit algorithm */
70  BMS_BLKMEM* blkmem, /**< block memory */
71  BMS_BUFMEM* bufmem, /**< buffer memory */
72  SCIP_BANDITVTABLE* vtable, /**< virtual function table for UCB bandit algorithm */
73  SCIP_BANDIT** ucb, /**< pointer to store bandit algorithm */
74  SCIP_Real* priorities, /**< nonnegative priorities for each action, or NULL if not needed */
75  SCIP_Real alpha, /**< parameter to increase confidence width */
76  int nactions, /**< the positive number of actions for this bandit algorithm */
77  unsigned int initseed /**< initial random seed */
78  );
79 
80 #ifdef __cplusplus
81 }
82 
83 #endif
84 
85 #endif
SCIP_DECL_BANDITFREE(SCIPbanditFreeUcb)
Definition: bandit_ucb.c:125
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for return codes for SCIP methods
SCIP_DECL_BANDITRESET(SCIPbanditResetUcb)
Definition: bandit_ucb.c:241
SCIP_DECL_BANDITUPDATE(SCIPbanditUpdateUcb)
Definition: bandit_ucb.c:218
type definitions for SCIP&#39;s main datastructure
type definitions for bandit selection algorithms
SCIP_RETCODE SCIPincludeBanditvtableUcb(SCIP *scip)
Definition: bandit_ucb.c:364
SCIP_DECL_BANDITSELECT(SCIPbanditSelectUcb)
Definition: bandit_ucb.c:146
SCIP_RETCODE SCIPbanditCreateUcb(BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem, SCIP_BANDITVTABLE *vtable, SCIP_BANDIT **ucb, SCIP_Real *priorities, SCIP_Real alpha, int nactions, unsigned int initseed)
Definition: bandit_ucb.c:305
#define SCIP_Real
Definition: def.h:186
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:439
memory allocation routines