@@ -376,62 +376,6 @@ def fill_eval_dict(self, feed_dict, batched_step_result):
376
376
feed_dict [self .action_masks ] = mask
377
377
return feed_dict
378
378
379
- def make_empty_memory (self , num_agents ):
380
- """
381
- Creates empty memory for use with RNNs
382
- :param num_agents: Number of agents.
383
- :return: Numpy array of zeros.
384
- """
385
- return np .zeros ((num_agents , self .m_size ), dtype = np .float32 )
386
-
387
- def save_memories (
388
- self , agent_ids : List [str ], memory_matrix : Optional [np .ndarray ]
389
- ) -> None :
390
- if memory_matrix is None :
391
- return
392
- for index , agent_id in enumerate (agent_ids ):
393
- self .memory_dict [agent_id ] = memory_matrix [index , :]
394
-
395
- def retrieve_memories (self , agent_ids : List [str ]) -> np .ndarray :
396
- memory_matrix = np .zeros ((len (agent_ids ), self .m_size ), dtype = np .float32 )
397
- for index , agent_id in enumerate (agent_ids ):
398
- if agent_id in self .memory_dict :
399
- memory_matrix [index , :] = self .memory_dict [agent_id ]
400
- return memory_matrix
401
-
402
- def remove_memories (self , agent_ids ):
403
- for agent_id in agent_ids :
404
- if agent_id in self .memory_dict :
405
- self .memory_dict .pop (agent_id )
406
-
407
- def make_empty_previous_action (self , num_agents ):
408
- """
409
- Creates empty previous action for use with RNNs and discrete control
410
- :param num_agents: Number of agents.
411
- :return: Numpy array of zeros.
412
- """
413
- return np .zeros ((num_agents , self .num_branches ), dtype = np .int )
414
-
415
- def save_previous_action (
416
- self , agent_ids : List [str ], action_matrix : Optional [np .ndarray ]
417
- ) -> None :
418
- if action_matrix is None :
419
- return
420
- for index , agent_id in enumerate (agent_ids ):
421
- self .previous_action_dict [agent_id ] = action_matrix [index , :]
422
-
423
- def retrieve_previous_action (self , agent_ids : List [str ]) -> np .ndarray :
424
- action_matrix = np .zeros ((len (agent_ids ), self .num_branches ), dtype = np .int )
425
- for index , agent_id in enumerate (agent_ids ):
426
- if agent_id in self .previous_action_dict :
427
- action_matrix [index , :] = self .previous_action_dict [agent_id ]
428
- return action_matrix
429
-
430
- def remove_previous_action (self , agent_ids ):
431
- for agent_id in agent_ids :
432
- if agent_id in self .previous_action_dict :
433
- self .previous_action_dict .pop (agent_id )
434
-
435
379
def get_current_step (self ):
436
380
"""
437
381
Gets current model step.
0 commit comments