1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*                  This file is part of the program and library             */
4 /*         SCIP --- Solving Constraint Integer Programs                      */
5 /*                                                                           */
6 /*    Copyright (C) 2002-2021 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 scipopt.org.         */
13 /*                                                                           */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file   struct_bandit.h
17  * @ingroup INTERNALAPI
18  * @brief  data structures for bandit selection algorithms
19  * @author Gregor Hendel
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_STRUCT_BANDIT_H__
25 #define __SCIP_STRUCT_BANDIT_H__
26 
27 
28 #include "scip/def.h"
29 #include "misc.h"
30 #include "scip/type_clock.h"
31 #include "scip/type_bandit.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /** virtual function table for bandit selection algorithms */
38 struct SCIP_BanditVTable
39 {
40    const char*           name;               /**< name of the represented bandit algorithm */
41    SCIP_DECL_BANDITFREE  ((*banditfree));    /**< callback to free bandit specific data structures */
42    SCIP_DECL_BANDITSELECT((*banditselect));  /**< selection callback for bandit selector */
43    SCIP_DECL_BANDITUPDATE((*banditupdate));  /**< update callback for bandit algorithms */
44    SCIP_DECL_BANDITRESET ((*banditreset));   /**< update callback for bandit algorithms */
45 };
46 
47 /** data structure for bandit algorithms */
48 struct SCIP_Bandit
49 {
50    SCIP_BANDITVTABLE*    vtable;             /**< virtual function table for callbacks */
51    SCIP_RANDNUMGEN*      rng;                /**< random number generator for randomized selection */
52    int                   nactions;           /**< the number of actions to select from */
53    SCIP_BANDITDATA*      data;               /**< specific data for bandit algorithm implementations */
54 };
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif
60