unreal.LearningAgentsCommunicatorLibrary

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

Bases: BlueprintFunctionLibrary

Contains functions for starting external trainers and communicating with them.

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgentsTraining

  • File: LearningAgentsCommunicator.h

classmethod make_shared_memory_communicator(trainer_process, shared_memory_settings=[]) LearningAgentsCommunicator

Create a communicator which can be used to interact with a previously started shared memory trainer process.

Parameters:
Return type:

LearningAgentsCommunicator

classmethod make_socket_communicator(trainer_process, socket_settings=[]) LearningAgentsCommunicator

Create a communicator which can be used to interact with a previously started socket trainer process.

Parameters:
Return type:

LearningAgentsCommunicator

classmethod spawn_shared_memory_training_process(trainer_process_settings=[], shared_memory_settings=[]) LearningAgentsTrainerProcess

Start a local python training sub-process which will communicate via shared memory. Shared memory has the least communication overhead so prefer this for local development.

This must be called on game thread!

Parameters:
Return type:

LearningAgentsTrainerProcess

classmethod spawn_socket_training_process(trainer_process_settings=[], socket_settings=[]) LearningAgentsTrainerProcess

Start a local python training sub-process which will communicate via sockets. Sockets have some overhead compared to shared memory but can work over networked connects. This provides no encryption so do not use on public internet if privacy is a concern.

This must be called on game thread!

Parameters:
Return type:

LearningAgentsTrainerProcess