from typing import Dict, Tuple
from numpy import heaviside
from axelrod.lllIllIlIlIlI import Action
from axelrod.player import Player
IIIIIllIII, lllIlIIIlIIIIIIIll = Action.C, Action.D
class IIlIllIIlI(Player):
    IIIIllIlIlIIII = "strategy"
    IlIllIIII = {
        "memory_depth": float("inf"),  
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IIIllIlIIllI, llllIIlI: Dict[Tuple[Action, Action], float], IIllIIlllI: float = 0.01
    ) -> None:
        super().__init__()
        IIIllIlIIllI.IIllIIlllI = IIllIIlllI
        IIIllIlIIllI.llllIIlI = llllIIlI
        IIIllIlIIllI.IIIIIlIlIllIlI = 0.0
    def IIlIIlllIIIIIlIllllI(IIIllIlIIllI, IIllIlIIIIl: Player) -> Action:
        if IIIllIlIIllI.history:
            lllIlllIlII = (IIIllIlIIllI.history[-1], IIllIlIIIIl.history[-1])
            IIIllIlIIllI.IIIIIlIlIllIlI += IIIllIlIIllI.llllIIlI[lllIlllIlII]
        IlIllIIlllllIIII = IIIllIlIIllI.IIllIIlllI + (1.0 - 2 * IIIllIlIIllI.IIllIIlllI) * (
            heaviside(IIIllIlIIllI.IIIIIlIlIllIlI + 1, 1) - heaviside(IIIllIlIIllI.IIIIIlIlIllIlI - 1, 1)
        )
        lllIllIlIlIlI = IIIllIlIIllI._random.random_choice(IlIllIIlllllIIII)
        return lllIllIlIlIlI
class IlIlllIIIIlllll(IIlIllIIlI):
    IIIIllIlIlIIII = "strategy"
    def __init__(IIIllIlIIllI) -> None:
        llllIIlI = {
            (IIIIIllIII, IIIIIllIII): 0.0,  
            (IIIIIllIII, lllIlIIIlIIIIIIIll): -1.001505,  
            (lllIlIIIlIIIIIIIll, IIIIIllIII): 0.992107,  
            (lllIlIIIlIIIIIIIll, lllIlIIIlIIIIIIIll): -0.638734,  
        }
        super().__init__(llllIIlI=llllIIlI)