浏览代码

Add demo file

/develop/taggedobservations
Ervin Teng 4 年前
当前提交
80522456
共有 1 个文件被更改,包括 18 次插入0 次删除
  1. 18
      send_obs.py

18
send_obs.py


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()
正在加载...
取消
保存