def pheromone_bias(world: World, position: Position, direction: Direction,
                    weight: float) -> float:
     try:
         loc: Location = world.get_location(position.x + direction.get()[0],
                                            position.y + direction.get()[1])
         return weight + (bias * loc.get_pheromone_count()
                          if loc.is_free() and weight != 0 else 0)
     except IndexError:
         return 0
 def exploration_bias(world: World, position: Position,
                      direction: Direction, weight: float) -> float:
     try:
         loc: Location = world.get_location(position.x + direction.get()[0],
                                            position.y + direction.get()[1])
         return weight * (tanh((age - 130) / 10) + 2 # weight * 5 * (tanh((age - 130)/(10)) + 1.2 #
                                     ) if (loc.get_pheromone_count() <= FORAGING_PHEROMONE_THRESHOLD and
                                     loc.get_brood_pheromone_count() <= FORAGING_PHEROMONE_THRESHOLD) or \
                                     loc.get_foraging_pheromone_count() > FORAGING_PHEROMONE_THRESHOLD else weight
     except IndexError:
         return 0