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
ConstructorDescriptionDirectGameProtocol
(MultiAgentSystem<? extends Agent> multiAgentSystem) Constructs a newDirectGameProtocol
with 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.boolean
Determines if the game has a winner.toString()
Provides a string representation of the protocol.Methods inherited from class org.tweetyproject.agents.AbstractProtocol
addProtocolListener, removeProtocolListener
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tweetyproject.agents.Protocol
addProtocolListener, removeProtocolListener
-
Constructor Details
-
DirectGameProtocol
Constructs a newDirectGameProtocol
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 interfaceGameProtocol
- Returns:
true
if the game has a winner,false
otherwise.
-
getWinner
Retrieves the winner of the game. The winner is typically the pro agent (non-DummyLotteryAgent
).- Specified by:
getWinner
in interfaceGameProtocol
- Returns:
- The agent who won the game, or
null
if 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:
getUtility
in interfaceGameProtocol
- 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
-