Scippy

SCIP

Solving Constraint Integer Programs

pub_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 2002-2022 Zuse Institute Berlin */
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 pub_bandit.h
26  * @ingroup PublicBanditMethods
27  * @brief public methods for bandit algorithms
28  * @author Gregor Hendel
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_PUB_BANDIT_H__
34 #define __SCIP_PUB_BANDIT_H__
35 
36 #include "scip/def.h"
38 #include "scip/pub_bandit_exp3.h"
39 #include "scip/pub_bandit_ucb.h"
40 #include "scip/type_misc.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /**@addtogroup PublicBanditMethods
47  *
48  * @{
49  */
50 
51 /** select the next action */
52 SCIP_EXPORT
54  SCIP_BANDIT* bandit, /**< bandit algorithm data structure */
55  int* action /**< pointer to store the selected action */
56  );
57 
58 /** update the score of the selected action */
59 SCIP_EXPORT
61  SCIP_BANDIT* bandit, /**< bandit algorithm data structure */
62  int action, /**< index of action for which the score should be updated */
63  SCIP_Real score /**< observed gain of the i'th action */
64  );
65 
66 /** return the name of this bandit virtual function table */
67 SCIP_EXPORT
68 const char* SCIPbanditvtableGetName(
69  SCIP_BANDITVTABLE* banditvtable /**< virtual table for bandit algorithm */
70  );
71 
72 /** return the random number generator of a bandit algorithm */
73 SCIP_EXPORT
75  SCIP_BANDIT* bandit /**< bandit algorithm data structure */
76  );
77 
78 /** return number of actions of this bandit algorithm */
79 SCIP_EXPORT
81  SCIP_BANDIT* bandit /**< bandit algorithm data structure */
82  );
83 
84 /** @} */
85 
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif
public methods for the epsilon greedy bandit selector
type definitions for miscellaneous datastructures
SCIP_RETCODE SCIPbanditSelect(SCIP_BANDIT *bandit, int *action)
Definition: bandit.c:153
const char * SCIPbanditvtableGetName(SCIP_BANDITVTABLE *banditvtable)
Definition: bandit.c:282
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_RETCODE SCIPbanditUpdate(SCIP_BANDIT *bandit, int action, SCIP_Real score)
Definition: bandit.c:174
#define SCIP_Real
Definition: def.h:186
int SCIPbanditGetNActions(SCIP_BANDIT *bandit)
Definition: bandit.c:303
public methods for Exp.3
SCIP_RANDNUMGEN * SCIPbanditGetRandnumgen(SCIP_BANDIT *bandit)
Definition: bandit.c:293
common defines and data types used in all packages of SCIP
public methods for UCB bandit selection