floxs.predator_prey.observations.ObservationFn¶
- class floxs.predator_prey.observations.ObservationFn(num_vision: int, predator_vision_range: float, prey_vision_range: float, predator_view_angle: float, prey_view_angle: float, agent_radius: float, env_size: float)¶
Default predator-prey observation function
Produces an individual local view of other agents in the environment for each agent. Each agents view is a
[2, num_vision]
array, where the values represent the distance along a ray to the nearest agent, with -1 representing the case no agent is in range. The two rows represent the view of different types of agents.- Parameters:
num_vision – Number of cells/values in the segmented view
predator_vision_range – Predator agent vision range
prey_vision_range – Prey vision range
predator_view_angle – Predator view angle, as a fraction of π
prey_view_angle – Prey view angle, as a fraction of π
agent_radius – Agent visual radius
env_size – Environment size