Forager
def Forager(
num_actions:int, # Number of actions the agent can take
size_state_space:<built-in function array>, # Size of the state space, given as an array where each entry is the dimension of each environmental feature
gamma_damping:float=0.0, # Gamma damping from PS
eta_glow_damping:float=0.0, # Eta damping from PS
policy_type:str='standard', # Policy type. Can be 'standard' or 'softmax'
beta_softmax:int=3, # Beta parameter for softmax policy
initial_prob_distr, # Initial probability distribution for the H matrix
fixed_policy, # Fixed policy for the agent to follow
max_no_H_update:int=10000, # Max number of steps without updating the H matrix. After this number, the full H matrix is updated
g_update:str='s', # Type of update for the G matrix. Can be 's' (sum) or 'r' (reset)
# Works as follows: s (sum) -> g_mat += 1 or r (reset) -> gmat = 1 when updating gmat
):This class defines a Forager agent, able to perform actions and learn from rewards based on the PS paradigm.
This is an updated version from the one used in the original paper (https://doi.org/10.1088/1367-2630/ad19a8), taking into account the improvements made to the H and G matrices proposed by Michele Caraglio in our paper (https://doi.org/10.1039/D3SM01680C).