浏览代码

class variable for API verison, fix env tests (#2817)

/develop-gpu-test
GitHub 5 年前
当前提交
9957b699
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 3
      ml-agents-envs/mlagents/envs/environment.py
  2. 6
      ml-agents-envs/mlagents/envs/mock_communicator.py

3
ml-agents-envs/mlagents/envs/environment.py


SCALAR_ACTION_TYPES = (int, np.int32, np.int64, float, np.float32, np.float64)
SINGLE_BRAIN_ACTION_TYPES = SCALAR_ACTION_TYPES + (list, np.ndarray)
SINGLE_BRAIN_TEXT_TYPES = list
API_VERSION = "API-11"
def __init__(
self,

atexit.register(self._close)
self.port = base_port + worker_id
self._buffer_size = 12000
self._version_ = "API-11"
self._version_ = UnityEnvironment.API_VERSION
self._loaded = (
False
) # If true, this means the environment was successfully loaded

6
ml-agents-envs/mlagents/envs/mock_communicator.py


from .communicator import Communicator
from .environment import UnityEnvironment
from mlagents.envs.communicator_objects.unity_rl_output_pb2 import UnityRLOutputProto
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.communicator_objects.unity_rl_initialization_output_pb2 import (

is_training=True,
)
rl_init = UnityRLInitializationOutputProto(
name="RealFakeAcademy", version="API-10", log_path="", brain_parameters=[bp]
name="RealFakeAcademy",
version=UnityEnvironment.API_VERSION,
log_path="",
brain_parameters=[bp],
)
output = UnityRLOutputProto(agentInfos=self._get_agent_infos())
return UnityOutputProto(rl_initialization_output=rl_init, rl_output=output)

正在加载...
取消
保存