# Agent Integration

The first step in setting up a research project is integrating the desired Agent with the HIPPO Gym framework. Due to requirements of human interaction it is important that the Trial class drives the initial calls to OpenAI gym functions. However, these calls can be intercepted and manipulated as desired for research. There are 5 key functions that must be provided to the Trial class. Examples can be seen in App/agent.py

# start(game:str)

Calls the gym.make() function and requires the environment to be returned.

# step(env, action:int)

Calls the env.step(action) function. The Trial class will pass the human input with this call. This can be intercepted as required for the research.

The return should be whatever needs to be recorded by the framework in dictionary format. The full return from this call will be saved in memory and then written to file either at the end of the episode or the end of the trial depending on the config.yml settings.

# render(env)

Calls the env.render('rgb_array') function. 'rgb_array' must be set in order to pass an image to the browser. This function expects an npArray as a return.

# reset(env)

Calls env.reset() function which resets to a new episode.

# close(env)

Calls env.close() which ends a trial. Once the Trial class has called the close() function, then the websocket will be closed and the participant will be moved on to the next step.