您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
18 行
599 B
18 行
599 B
from mlagents_envs.environment import UnityEnvironment
|
|
from mlagents_envs.side_channel.agent_parameters_channel import AgentParametersChannel
|
|
|
|
|
|
# Getting observation types
|
|
agent_params = AgentParametersChannel()
|
|
env = UnityEnvironment(side_channels=[agent_params])
|
|
env.reset()
|
|
bspec = list(env.behavior_specs.values())[0]
|
|
print(bspec.sensor_types)
|
|
dsteps, tsteps = env.get_steps(list(env.behavior_specs.keys())[0])
|
|
print(dsteps.obs)
|
|
|
|
# Sending agent parameterizations
|
|
for i, _id in enumerate(dsteps.agent_id):
|
|
agent_params.set_float_parameter(_id, "test_param", i * 1000)
|
|
env.reset()
|
|
env.step()
|