Class DirectGameProtocol

All Implemented Interfaces:
Protocol, GameProtocol

public class DirectGameProtocol extends SynchronousProtocol implements GameProtocol
This class implements a direct protocol for argumentation games.
Author:
Matthias Thimm
  • Constructor Details

    • DirectGameProtocol

      public DirectGameProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
      Constructs a new DirectGameProtocol with the given multi-agent system.
      Parameters:
      multiAgentSystem - The multi-agent system involved in the game.
  • Method Details

    • hasWinner

      public boolean hasWinner()
      Determines if the game has a winner. The game is considered to have a winner when it has terminated.
      Specified by:
      hasWinner in interface GameProtocol
      Returns:
      true if the game has a winner, false otherwise.
    • getWinner

      public Agent getWinner()
      Retrieves the winner of the game. The winner is typically the pro agent (non-DummyLotteryAgent).
      Specified by:
      getWinner in interface GameProtocol
      Returns:
      The agent who won the game, or null if no winner is found.
    • getUtility

      public Double getUtility(Agent agent)
      Calculates the utility of the given agent based on the disclosed arguments and attacks in the game. The utility is determined from the perspective of the agent's preferences and the current state of the argumentation.
      Specified by:
      getUtility in interface GameProtocol
      Parameters:
      agent - The agent for whom the utility is being calculated.
      Returns:
      The utility value for the given agent, or null if no utility can be calculated.
    • toString

      public String toString()
      Provides a string representation of the protocol.
      Overrides:
      toString in class Object
      Returns:
      The string "DirectGameProtocol".