public interface Agent
Modifier and Type | Method and Description |
---|---|
void |
addCompetitor(Agent agent)
Adds an competing Agent to this Agent's list of competitors
|
void |
addCompetitors(java.util.Collection<Agent> others)
Adds competitors to the current Agent class
|
boolean |
doAssignment(Assignment ass)
Asks the agent to decide whether to try or to fail in the current
assignment.
|
void |
eliminate()
EliminationEvent tells the agent she is eliminated.
|
java.lang.String |
getName()
What is this agent's name?
|
void |
informAssResult(boolean success,
java.util.ArrayList<Agent> triedList,
java.util.ArrayList<Agent> sabotagedList)
AssignmentEvent tells the agent what she sees
|
void |
informElimination(Agent loser)
EliminationEvent tells Agent who is eliminated through this method.
|
void |
informGameEnd(int nrOfLeftAgent)
Round or EliminateEvent inform every player that the game is end.
|
boolean |
isEliminated()
Am I eliminated?
|
boolean |
isMole()
Is this agent the mole?
|
void |
listenConversation(Agent speaker,
Agent suspicion)
ConversationEvent tells Agent who is the mole.
|
void |
normalizeSuspicions()
Normalizes the suspicions so they sum up to one.
|
Agent |
tellConversation()
This may do the same as vote
|
void |
updateSuspicion(Agent a,
double factor)
Multiply this AgentImplementation's suspicion towards a specific Agent
with some factor.
|
Agent |
vote()
This is the voting method, used in the final stage of every game round.
|
Agent vote()
boolean doAssignment(Assignment ass)
Agent tellConversation()
vote()
void listenConversation(Agent speaker, Agent suspicion)
speaker
- the agent who gives the informationsuspicion
- the suspicion which speaker tells listenervoid updateSuspicion(Agent a, double factor)
a
- the agent towards whom the suspicion should be changedfactor
- the factor by which the suspicion should be changed. If the
factor is not positive it will be changed to 1, leaving the suspicion
unchanged.void normalizeSuspicions()
void addCompetitors(java.util.Collection<Agent> others)
others
- Collection with other Agentsvoid addCompetitor(Agent agent)
agent
- an Agent instanceboolean isMole()
java.lang.String getName()
void informElimination(Agent loser)
loser
- the agent who is eliminated from the gameboolean isEliminated()
void eliminate()
void informAssResult(boolean success, java.util.ArrayList<Agent> triedList, java.util.ArrayList<Agent> sabotagedList)
success
- The result of the assignmenttriedList
- The agents who try her's bestsabotagedList
- The agents who sabotagedvoid informGameEnd(int nrOfLeftAgent)
nrOfLeftAgent
- tell the agent how many agents left in the game