浏览代码

fix sample code for custom SideChannel (#4466)

* fix sample code for custom SideChannel

* update python code too

* changelog
/MLA-1734-demo-provider
GitHub 4 年前
当前提交
37d730bf
共有 2 个文件被更改,包括 7 次插入5 次删除
  1. 1
      com.unity.ml-agents/CHANGELOG.md
  2. 11
      docs/Custom-SideChannels.md

1
com.unity.ml-agents/CHANGELOG.md


#### com.unity.ml-agents (C#)
- The package dependencies were updated to include the built-in packages that are used also. (#4384)
#### ml-agents / ml-agents-envs / gym-unity (Python)
- Fixed the sample code in the custom SideChannel example. (#4466)
## [1.3.0-preview] - 2020-08-12

11
docs/Custom-SideChannels.md


ChannelId = new Guid("621f0a70-4f87-11ea-a6bf-784f4387d1f7");
}
public override void OnMessageReceived(IncomingMessage msg)
protected override void OnMessageReceived(IncomingMessage msg)
{
var receivedString = msg.ReadString();
Debug.Log("From Python : " + receivedString);

env.reset()
string_log.send_string("The environment was reset")
group_name = env.get_agent_groups()[0] # Get the first group_name
group_name = list(env.behavior_specs.keys())[0] # Get the first group_name
group_spec = env.behavior_specs[group_name]
step_data = env.get_step_result(group_name)
n_agents = step_data.n_agents() # Get the number of agents
decision_steps, terminal_steps = env.get_steps(group_name)
"Step " + str(i) + " occurred with " + str(n_agents) + " agents."
f"Step {i} occurred with {len(decision_steps)} deciding agents and "
f"{len(terminal_steps)} terminal agents"
)
env.step() # Move the simulation forward

正在加载...
取消
保存