unreal.LearningAgentsRecorder

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

Bases: LearningAgentsManagerComponent

A component that can be used to create recordings of training data for imitation learning.

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgentsTraining

  • File: LearningAgentsRecorder.h

Editor Properties: (see get_editor_property/set_editor_property)

  • asset_user_data (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.

  • can_ever_affect_navigation (bool): [Read-Write] Whether this component can potentially influence navigation

  • component_tags (Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • editable_when_inherited (bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor class

  • helper_objects (Array[LearningAgentsHelper]): [Read-Only] The list of current helper objects.

  • interactor (LearningAgentsInteractor): [Read-Only] The agent interactor this recorder is associated with.

  • is_editor_only (bool): [Read-Write] If true, the component will be excluded from non-editor builds

  • is_recording (bool): [Read-Only] True if recording is currently in-progress. Otherwise, false.

  • is_setup (bool): [Read-Only] True if this component has been setup. Otherwise, false.

  • manager (LearningAgentsManager): [Read-Only] The associated manager this component is attached to.

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivated

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Main tick function for the Component

  • recording (LearningAgentsRecording): [Read-Only] The current recording object.

  • replicate_using_registered_sub_object_list (bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.

  • replicates (bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

add_experience() None

While recording, adds the current observations and actions of the added agents to the internal buffer. Call this after ULearningAgentsInteractor::EncodeObservations and either ULearningAgentsController::EncodeActions (if recording a human/AI demonstration) or ULearningAgentsInteractor::DecodeActions (if recording another policy).

append_recording_from_file(file) None

Append to the current recording object from a file.

Parameters:

file (FilePath) –

append_recording_to_asset(recording_asset) None

Appends the current recording object to the given recording asset

Parameters:

recording_asset (LearningAgentsRecording) –

begin_recording(reinitialize_recording=True) None

Begins the recording of the observations and actions of each added agent.

Parameters:

reinitialize_recording (bool) – If to clear all records from the recording object in use at the start of recording.

end_recording() None

Ends the recording of the observations and actions of each agent and stores them in the current recording object.

get_current_recording() LearningAgentsRecording

Gets the current recording object. Note: this may be empty until EndRecording has been called.

Return type:

LearningAgentsRecording

is_recording() bool

Returns true if recording is active; Otherwise, false.

Return type:

bool

load_recording_from_asset(recording_asset) None

Loads the current recording object from the given recording asset

Parameters:

recording_asset (LearningAgentsRecording) –

load_recording_from_file(file) None

Loads the current recording object from a file

Parameters:

file (FilePath) –

save_recording_to_asset(recording_asset) None

Saves the current recording object to the given recording asset

Parameters:

recording_asset (LearningAgentsRecording) –

save_recording_to_file(file) None

Saves the current recording object to a file

Parameters:

file (FilePath) –

setup_recorder(interactor, recorder_path_settings=[['../../../../Users/LiamHewitt/Documents/Unreal Projects/UE53Blank/Intermediate/'], 'Recordings'], recording_asset=None) None

Initializes this object and runs the setup functions for the underlying data storage.

Parameters:
use_recording_asset(recording_asset) None

Uses the given recording asset. New recordings will be appended to this.

Parameters:

recording_asset (LearningAgentsRecording) –