gRPCImitationProtocol
Full path:
schola.core.protocols.protobuf.offlinegRPC.gRPCImitationProtocol
schola.core.protocols.protobuf.offlinegRPC.gRPCImitationProtocol
gRPCImitationProtocol
gRPCImitationProtocol(url, port=None, protocol_start_timeout=45)Bases: BaseImitationProtocol, SocketProtocolMixin
Methods
| Item | Description |
|---|---|
| init | — |
| close | Close the Unreal Connection. |
| get_data | Get demonstration data from the environment. |
| get_definition | Get the environment definition for imitation learning. |
on_close() | Close the Unreal Connection. |
on_start() | Bind the tcp_socket |
| send_startup_msg | Send the startup message for imitation learning data collection. |
| start | Open the Connection to Unreal Engine. |
Attributes
| Item | Description |
|---|---|
address | Returns the address of the connection |
| channel_connected | Returns whether the connection is active or not |
has_socket | Returns whether the connection is active or not |
mixin_properties | Get mixin-specific properties. |
| properties | Get protocol-specific properties. |
Parameters
url (str)
port (int)
protocol_start_timeout (int)
init
__init__(url, port=None, protocol_start_timeout=45)Parameters
url (str)
port (int)
protocol_start_timeout (int)
channel_connected
channel_connected: boolReturns whether the connection is active or not
close
close()Close the Unreal Connection. Method must be safe to call multiple times.
Returns
None
get_data
get_data()Get demonstration data from the environment.
Returns
A tuple containing:
- Observations for each timestep
- Rewards for each timestep
- Termination flags
- Truncation flags
- Info dicts
- Initial agent observations
- Initial agent info dicts
- Demonstration actions
Return type: Tuple[List[Dict[str,Any]], List[float], List[Dict[str,bool]], List[Dict[str,bool]], List[Dict[str,str]], Dict[int,Dict[str, Any]], Dict[int,Dict[str, str]], Dict[int, Dict[str,Any]]]
get_definition
get_definition()Get the environment definition for imitation learning.
Returns
A tuple containing:
- List of agent IDs per environment
- Agent types indexed by environment and agent
- Observation spaces indexed by environment and agent
- Action spaces indexed by environment and agent
Return type: Tuple[List[List[str]], Dict[int, Dict[str, str]], Dict[int,Dict[str,gym.Space]], Dict[int,Dict[str,gym.Space]]]
properties
properties: Dict[str, Any]Get protocol-specific properties.
send_startup_msg
send_startup_msg(seeds=None, options=None)Send the startup message for imitation learning data collection.
Parameters
seeds (List, optional)
: List of random seeds for each environment.
options (List, optional)
: List of startup options for each environment.
start
start()Open the Connection to Unreal Engine.
Returns
None