Create Agents with Rewards Using Python
Create a New Agent
The Python Teacher Class
Functions for Training
Train with Rewards: the compute_reward Function
python
def compute_reward(self, transformed_sensors, action, sim_reward):
self.counter += 1
if self.past_ sensors is None:
self.past_ sensors = transformed_ sensors
return 0
else:
if self.past_ sensors ["state1"] < transformed_ sensors ["state1"]:
return 1
else:
return -1End Training: the compute_termination Function
Define Success: the compute_success_criteria Function
Train with Goals


Functions to Guide Agent System Behavior with Rules
Add Rules: the compute_action_mask Function
Functions to Manage Information Inside Agent Systems
Transform Sensor Variables: the transform_sensors function
Transform Decisions within the Agent System: the transform_action function
Filter the Sensor List: the filtered_sensor_space function
Last updated