File size: 916 Bytes
ba9863e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from .argument import Argument


class Attacks:
    """
    Represents an attack between two arguments in the argumentation framework.

    Attributes:
        attacker (Argument): The argument that is attacking.
        target (Argument): The argument that is being attacked.
    """

    def __init__(self, attacker: Argument, target: Argument):
        self.attacker = attacker
        self.target = target

    def __eq__(self, other: object) -> bool:
        if not isinstance(other, Attacks):
            return False
        return self.attacker == other.attacker and self.target == other.target

    def __str__(self) -> str:
        return f"[{self.attacker.argument_name}] → [{self.target.argument_name}]"

    def __hash__(self) -> int:
        return hash((self.attacker, self.target))

    def __repr__(self) -> str:
        return f"[{self.attacker.argument_name}] → [{self.target.argument_name}]"