unreal.LearningAgentsCompletions

class unreal.LearningAgentsCompletions(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Learning Agents Completions

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgentsTraining

  • File: LearningAgentsCompletions.h

classmethod completion_and(a, b) LearningAgentsCompletionEnum

Returns a termination if both inputs are a termination, otherwise a truncation if both inputs are either a truncation or termination, otherwise returns running.

Parameters:
Return type:

LearningAgentsCompletionEnum

classmethod completion_not(a, not_running_type=LearningAgentsCompletionEnum.TERMINATION) LearningAgentsCompletionEnum

Returns running if the input A is either a termination or truncation, otherwise returns the completion specified by NotRunningType

Parameters:
Return type:

LearningAgentsCompletionEnum

classmethod completion_or(a, b) LearningAgentsCompletionEnum

Returns a termination if either input is a termination, otherwise a truncation if either input is a truncation, otherwise returns running.

Parameters:
Return type:

LearningAgentsCompletionEnum

classmethod is_completion_completed(completion) bool

Returns true if a completion is either truncated or terminated, otherwise false.

Parameters:

completion (LearningAgentsCompletionEnum) –

Return type:

bool

classmethod is_completion_running(completion) bool

Returns true if a completion is running, otherwise false.

Parameters:

completion (LearningAgentsCompletionEnum) –

Return type:

bool

classmethod is_completion_termination(completion) bool

Returns true if a completion is terminated, otherwise false.

Parameters:

completion (LearningAgentsCompletionEnum) –

Return type:

bool

classmethod is_completion_truncation(completion) bool

Returns true if a completion is truncated, otherwise false.

Parameters:

completion (LearningAgentsCompletionEnum) –

Return type:

bool

classmethod make_completion(completion_type=LearningAgentsCompletionEnum.TERMINATION, tag='Completion', visual_logger_enabled=False, visual_logger_listener=None, visual_logger_agent_id=-1, visual_logger_location=[0.000000, 0.000000, 0.000000], visual_logger_color=[1.000000, 1.000000, 0.000000, 1.000000]) LearningAgentsCompletionEnum

Make a completion.

Parameters:
  • completion_type (LearningAgentsCompletionEnum) – The type of completion to make.

  • tag (Name) – The tag for the completion. Used for debugging.

  • visual_logger_enabled (bool) – When true, debug data will be sent to the visual logger.

  • visual_logger_listener (LearningAgentsManagerListener) – The listener object which is making this completion. This must be set to use logging.

  • visual_logger_agent_id (int32) – The agent id associated with this completion.

  • visual_logger_location (Vector) – A location for the visual logger information in the world.

  • visual_logger_color (LinearColor) – The color for the visual logger display.

Returns:

The resulting completion.

Return type:

LearningAgentsCompletionEnum

classmethod make_completion_on_condition(condition, completion_type=LearningAgentsCompletionEnum.TERMINATION, tag='ConditionCompletion', visual_logger_enabled=False, visual_logger_listener=None, visual_logger_agent_id=-1, visual_logger_location=[0.000000, 0.000000, 0.000000], visual_logger_color=[1.000000, 1.000000, 0.000000, 1.000000]) LearningAgentsCompletionEnum

Make a completion based on some condition.

Parameters:
  • condition (bool) – When true, returns the given CompletionType, otherwise returns Running.

  • completion_type (LearningAgentsCompletionEnum) – The type of completion to make.

  • tag (Name) – The tag for the completion. Used for debugging.

  • visual_logger_enabled (bool) – When true, debug data will be sent to the visual logger.

  • visual_logger_listener (LearningAgentsManagerListener) – The listener object which is making this completion. This must be set to use logging.

  • visual_logger_agent_id (int32) – The agent id associated with this completion.

  • visual_logger_location (Vector) – A location for the visual logger information in the world.

  • visual_logger_color (LinearColor) – The color for the visual logger display.

Returns:

The resulting completion.

Return type:

LearningAgentsCompletionEnum

classmethod make_completion_on_episode_steps_recorded(episode_steps, max_episode_steps=64, completion_type=LearningAgentsCompletionEnum.TRUNCATION, tag='EpisodeStepsRecordedCompletion', visual_logger_enabled=False, visual_logger_listener=None, visual_logger_agent_id=-1, visual_logger_location=[0.000000, 0.000000, 0.000000], visual_logger_color=[1.000000, 1.000000, 0.000000, 1.000000]) LearningAgentsCompletionEnum

Make a completion when the number of episode steps recorded exceeds some threshold.

Parameters:
  • episode_steps (int32) – The number of steps recorded.

  • max_episode_steps (int32) – The step threshold above which to complete with the given CompletionType.

  • completion_type (LearningAgentsCompletionEnum) – The type of completion to make

  • tag (Name) – The tag for the completion. Used for debugging.

  • visual_logger_enabled (bool) – When true, debug data will be sent to the visual logger.

  • visual_logger_listener (LearningAgentsManagerListener) – The listener object which is making this completion. This must be set to use logging.

  • visual_logger_agent_id (int32) – The agent id associated with this completion.

  • visual_logger_location (Vector) – A location for the visual logger information in the world.

  • visual_logger_color (LinearColor) – The color for the visual logger display.

Returns:

The resulting completion.

Return type:

LearningAgentsCompletionEnum

classmethod make_completion_on_location_difference_above_threshold(location_a, location_b, distance_threshold=100.000000, completion_type=LearningAgentsCompletionEnum.TERMINATION, tag='LocationDifferenceAboveThresholdCompletion', visual_logger_enabled=False, visual_logger_listener=None, visual_logger_agent_id=-1, visual_logger_location=[0.000000, 0.000000, 0.000000], visual_logger_color=[1.000000, 1.000000, 0.000000, 1.000000]) LearningAgentsCompletionEnum

Make a completion when the distance between two locations is above some threshold.

Parameters:
  • location_a (Vector) – The first location.

  • location_b (Vector) – The second location.

  • distance_threshold (float) – The distance threshold.

  • completion_type (LearningAgentsCompletionEnum) – The type of completion to make

  • tag (Name) – The tag for the completion. Used for debugging.

  • visual_logger_enabled (bool) – When true, debug data will be sent to the visual logger.

  • visual_logger_listener (LearningAgentsManagerListener) – The listener object which is making this completion. This must be set to use logging.

  • visual_logger_agent_id (int32) – The agent id associated with this completion.

  • visual_logger_location (Vector) – A location for the visual logger information in the world.

  • visual_logger_color (LinearColor) – The color for the visual logger display.

Returns:

The resulting completion.

Return type:

LearningAgentsCompletionEnum

classmethod make_completion_on_location_difference_below_threshold(location_a, location_b, distance_threshold=100.000000, completion_type=LearningAgentsCompletionEnum.TERMINATION, tag='LocationDifferenceBelowThresholdCompletion', visual_logger_enabled=False, visual_logger_listener=None, visual_logger_agent_id=-1, visual_logger_location=[0.000000, 0.000000, 0.000000], visual_logger_color=[1.000000, 1.000000, 0.000000, 1.000000]) LearningAgentsCompletionEnum

Make a completion when the distance between two locations is below some threshold.

Parameters:
  • location_a (Vector) – The first location.

  • location_b (Vector) – The second location.

  • distance_threshold (float) – The distance threshold.

  • completion_type (LearningAgentsCompletionEnum) – The type of completion to make

  • tag (Name) – The tag for the completion. Used for debugging.

  • visual_logger_enabled (bool) – When true, debug data will be sent to the visual logger.

  • visual_logger_listener (LearningAgentsManagerListener) – The listener object which is making this completion. This must be set to use logging.

  • visual_logger_agent_id (int32) – The agent id associated with this completion.

  • visual_logger_location (Vector) – A location for the visual logger information in the world.

  • visual_logger_color (LinearColor) – The color for the visual logger display.

Returns:

The resulting completion.

Return type:

LearningAgentsCompletionEnum

classmethod make_completion_on_location_outside_bounds(location, bounds_transform=[[0.000000, 0.000000, 0.000000], [-0.000000, 0.000000, 0.000000], [1.000000, 1.000000, 1.000000]], bounds_mins=[-100.000000, -100.000000, -100.000000], bounds_maxs=[100.000000, 100.000000, 100.000000], completion_type=LearningAgentsCompletionEnum.TERMINATION, tag='LocationOutsideBoundsCompletion', visual_logger_enabled=False, visual_logger_listener=None, visual_logger_agent_id=-1, visual_logger_location=[0.000000, 0.000000, 0.000000], visual_logger_color=[1.000000, 1.000000, 0.000000, 1.000000]) LearningAgentsCompletionEnum

Make a completion when a location moves outside of sound bounds.

Parameters:
  • location (Vector) – The location.

  • bounds_transform (Transform) – The transform of the bounds object.

  • bounds_mins (Vector) – The minimums of the bounds object.

  • bounds_maxs (Vector) – The maximums of the bounds object.

  • completion_type (LearningAgentsCompletionEnum) – The type of completion to make

  • tag (Name) – The tag for the completion. Used for debugging.

  • visual_logger_enabled (bool) – When true, debug data will be sent to the visual logger.

  • visual_logger_listener (LearningAgentsManagerListener) – The listener object which is making this completion. This must be set to use logging.

  • visual_logger_agent_id (int32) – The agent id associated with this completion.

  • visual_logger_location (Vector) – A location for the visual logger information in the world.

  • visual_logger_color (LinearColor) – The color for the visual logger display.

Returns:

The resulting completion.

Return type:

LearningAgentsCompletionEnum

classmethod make_completion_on_time_elapsed(time, time_threshold=10.000000, completion_type=LearningAgentsCompletionEnum.TRUNCATION, tag='TimeElapsedCompletion', visual_logger_enabled=False, visual_logger_listener=None, visual_logger_agent_id=-1, visual_logger_location=[0.000000, 0.000000, 0.000000], visual_logger_color=[1.000000, 1.000000, 0.000000, 1.000000]) LearningAgentsCompletionEnum

Make a completion when a time goes above a threshold.

Parameters:
  • time (float) – The current time.

  • time_threshold (float) – The time threshold above which to complete with the given CompletionType.

  • completion_type (LearningAgentsCompletionEnum) – The type of completion to make

  • tag (Name) – The tag for the completion. Used for debugging.

  • visual_logger_enabled (bool) – When true, debug data will be sent to the visual logger.

  • visual_logger_listener (LearningAgentsManagerListener) – The listener object which is making this completion. This must be set to use logging.

  • visual_logger_agent_id (int32) – The agent id associated with this completion.

  • visual_logger_location (Vector) – A location for the visual logger information in the world.

  • visual_logger_color (LinearColor) – The color for the visual logger display.

Returns:

The resulting completion.

Return type:

LearningAgentsCompletionEnum