Scippy

SCIP

Solving Constraint Integer Programs

pub_bandit_epsgreedy.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_epsgreedy.h
17  * @ingroup PublicBanditMethods
18  * @brief public methods for the epsilon greedy bandit selector
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_EPSGREEDY_H_
25 #define SRC_SCIP_PUB_BANDIT_EPSGREEDY_H_
26 
27 
28 #include "scip/scip.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /**@addtogroup PublicBanditMethods
35  *
36  * ## Epsilon greedy
37  *
38  * Epsilon greedy is a randomized algorithm for the multi-armed bandit problem.
39  *
40  * In every iteration, it either
41  * selects an action uniformly at random with
42  * probability \f$ \varepsilon_t\f$
43  * or it greedily exploits the best action seen so far with
44  * probability \f$ 1 - \varepsilon_t \f$.
45  * In this implementation, \f$ \varepsilon_t \f$ decreases over time
46  * (number of selections performed), controlled by the epsilon parameter.
47  *
48  * @{
49  */
50 
51 /** create and resets an epsilon greedy bandit algorithm */
52 extern
54  SCIP* scip, /**< SCIP data structure */
55  SCIP_BANDIT** epsgreedy, /**< pointer to store the epsilon greedy bandit algorithm */
56  SCIP_Real* priorities, /**< nonnegative priorities for each action, or NULL if not needed */
57  SCIP_Real eps, /**< parameter to increase probability for exploration between all actions */
58  int nactions, /**< the number of possible actions */
59  unsigned int initseed /**< initial seed for random number generation */
60  );
61 
62 /** get weights array of epsilon greedy bandit algorithm */
63 extern
65  SCIP_BANDIT* epsgreedy /**< epsilon greedy bandit algorithm */
66  );
67 
68 /** set epsilon parameter of epsilon greedy bandit algorithm */
69 extern
71  SCIP_BANDIT* epsgreedy, /**< epsilon greedy bandit algorithm */
72  SCIP_Real eps /**< parameter to increase probability for exploration between all actions */
73  );
74 
75 /* @} */
76 
77 
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif
void SCIPsetEpsilonEpsgreedy(SCIP_BANDIT *epsgreedy, SCIP_Real eps)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
real eps
SCIP_RETCODE SCIPcreateBanditEpsgreedy(SCIP *scip, SCIP_BANDIT **epsgreedy, SCIP_Real *priorities, SCIP_Real eps, int nactions, unsigned int initseed)
#define SCIP_Real
Definition: def.h:149
SCIP_Real * SCIPgetWeightsEpsgreedy(SCIP_BANDIT *epsgreedy)
SCIP callable library.