<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Mission xmlns="http://ProjectMalmo.microsoft.com">
    <About>
        <Summary>{{name}}</Summary>
    </About>

    <ModSettings>
        <MsPerTick>50</MsPerTick>
    </ModSettings>

    <ServerSection>
        <ServerInitialConditions>
            <!-- Initial Conditions -->

            {% for x in get_consolidated_xml((server_initial_conditions)) %}
            {{ x }}
            {% endfor %}

        </ServerInitialConditions>
        <ServerHandlers>

            {% for x in get_consolidated_xml((server_world_generators)) %}
            {{ x }}
            {% endfor %}

            {% for x in get_consolidated_xml((server_decorators)) %}
            {{ x }}
            {% endfor %}

            {% for x in get_consolidated_xml((server_quit_producers)) %}
            {{ x }}
            {% endfor %}


        </ServerHandlers>
    </ServerSection>


    {% for agent_index in range(agent_count) %}
    <AgentSection mode="Survival">
        <Name>MineRLAgent{{ agent_index }}</Name>

        <AgentStart>

            {% for x in get_consolidated_xml((agent_start[agent_index])) %}
            {{ x }}
            {% endfor %}


        </AgentStart>
        <AgentHandlers>
            <!-- These area  bit of boilerplate that
             we always expect to be included ... -->
            <FileBasedPerformanceProducer/>
            <PauseCommand/>

            <!--  Observations     -->

            {% for x in get_consolidated_xml((observables)) %}
            {{ x }}
            {% endfor %}


            <!--  Actions   -->

            {% for x in get_consolidated_xml((actionables)) %}
            {{ x }}
            {% endfor %}

            <!--  Rewards   -->

            {% for x in get_consolidated_xml((rewardables)) %}
            {{ x }}
            {% endfor %}

            <!-- Additional Agent Handlers like quitting -->
            {% for x in get_consolidated_xml((agent_handlers)) %}
            {{ x }}
            {% endfor %}

            <!-- Env Monitors? -->
            {% for m in monitors %}
            {{ m.xml() }}
            {% endfor %}
        </AgentHandlers>
    </AgentSection>
    {% endfor %}
</Mission>
