39 unsigned int initseed,
44 assert(bandit != NULL);
45 assert(banditvtable != NULL);
50 SCIPerrorMessage(
"Cannot create bandit selector with %d <= 0 actions\n", nactions);
56 assert(*bandit != NULL);
58 banditptr->
vtable = banditvtable;
59 banditptr->
data = banditdata;
77 assert(bandit != NULL);
78 assert(*bandit != NULL);
81 vtable = banditptr->
vtable;
82 assert(vtable != NULL);
85 if( vtable->banditfree != NULL )
87 SCIP_CALL( vtable->banditfree(blkmem, banditptr) );
108 assert(bandit != NULL);
109 assert(bufmem != NULL);
112 assert(vtable != NULL);
113 assert(vtable->banditreset != NULL);
116 if( priorities != NULL )
124 if( priorities[i] < 0 )
137 SCIP_CALL( vtable->banditreset(bufmem, bandit, priorities) );
148 assert(bandit != NULL);
149 assert(action != NULL);
153 assert(bandit->
vtable->banditselect != NULL);
157 assert(*action >= 0);
170 assert(bandit != NULL);
172 assert(bandit->
vtable->banditupdate != NULL);
184 assert(bandit != NULL);
195 assert(bandit != NULL);
197 bandit->
data = banditdata;
211 assert(banditvtable != NULL);
212 assert(name != NULL);
213 assert(banditfree != NULL);
214 assert(banditselect != NULL);
215 assert(banditupdate != NULL);
216 assert(banditreset != NULL);
221 banditvtableptr = *banditvtable;
222 banditvtableptr->banditfree = banditfree;
223 banditvtableptr->banditselect = banditselect;
224 banditvtableptr->banditupdate = banditupdate;
225 banditvtableptr->banditreset = banditreset;
236 assert(banditvtable != NULL);
237 assert(*banditvtable != NULL);
248 assert(banditvtable != NULL);
250 return banditvtable->
name;
259 assert(bandit != NULL);
269 assert(bandit != NULL);
SCIP_RETCODE SCIPbanditvtableCreate(SCIP_BANDITVTABLE **banditvtable, const char *name, SCIP_DECL_BANDITFREE((*banditfree)), SCIP_DECL_BANDITSELECT((*banditselect)), SCIP_DECL_BANDITUPDATE((*banditupdate)), SCIP_DECL_BANDITRESET((*banditreset)))
SCIP_RETCODE SCIPbanditSelect(SCIP_BANDIT *bandit, int *action)
const char * SCIPbanditvtableGetName(SCIP_BANDITVTABLE *banditvtable)
internal methods for bandit algorithms
void SCIPbanditvtableFree(SCIP_BANDITVTABLE **banditvtable)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPbanditReset(BMS_BUFMEM *bufmem, SCIP_BANDIT *bandit, SCIP_Real *priorities, unsigned int seed)
#define BMSfreeMemory(ptr)
SCIP_BANDITDATA * SCIPbanditGetData(SCIP_BANDIT *bandit)
#define BMSfreeMemoryArray(ptr)
data structures for bandit selection algorithms
#define SCIP_DECL_BANDITRESET(x)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem)
void SCIPrandomSetSeed(SCIP_RANDNUMGEN *randnumgen, unsigned int initseed)
internal methods for global SCIP settings
void SCIPbanditSetData(SCIP_BANDIT *bandit, SCIP_BANDITDATA *banditdata)
#define BMSduplicateMemoryArray(ptr, source, num)
#define BMSfreeBlockMemory(mem, ptr)
SCIP_BANDITVTABLE * vtable
public methods for bandit algorithms
SCIP_RETCODE SCIPbanditFree(BMS_BLKMEM *blkmem, SCIP_BANDIT **bandit)
SCIP_RETCODE SCIPbanditUpdate(SCIP_BANDIT *bandit, int action, SCIP_Real score)
struct SCIP_BanditData SCIP_BANDITDATA
#define SCIP_DECL_BANDITFREE(x)
int SCIPbanditGetNActions(SCIP_BANDIT *bandit)
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
#define BMSallocMemory(ptr)
#define SCIP_DECL_BANDITUPDATE(x)
SCIP_RANDNUMGEN * SCIPbanditGetRandnumgen(SCIP_BANDIT *bandit)
#define SCIP_DECL_BANDITSELECT(x)
#define BMSallocBlockMemory(mem, ptr)
struct BMS_BlkMem BMS_BLKMEM
datastructures for global SCIP settings
SCIP_RETCODE SCIPbanditCreate(SCIP_BANDIT **bandit, SCIP_BANDITVTABLE *banditvtable, BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem, SCIP_Real *priorities, int nactions, unsigned int initseed, SCIP_BANDITDATA *banditdata)