Search in sources :

Example 1 with AgentHandlers

use of com.microsoft.Malmo.Schemas.AgentHandlers in project malmo by Microsoft.

the class MissionBehaviour method initAgent.

private void initAgent(MissionInit missionInit) {
    reset();
    AgentHandlers handlerset = missionInit.getMission().getAgentSection().get(missionInit.getClientRole()).getAgentHandlers();
    // Instantiate the various handlers:
    for (Object handler : handlerset.getAgentMissionHandlers()) createAndAddHandler(handler);
    // If this is a multi-agent mission, need to ensure we have a team reward handler
    // to receive rewards from other agents.
    List<AgentSection> agents = missionInit.getMission().getAgentSection();
    if (agents != null && agents.size() > 1)
        addHandler(new RewardFromTeamImplementation());
}
Also used : AgentSection(com.microsoft.Malmo.Schemas.AgentSection) AgentHandlers(com.microsoft.Malmo.Schemas.AgentHandlers)

Aggregations

AgentHandlers (com.microsoft.Malmo.Schemas.AgentHandlers)1 AgentSection (com.microsoft.Malmo.Schemas.AgentSection)1