Class GroundedGameProtocol

All Implemented Interfaces:
Protocol, GameProtocol

public class GroundedGameProtocol extends RoundRobinProtocol implements GameProtocol
This class implements a round robin protocol for the grounded game.
Author:
Matthias Thimm
  • Constructor Details

    • GroundedGameProtocol

      public GroundedGameProtocol(GroundedGameSystem system)
      Creates a new grounded game protocol for the given grounded game systems.
      Parameters:
      system - a grounded game system.
  • Method Details

    • hasWinner

      public boolean hasWinner()
      Description copied from interface: GameProtocol
      Returns "true" if the game has finished and a winner is determined, otherwise it returns "false"
      Specified by:
      hasWinner in interface GameProtocol
      Returns:
      "true" if the game has finished and a winner is determined, otherwise it returns "false"
    • getWinner

      public Agent getWinner()
      Description copied from interface: GameProtocol
      If the game has a winner, this methods returns it. Otherwise it throws a RuntimeException.
      Specified by:
      getWinner in interface GameProtocol
      Returns:
      the winner of the game.
    • getUtility

      public Double getUtility(Agent agent)
      Description copied from interface: GameProtocol
      Returns the utility of the given agent for the final situation.
      Specified by:
      getUtility in interface GameProtocol
      Parameters:
      agent - some agent.
      Returns:
      the utility of the agent for the final situation.
    • toString

      public String toString()
      Overrides:
      toString in class Object