"""Implements an agent that does nothing"""
from typing import List, Optional, Dict, Any
import numpy as np
from negmas import (
Contract,
Breach,
AgentMechanismInterface,
MechanismState,
Issue,
Negotiator,
RandomUtilityFunction,
)
from negmas import AspirationNegotiator
from scml.scml2020.world import SCML2020Agent, Failure
__all__ = ["DoNothingAgent"]
[docs]class DoNothingAgent(SCML2020Agent):
"""An agent that does nothing for the whole length of the simulation"""
[docs] def respond_to_negotiation_request(
self,
initiator: str,
issues: List[Issue],
annotation: Dict[str, Any],
mechanism: AgentMechanismInterface,
) -> Optional[Negotiator]:
return None
[docs] def sign_all_contracts(self, contracts: List[Contract]) -> List[Optional[str]]:
return [self.id] * len(contracts)
[docs] def on_contracts_finalized(
self,
signed: List[Contract],
cancelled: List[Contract],
rejectors: List[List[str]],
) -> None:
pass
[docs] def on_agent_bankrupt(
self,
agent: str,
contracts: List[Contract],
quantities: List[int],
compensation_money: int,
) -> None:
pass
[docs] def on_failures(self, failures: List[Failure]) -> None:
pass
[docs] def on_negotiation_failure(
self,
partners: List[str],
annotation: Dict[str, Any],
mechanism: AgentMechanismInterface,
state: MechanismState,
) -> None:
pass
[docs] def on_negotiation_success(
self, contract: Contract, mechanism: AgentMechanismInterface
) -> None:
pass
[docs] def on_contract_cancelled(self, contract: Contract, rejectors: List[str]) -> None:
pass
[docs] def on_contract_executed(self, contract: Contract) -> None:
pass
[docs] def on_contract_breached(
self, contract: Contract, breaches: List[Breach], resolution: Optional[Contract]
) -> None:
pass