File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ your trainer configuration to do so. (#4448)
40
40
#### com.unity.ml-agents (C#)
41
41
- The package dependencies were updated to include the built-in packages that are used also. (#4384 )
42
42
#### ml-agents / ml-agents-envs / gym-unity (Python)
43
+ - Fixed the sample code in the custom SideChannel example. (#4466 )
43
44
44
45
## [ 1.3.0-preview] - 2020-08-12
45
46
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public class StringLogSideChannel : SideChannel
87
87
ChannelId = new Guid (" 621f0a70-4f87-11ea-a6bf-784f4387d1f7" );
88
88
}
89
89
90
- public override void OnMessageReceived (IncomingMessage msg )
90
+ protected override void OnMessageReceived (IncomingMessage msg )
91
91
{
92
92
var receivedString = msg .ReadString ();
93
93
Debug .Log (" From Python : " + receivedString );
@@ -209,13 +209,14 @@ env = UnityEnvironment(side_channels=[string_log])
209
209
env.reset()
210
210
string_log.send_string(" The environment was reset" )
211
211
212
- group_name = env.get_agent_groups()[0 ] # Get the first group_name
212
+ group_name = list (env.behavior_specs.keys())[0 ] # Get the first group_name
213
+ group_spec = env.behavior_specs[group_name]
213
214
for i in range (1000 ):
214
- step_data = env.get_step_result(group_name)
215
- n_agents = step_data.n_agents() # Get the number of agents
215
+ decision_steps, terminal_steps = env.get_steps(group_name)
216
216
# We send data to Unity : A string with the number of Agent at each
217
217
string_log.send_string(
218
- " Step " + str (i) + " occurred with " + str (n_agents) + " agents."
218
+ f " Step { i} occurred with { len (decision_steps)} deciding agents and "
219
+ f " { len (terminal_steps)} terminal agents "
219
220
)
220
221
env.step() # Move the simulation forward
221
222
You can’t perform that action at this time.
0 commit comments