Scippy

SCIP

Solving Constraint Integer Programs

pub_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-2018 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_bandit_ucb.h
17  * @ingroup PublicBanditMethods
18  * @brief public methods for UCB bandit selection
19  * @author Gregor Hendel
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef SRC_SCIP_PUB_BANDIT_UCB_H_
25 #define SRC_SCIP_PUB_BANDIT_UCB_H_
26 
27 
28 #include "scip/scip.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 
35 /**@addtogroup PublicBanditMethods
36  *
37  * ## Upper Confidence Bounds (UCB)
38  *
39  * UCB (Upper confidence bounds) is a deterministic
40  * selection algorithm for the multi-armed bandit problem.
41  * In every iteration, UCB selects the action that maximizes
42  * a tradeoff between its performance in the past
43  * and a variance term.
44  * The influence of the variance (confidence width) can be
45  * controlled by the parameter \f$ \alpha \f$.
46  *
47  * @{
48  */
49 
50 
51 /** create and reset UCB bandit algorithm */
52 extern
54  SCIP* scip, /**< SCIP data structure */
55  SCIP_BANDIT** ucb, /**< pointer to store bandit algorithm */
56  SCIP_Real* priorities, /**< nonnegative priorities for each action, or NULL if not needed */
57  SCIP_Real alpha, /**< parameter to increase confidence width */
58  int nactions, /**< the positive number of actions for this bandit algorithm */
59  unsigned int initseed /**< initial random number seed */
60  );
61 
62 /** returns the upper confidence bound of a selected action */
63 extern
65  SCIP_BANDIT* ucb, /**< UCB bandit algorithm */
66  int action /**< index of the queried action */
67  );
68 
69 /** return start permutation of the UCB bandit algorithm */
70 extern
72  SCIP_BANDIT* ucb /**< UCB bandit algorithm */
73  );
74 
75 /** @}*/
76 
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif
SCIP_RETCODE SCIPcreateBanditUcb(SCIP *scip, SCIP_BANDIT **ucb, SCIP_Real *priorities, SCIP_Real alpha, int nactions, unsigned int initseed)
Definition: bandit_ucb.c:325
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
int * SCIPgetStartPermutationUcb(SCIP_BANDIT *ucb)
Definition: bandit_ucb.c:279
#define SCIP_Real
Definition: def.h:149
SCIP_Real SCIPgetConfidenceBoundUcb(SCIP_BANDIT *ucb, int action)
Definition: bandit_ucb.c:250
SCIP callable library.