Class GroundedGameProtocol
- java.lang.Object
-
- net.sf.tweety.agents.AbstractProtocol
-
- net.sf.tweety.agents.RigidProtocol
-
- net.sf.tweety.agents.RoundRobinProtocol
-
- net.sf.tweety.agents.dialogues.oppmodels.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 Summary
Constructors Constructor Description GroundedGameProtocol(GroundedGameSystem system)
Creates a new grounded game protocol for the given grounded game systems.
-
Method Summary
Modifier and Type Method Description java.lang.Double
getUtility(Agent agent)
Returns the utility of the given agent for the final situation.Agent
getWinner()
If the game has a winner, this methods returns it.boolean
hasWinner()
Returns "true" if the game has finished and a winner is determined, otherwise it returns "false"java.lang.String
toString()
-
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
-
GroundedGameProtocol
public GroundedGameProtocol(GroundedGameSystem system)
Creates a new grounded game protocol for the given grounded game systems.- Parameters:
system
- a grounded game system.
-
-
Method Detail
-
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 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:GameProtocol
If the game has a winner, this methods returns it. Otherwise it throws a RuntimeException.- Specified by:
getWinner
in interfaceGameProtocol
- Returns:
- the winner of the game.
-
getUtility
public java.lang.Double getUtility(Agent agent)
Description copied from interface:GameProtocol
Returns the utility of the given agent for the final situation.- Specified by:
getUtility
in interfaceGameProtocol
- Parameters:
agent
- some agent.- Returns:
- the utility of the agent for the final situation.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-