File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 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)
4040#### com.unity.ml-agents (C#)  
4141-  The package dependencies were updated to include the built-in packages that are used also. (#4384  )
4242#### ml-agents / ml-agents-envs / gym-unity (Python)  
43+ -  Fixed the sample code in the custom SideChannel example. (#4466  )
4344
4445## [ 1.3.0-preview]  - 2020-08-12 
4546
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public class StringLogSideChannel : SideChannel
8787        ChannelId  =  new  Guid (" 621f0a70-4f87-11ea-a6bf-784f4387d1f7" 
8888    }
8989
90-     public  override  void  OnMessageReceived (IncomingMessage  msg )
90+     protected  override  void  OnMessageReceived (IncomingMessage  msg )
9191    {
9292        var  receivedString  =  msg .ReadString ();
9393        Debug .Log (" From Python : " +  receivedString );
@@ -209,13 +209,14 @@ env = UnityEnvironment(side_channels=[string_log])
209209env.reset()
210210string_log.send_string(" The environment was reset" 
211211
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]
213214for  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)
216216    #  We send data to Unity : A string with the number of Agent at each
217217    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 " 
219220    )
220221    env.step()  #  Move the simulation forward
221222
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments