public interface SGAgent
SGAgentType
. Agents are informed
by the world when a game is starting and ending and they are also queried
by the world for the action they will take. After all agents in the world
have chosen their action, the world changes and informs each agent of the outcome
for all agents in the world.Modifier and Type | Method and Description |
---|---|
Action |
action(State s)
This method is called by the world when it needs the agent to choose an action
|
java.lang.String |
agentName()
Returns this agent's name
|
SGAgentType |
agentType()
Returns this agent's type
|
void |
gameStarting(World w,
int agentNum)
This method is called by the world when a new game is starting.
|
void |
gameTerminated()
This method is called by the world when a game has ended.
|
void |
observeOutcome(State s,
JointAction jointAction,
double[] jointReward,
State sprime,
boolean isTerminal)
This method is called by the world when every agent in the world has taken their action.
|
java.lang.String agentName()
SGAgentType agentType()
void gameStarting(World w, int agentNum)
w
- the world in which the game is startingagentNum
- the agent number of the agent in the worldAction action(State s)
s
- the current state of the worldvoid observeOutcome(State s, JointAction jointAction, double[] jointReward, State sprime, boolean isTerminal)
s
- the state in which the last action of each agent was takenjointAction
- the joint action of all agents in the worldjointReward
- the joint reward of all agents in the worldsprime
- the next state to which the agent transitionedisTerminal
- whether the new state is a terminal statevoid gameTerminated()