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