|
|
|
|
|
|
from typing import List, NamedTuple |
|
|
|
import itertools |
|
|
|
import attr |
|
|
|
import numpy as np |
|
|
|
|
|
|
|
from mlagents.trainers.buffer import AgentBuffer |
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True) |
|
|
|
class GroupmateStatus: |
|
|
|
class GroupmateStatus(NamedTuple): |
|
|
|
""" |
|
|
|
Stores data related to an agent's teammate. |
|
|
|
""" |
|
|
|
|
|
|
done: bool |
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True) |
|
|
|
class AgentExperience: |
|
|
|
class AgentExperience(NamedTuple): |
|
|
|
group_status: List[GroupmateStatus] |
|
|
|
reward: float |
|
|
|
done: bool |
|
|
|
action: ActionTuple |
|
|
|
|
|
|
interrupted: bool |
|
|
|
memory: np.ndarray |
|
|
|
group_status: List[GroupmateStatus] |
|
|
|
group_reward: float |
|
|
|
|
|
|
|
|
|
|
|
class ObsUtil: |
|
|
|