Detailed Description
internal methods for bandit algorithms
Definition in file bandit.h.
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_result.h"
#include "scip/type_set.h"
#include "scip/type_primal.h"
#include "scip/type_bandit.h"
#include "scip/stat.h"
Go to the source code of this file.
Functions | |
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) |
SCIP_RETCODE | SCIPbanditFree (BMS_BLKMEM *blkmem, SCIP_BANDIT **bandit) |
SCIP_RETCODE | SCIPbanditReset (BMS_BUFMEM *bufmem, SCIP_BANDIT *bandit, SCIP_Real *priorities, unsigned int seed) |
SCIP_BANDITDATA * | SCIPbanditGetData (SCIP_BANDIT *bandit) |
void | SCIPbanditSetData (SCIP_BANDIT *bandit, SCIP_BANDITDATA *banditdata) |
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))) |
void | SCIPbanditvtableFree (SCIP_BANDITVTABLE **banditvtable) |
Function Documentation
◆ SCIPbanditCreate()
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 | ||
) |
creates and resets bandit algorithm
- Parameters
-
bandit pointer to bandit algorithm data structure banditvtable virtual table for this bandit algorithm blkmem block memory for parameter settings bufmem buffer memory priorities nonnegative priorities for each action, or NULL if not needed nactions the positive number of actions for this bandit initseed initial seed for random number generation banditdata algorithm specific bandit data
Definition at line 33 of file bandit.c.
References BMSallocBlockMemory, SCIP_Bandit::data, SCIP_Bandit::nactions, NULL, SCIP_Bandit::rng, SCIP_ALLOC, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPbanditReset(), SCIPerrorMessage, SCIPrandomCreate(), and SCIP_Bandit::vtable.
Referenced by SCIPbanditCreateEpsgreedy(), SCIPbanditCreateExp3(), and SCIPbanditCreateUcb().
◆ SCIPbanditFree()
SCIP_RETCODE SCIPbanditFree | ( | BMS_BLKMEM * | blkmem, |
SCIP_BANDIT ** | bandit | ||
) |
calls destructor and frees memory of bandit algorithm
- Parameters
-
blkmem block memory bandit pointer to bandit algorithm data structure
Definition at line 71 of file bandit.c.
References BMSfreeBlockMemory, NULL, SCIP_Bandit::rng, SCIP_CALL, SCIP_OKAY, SCIPrandomFree(), and SCIP_Bandit::vtable.
Referenced by SCIPfreeBandit().
◆ SCIPbanditReset()
SCIP_RETCODE SCIPbanditReset | ( | BMS_BUFMEM * | bufmem, |
SCIP_BANDIT * | bandit, | ||
SCIP_Real * | priorities, | ||
unsigned int | seed | ||
) |
reset the bandit algorithm
- Parameters
-
bufmem buffer memory bandit pointer to bandit algorithm data structure priorities nonnegative priorities for each action, or NULL if not needed seed initial seed for random number generation
Definition at line 100 of file bandit.c.
References NULL, SCIP_Bandit::rng, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPbanditGetNActions(), SCIPerrorMessage, SCIPrandomSetSeed(), and SCIP_Bandit::vtable.
Referenced by SCIPbanditCreate(), and SCIPresetBandit().
◆ SCIPbanditGetData()
SCIP_BANDITDATA* SCIPbanditGetData | ( | SCIP_BANDIT * | bandit | ) |
get data of this bandit algorithm
- Parameters
-
bandit bandit algorithm data structure
Definition at line 181 of file bandit.c.
References SCIP_Bandit::data, and NULL.
Referenced by SCIP_DECL_BANDITFREE(), SCIP_DECL_BANDITRESET(), SCIP_DECL_BANDITSELECT(), SCIP_DECL_BANDITUPDATE(), SCIPgetConfidenceBoundUcb(), SCIPgetProbabilityExp3(), SCIPgetStartPermutationUcb(), SCIPgetWeightsEpsgreedy(), SCIPsetBetaExp3(), SCIPsetEpsilonEpsgreedy(), and SCIPsetGammaExp3().
◆ SCIPbanditSetData()
void SCIPbanditSetData | ( | SCIP_BANDIT * | bandit, |
SCIP_BANDITDATA * | banditdata | ||
) |
set the data of this bandit algorithm
- Parameters
-
bandit bandit algorithm data structure banditdata bandit algorihm specific data, or NULL
Definition at line 191 of file bandit.c.
References SCIP_Bandit::data, and NULL.
Referenced by SCIP_DECL_BANDITFREE().
◆ SCIPbanditvtableCreate()
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)) | |||
) |
create a bandit VTable for bandit algorithm callback functions
- Parameters
-
banditvtable pointer to virtual table for bandit algorithm name a name for the algorithm represented by this vtable
Definition at line 236 of file bandit.c.
References doBanditvtableCreate(), NULL, SCIP_CALL_FINALLY, SCIP_OKAY, and SCIPbanditvtableFree().
Referenced by SCIPincludeBanditvtable().
◆ SCIPbanditvtableFree()
void SCIPbanditvtableFree | ( | SCIP_BANDITVTABLE ** | banditvtable | ) |
free a bandit vTable for bandit algorithm callback functions
free a bandit virtual table for bandit algorithm callback functions
- Parameters
-
banditvtable pointer to virtual table for bandit algorithm
Definition at line 260 of file bandit.c.
References BMSfreeMemory, BMSfreeMemoryArrayNull, and NULL.
Referenced by SCIPbanditvtableCreate().