Tags: koulanurag/ma-gym
Tags
fix: combat (#41) Fix bugs: 1. in get_agent_obs(), the local variable '_type' was mistakenly written as 'type'. 2. self.agent_prev_pos and self.opp_prev_pos are not updated, but in __update_agent_view() and __update_opp_view(), these previous positions are cleared. Thus the movement records are incorrect. 3. The self._agent_cool and self._opp_cool are not updated (i.e., the agents and opponents could execute 'attack' action at every step if within range). updates: (1) update the is_fireable() function to check if the attack agents have been cooled down. (2) add self._agent_cool_step and self._opp_cool_step to track the cooling down of the agents and opponents. 4. In the opps_action() function, the dead opponent could still call reduce_distance_move() function to sample a 'move' action, which will raise an 'no where to move' exception when the position of the dead opponent is the same with any of the agents. 5. Update the get_agent_obs(): only return the local view of observation when the agent is alive, otherwise return a zero vector. Add 2 new functions to support CTDE 6. Add get_state() to support CTDE (centralized training with decentralized execution). In get_agent_obs(), the x-coordinates and y-coordinates of the entites (whether the entity is 'agent' or 'opponent') within each agent's view range were incorrectly set to the agent's position.
PreviousNext