Policies.BaseWrapperPolicy module¶
Base class for any wrapper policy.
It encapsulates another policy, and defer all methods calls to the underlying policy.
For instance, see
Policies.SparseWrapper
,Policies.DoublingTrickWrapper
orPolicies.SlidingWindowRestart
.
-
class
Policies.BaseWrapperPolicy.
BaseWrapperPolicy
(nbArms, policy=<class 'Policies.UCB.UCB'>, *args, **kwargs)[source]¶ Bases:
Policies.BasePolicy.BasePolicy
Base class for any wrapper policy.
-
startGame
(createNewPolicy=True)[source]¶ Initialize the policy for a new game.
Warning
createNewPolicy=True
creates a new object for the underlying policy, whilecreateNewPolicy=False
only callBasePolicy.startGame()
.
-
getReward
(arm, reward)[source]¶ Pass the reward, as usual, update t and sometimes restart the underlying policy.
-
property
index
¶ Get attribute
index
from the underlying policy.
-
choiceFromSubSet
(availableArms='all')[source]¶ Pass the call to
choiceFromSubSet
of the underlying policy.
-
choiceIMP
(nb=1, startWithChoiceMultiple=True)[source]¶ Pass the call to
choiceIMP
of the underlying policy.
-
__module__
= 'Policies.BaseWrapperPolicy'¶
-