-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35d7459
commit cb539ff
Showing
6 changed files
with
123 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Implementations of the decision makers.""" | ||
|
||
import fight_decision_maker | ||
|
||
__all__ = ["fight_decision_maker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"""An implementation of the DecisionMaker class for making decisions during a fight.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import TypedDict | ||
|
||
import numpy as np | ||
|
||
from src.decision_maker import Decision, DecisionInput, DecisionMaker | ||
|
||
FightDecisionInputValue = np.ndarray | ||
|
||
name = "Fight Decision" | ||
|
||
|
||
class FightDecisionValue(TypedDict): | ||
"""Represents the value of a fight decision.""" | ||
|
||
cardIndex: int | None | ||
location: tuple[int, int] | None | ||
|
||
|
||
class FightDecisionInput(DecisionInput[FightDecisionInputValue]): | ||
"""Represents an input to a fight decision-making process.""" | ||
|
||
def __init__(self, value: FightDecisionInputValue) -> None: | ||
"""Initialize a FightDecisionInput instance. | ||
Args: | ||
---- | ||
value (FightDecisionInputValue): The value of the fight decision input. | ||
""" | ||
super().__init__(name, value) | ||
|
||
|
||
class FightDecision(Decision[FightDecisionValue]): | ||
"""Represents a decision made during a fight.""" | ||
|
||
def __init__(self, value: FightDecisionValue) -> None: | ||
"""Initialize a FightDecision instance. | ||
Args: | ||
---- | ||
value (FightDecisionValue): The value of the fight decision. | ||
""" | ||
super().__init__(name, value) | ||
|
||
|
||
class FightDecisionMaker(DecisionMaker[FightDecisionInputValue, FightDecisionValue]): | ||
"""An implementation of the DecisionMaker class for making decisions during a fight.""" | ||
|
||
def __init__(self) -> None: | ||
"""Initialize a FightDecisionMaker instance.""" | ||
super().__init__() |