Class DirectGameProtocol
- java.lang.Object
-
- net.sf.tweety.agents.AbstractProtocol
-
- net.sf.tweety.agents.RigidProtocol
-
- net.sf.tweety.agents.SynchronousProtocol
-
- net.sf.tweety.agents.dialogues.lotteries.sim.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
-
-
Field Summary
-
Fields inherited from class net.sf.tweety.agents.SynchronousProtocol
UNLIMITED_EXECUTION
-
-
Constructor Summary
Constructors Constructor Description DirectGameProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
-
Method Summary
Modifier and Type Method Description java.lang.DoublegetUtility(Agent agent)Returns the utility of the given agent for the final situation.AgentgetWinner()If the game has a winner, this methods returns it.booleanhasWinner()Returns "true" if the game has finished and a winner is determined, otherwise it returns "false"java.lang.StringtoString()-
Methods inherited from class net.sf.tweety.agents.AbstractProtocol
addProtocolListener, removeProtocolListener
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.agents.Protocol
addProtocolListener, removeProtocolListener
-
-
-
-
Constructor Detail
-
DirectGameProtocol
public DirectGameProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
-
-
Method Detail
-
hasWinner
public boolean hasWinner()
Description copied from interface:GameProtocolReturns "true" if the game has finished and a winner is determined, otherwise it returns "false"- Specified by:
hasWinnerin interfaceGameProtocol- Returns:
- "true" if the game has finished and a winner is determined, otherwise it returns "false"
-
getWinner
public Agent getWinner()
Description copied from interface:GameProtocolIf the game has a winner, this methods returns it. Otherwise it throws a RuntimeException.- Specified by:
getWinnerin interfaceGameProtocol- Returns:
- the winner of the game.
-
getUtility
public java.lang.Double getUtility(Agent agent)
Description copied from interface:GameProtocolReturns the utility of the given agent for the final situation.- Specified by:
getUtilityin interfaceGameProtocol- Parameters:
agent- some agent.- Returns:
- the utility of the agent for the final situation.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-