Class DirectGameProtocol
java.lang.Object
org.tweetyproject.agents.AbstractProtocol
org.tweetyproject.agents.RigidProtocol
org.tweetyproject.agents.SynchronousProtocol
org.tweetyproject.agents.dialogues.lotteries.sim.DirectGameProtocol
- All Implemented Interfaces:
Protocol,GameProtocol
This class implements a direct protocol for argumentation games.
- Author:
- Matthias Thimm
-
Field Summary
Fields inherited from class org.tweetyproject.agents.SynchronousProtocol
UNLIMITED_EXECUTION -
Constructor Summary
ConstructorsConstructorDescriptionDirectGameProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem) Constructs a newDirectGameProtocolwith the given multi-agent system. -
Method Summary
Modifier and TypeMethodDescriptiongetUtility(Agent agent) Calculates the utility of the given agent based on the disclosed arguments and attacks in the game.Retrieves the winner of the game.booleanDetermines if the game has a winner.toString()Provides a string representation of the protocol.Methods inherited from class org.tweetyproject.agents.AbstractProtocol
addProtocolListener, removeProtocolListenerMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tweetyproject.agents.Protocol
addProtocolListener, removeProtocolListener
-
Constructor Details
-
DirectGameProtocol
Constructs a newDirectGameProtocolwith 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:
hasWinnerin interfaceGameProtocol- Returns:
trueif the game has a winner,falseotherwise.
-
getWinner
Retrieves the winner of the game. The winner is typically the pro agent (non-DummyLotteryAgent).- Specified by:
getWinnerin interfaceGameProtocol- Returns:
- The agent who won the game, or
nullif no winner is found.
-
getUtility
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:
getUtilityin interfaceGameProtocol- Parameters:
agent- The agent for whom the utility is being calculated.- Returns:
- The utility value for the given agent, or
nullif no utility can be calculated.
-
toString
-