Skip to content

Terminations

Check if the episode is truncated or terminated, and returns a value that conforms to the StepType enum.

Parameters:

Name Type Description Default
terminated Array

A boolean array indicating whether the episode is terminated.

required
truncated Array

A boolean array indicating whether the episode is truncated.

required

Returns:

Name Type Description
Array Array

An integer array that represents the step type.

Compose termination functions into a single termination function.

Parameters:

Name Type Description Default
*term_functions Callable

List of termination functions.

()
operator Callable

Operator to combine the termination functions.

any

Returns:

Name Type Description
Callable Callable

A single termination function.

Check if the ball has hit something using the ball_hit event.

Parameters:

Name Type Description Default
prev_state State

The previous state of the game.

required
action Array

The action taken by the player.

required
state State

The current state of the game.

required

Returns:

Name Type Description
Array Array

A boolean array indicating whether the ball has hit something.

Check if the action done has been called in front of a Door object with the correct colour.

Parameters:

Name Type Description Default
prev_state State

The previous state of the game.

required
action Array

The action taken by the player.

required
state State

The current state of the game.

required

Returns:

Name Type Description
Array Array

A boolean array indicating whether the action done has been called in front of a Door object with the correct colour.

Check if the goal has been reached using the goal_reached event.

Parameters:

Name Type Description Default
prev_state State

The previous state of the game.

required
action Array

The action taken by the player.

required
state State

The current state of the game.

required

Returns:

Name Type Description
Array Array

A boolean array indicating whether the goal has been reached.

Check if the lava has fallen using the lava_fall event.

Parameters:

Name Type Description Default
prev_state State

The previous state of the game.

required
action Array

The action taken by the player.

required
state State

The current state of the game.

required

Returns:

Name Type Description
Array Array

A boolean array indicating whether the lava has fallen.