put in agent parsing skeleton
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
# TODO: remove this comment... This is just here to point out that I've named this 'actor' rather than 'agent'
|
||||
# That's because I want to point out that this is disctinct from 'agent' in the reinforcement learning sense of the word
|
||||
# If you disagree, make a comment in the PR review and we can discuss
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from primaite.game.actor.actions import ActionSpace
|
||||
from primaite.game.actor.observations import ObservationSpace
|
||||
from primaite.game.actor.rewards import RewardFunction
|
||||
|
||||
|
||||
class AbstractActor(ABC):
|
||||
"""Base class for scripted and RL agents."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.action_space = ActionSpace
|
||||
self.observation_space = ObservationSpace
|
||||
self.reward_function = RewardFunction
|
||||
|
||||
|
||||
class AbstractScriptedActor(AbstractActor):
|
||||
"""Base class for actors which generate their own behaviour."""
|
||||
|
||||
...
|
||||
|
||||
|
||||
class AbstractPuppetActor(AbstractActor):
|
||||
"""Base class for actors controlled via external messages, such as RL policies."""
|
||||
|
||||
...
|
||||
|
||||
|
||||
# class AbstractRLActor(AbstractPuppetActor): ??
|
||||
5
src/primaite/game/agent/GATE_agents.py
Normal file
5
src/primaite/game/agent/GATE_agents.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from primaite.game.agent.interface import AbstractGATEAgent
|
||||
|
||||
|
||||
class GATERLAgent(AbstractGATEAgent):
|
||||
...
|
||||
35
src/primaite/game/agent/interface.py
Normal file
35
src/primaite/game/agent/interface.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# TODO: remove this comment... This is just here to point out that I've named this 'actor' rather than 'agent'
|
||||
# That's because I want to point out that this is disctinct from 'agent' in the reinforcement learning sense of the word
|
||||
# If you disagree, make a comment in the PR review and we can discuss
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from primaite.game.agent.actions import ActionSpace
|
||||
from primaite.game.agent.observations import ObservationSpace
|
||||
from primaite.game.agent.rewards import RewardFunction
|
||||
|
||||
|
||||
class AbstractAgent(ABC):
|
||||
"""Base class for scripted and RL agents."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
action_space: Optional[ActionSpace],
|
||||
observation_space: Optional[ObservationSpace],
|
||||
reward_function: Optional[RewardFunction],
|
||||
) -> None:
|
||||
self.action_space: Optional[ActionSpace] = action_space
|
||||
self.observation_space: Optional[ObservationSpace] = observation_space
|
||||
self.reward_function: Optional[RewardFunction] = reward_function
|
||||
|
||||
|
||||
class AbstractScriptedAgent(AbstractAgent):
|
||||
"""Base class for actors which generate their own behaviour."""
|
||||
|
||||
...
|
||||
|
||||
|
||||
class AbstractGATEAgent(AbstractAgent):
|
||||
"""Base class for actors controlled via external messages, such as RL policies."""
|
||||
|
||||
...
|
||||
9
src/primaite/game/agent/scripted_agents.py
Normal file
9
src/primaite/game/agent/scripted_agents.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from primaite.game.agent.interface import AbstractScriptedAgent
|
||||
|
||||
|
||||
class GreenWebBrowsingAgent(AbstractScriptedAgent):
|
||||
...
|
||||
|
||||
|
||||
class RedDatabaseCorruptingAgent(AbstractScriptedAgent):
|
||||
...
|
||||
Reference in New Issue
Block a user