put in agent parsing skeleton

This commit is contained in:
Marek Wolan
2023-09-26 12:54:56 +01:00
parent 92e0110e73
commit f1346ae278
11 changed files with 86 additions and 54 deletions

View File

@@ -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): ??

View File

@@ -0,0 +1,5 @@
from primaite.game.agent.interface import AbstractGATEAgent
class GATERLAgent(AbstractGATEAgent):
...

View 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."""
...

View File

@@ -0,0 +1,9 @@
from primaite.game.agent.interface import AbstractScriptedAgent
class GreenWebBrowsingAgent(AbstractScriptedAgent):
...
class RedDatabaseCorruptingAgent(AbstractScriptedAgent):
...