Scippy

SCIP

Solving Constraint Integer Programs

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-2019 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 visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file bandit_epsgreedy.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for epsilon greedy bandit selection
19  * @author Gregor Hendel
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_BANDIT_EPSGREEDY_H__
25 #define __SCIP_BANDIT_EPSGREEDY_H__
26 
27 
28 #include "blockmemshell/memory.h"
29 #include "scip/def.h"
30 #include "scip/type_bandit.h"
31 #include "scip/type_retcode.h"
32 #include "scip/type_scip.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /** creates the epsilon greedy bandit algorithm includes it in SCIP */
40  SCIP* scip /**< SCIP data structure */
41  );
42 
43 /** callback to free bandit specific data structures */
44 SCIP_DECL_BANDITFREE(SCIPbanditFreeEpsgreedy);
45 
46 /** selection callback for bandit algorithm */
47 SCIP_DECL_BANDITSELECT(SCIPbanditSelectEpsgreedy);
48 
49 /** update callback for bandit algorithm */
50 SCIP_DECL_BANDITUPDATE(SCIPbanditUpdateEpsgreedy);
51 
52 /** reset callback for bandit algorithm */
53 SCIP_DECL_BANDITRESET(SCIPbanditResetEpsgreedy);
54 
55 
56 /** internal method to create and reset epsilon greedy bandit algorithm */
58  BMS_BLKMEM* blkmem, /**< block memory */
59  BMS_BUFMEM* bufmem, /**< buffer memory */
60  SCIP_BANDITVTABLE* vtable, /**< virtual function table with epsilon greedy callbacks */
61  SCIP_BANDIT** epsgreedy, /**< pointer to store the epsilon greedy bandit algorithm */
62  SCIP_Real* priorities, /**< nonnegative priorities for each action, or NULL if not needed */
63  SCIP_Real eps, /**< parameter to increase probability for exploration between all actions */
64  SCIP_Bool preferrecent, /**< should the weights be updated in an exponentially decaying way? */
65  SCIP_Real decayfactor, /**< the factor to reduce the weight of older observations if exponential decay is enabled */
66  int avglim, /**< nonnegative limit on observation number before the exponential decay starts,
67  * only relevant if exponential decay is enabled
68  */
69  int nactions, /**< the number of possible actions */
70  unsigned int initseed /**< initial random seed */
71  );
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for return codes for SCIP methods
real eps
SCIP_DECL_BANDITSELECT(SCIPbanditSelectEpsgreedy)
type definitions for SCIP&#39;s main datastructure
type definitions for bandit selection algorithms
SCIP_RETCODE SCIPbanditCreateEpsgreedy(BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem, SCIP_BANDITVTABLE *vtable, SCIP_BANDIT **epsgreedy, SCIP_Real *priorities, SCIP_Real eps, SCIP_Bool preferrecent, SCIP_Real decayfactor, int avglim, int nactions, unsigned int initseed)
#define SCIP_Bool
Definition: def.h:70
SCIP_DECL_BANDITRESET(SCIPbanditResetEpsgreedy)
SCIP_DECL_BANDITUPDATE(SCIPbanditUpdateEpsgreedy)
SCIP_RETCODE SCIPincludeBanditvtableEpsgreedy(SCIP *scip)
SCIP_DECL_BANDITFREE(SCIPbanditFreeEpsgreedy)
#define SCIP_Real
Definition: def.h:164
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:427
memory allocation routines