#include <MultiAgent.h>
MultiAgent::MultiAgent |
( |
int |
nAgents, |
|
|
Agent ** |
assign = 0 |
|
) |
| |
Constructor. Creates a multi-agent of nAgents sub-agents. Sub-agents can be assigned on-the-spot by specifying assign or later on by assigning them eg. this->agents[i] = new MyAgent(). If such is the case (ie. if assign is NULL), then the MultiAgent will also own the agents.
MultiAgent::~MultiAgent |
( |
| ) |
|
|
virtual |
Class destructor (frees the sub-agents if ownsAgents is true).
virtual void MultiAgent::appendAgentAction |
( |
int |
agentIdx, |
|
|
const Action * |
agentAction |
|
) |
| |
|
pure virtual |
Appends action from sub-agent agentIdx to the action that will later be returned by the call to combineAgentActions().
virtual Action* MultiAgent::combineAgentActions |
( |
| ) |
|
|
pure virtual |
Returns the combine action that is the result of combining all the sub-agent actions through calls to appendAgentAction(agentIdx, agentAction).
void MultiAgent::end |
( |
const Observation * |
observation | ) |
|
|
virtual |
Performs the last episode step.
Reimplemented from Agent.
Returns an observation suitable for sub-agent agentIdx starting from observation observation as received by this MultiAgent.
void MultiAgent::init |
( |
| ) |
|
|
virtual |
Initializes the agent.
Reimplemented from Agent.
Chooses the first action in the episode.
Implements Agent.
Performs an episode step.
Implements Agent.
Agent** MultiAgent::agents |
The number of sub-agents.
bool MultiAgent::ownsAgents |
True if this MultiAgent owns the pointers to the agents (and will thus free them at destruction).
The documentation for this class was generated from the following files: