/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
//                                                                             //
// RDDL MDP version of Cooperative Recon instance #17 for IPC 2018 by Thomas   //
// Keller (tho.keller [at] unibas.ch), based on the IPC 2011 domain by Tom     //
// Walsh (thomasjwalsh [at] gmail.com).                                        //
//                                                                             //
//                                                                             //
/////////////////////////////////////////////////////////////////////////////////

instance cooperative-recon_inst_mdp__17 {
    domain = cooperative-recon_mdp;

    objects { 
        xpos               : { x00, x01, x02, x03, x04, x05, x06, x07 };
        ypos               : { y00, y01, y02, y03, y04, y05, y06, y07 };
        object-of-interest : { obj00, obj01, obj02, obj03, obj04, obj05, obj06, obj07, obj08, obj09, obj10, obj11 };
        agent              : { a00, a01, a02 };
        tool               : { w00, l00, c00, w01, l01, l02, c02 };
    };

    non-fluents {
        // ADJACENCY
        ADJACENT_LEFT(x00, x01);
        ADJACENT_RIGHT(x01, x00);
        ADJACENT_LEFT(x01, x02);
        ADJACENT_RIGHT(x02, x01);
        ADJACENT_LEFT(x02, x03);
        ADJACENT_RIGHT(x03, x02);
        ADJACENT_LEFT(x03, x04);
        ADJACENT_RIGHT(x04, x03);
        ADJACENT_LEFT(x04, x05);
        ADJACENT_RIGHT(x05, x04);
        ADJACENT_LEFT(x05, x06);
        ADJACENT_RIGHT(x06, x05);
        ADJACENT_LEFT(x06, x07);
        ADJACENT_RIGHT(x07, x06);
        ADJACENT_DOWN(y00, y01);
        ADJACENT_UP(y01, y00);
        ADJACENT_DOWN(y01, y02);
        ADJACENT_UP(y02, y01);
        ADJACENT_DOWN(y02, y03);
        ADJACENT_UP(y03, y02);
        ADJACENT_DOWN(y03, y04);
        ADJACENT_UP(y04, y03);
        ADJACENT_DOWN(y04, y05);
        ADJACENT_UP(y05, y04);
        ADJACENT_DOWN(y05, y06);
        ADJACENT_UP(y06, y05);
        ADJACENT_DOWN(y06, y07);
        ADJACENT_UP(y07, y06);

        // BASE
        BASE(x02, y01);

        // TOOLS
        WATER_TOOL(w00);
        HAS_TOOL(a00, w00);
        LIFE_TOOL(l00);
        HAS_TOOL(a00, l00);
        CAMERA_TOOL(c00);
        HAS_TOOL(a00, c00);
        WATER_TOOL(w01);
        HAS_TOOL(a01, w01);
        LIFE_TOOL(l01);
        HAS_TOOL(a01, l01);
        LIFE_TOOL(l02);
        HAS_TOOL(a02, l02);
        CAMERA_TOOL(c02);
        HAS_TOOL(a02, c02);

        // DAMAGE_PROBS
        DAMAGE_PROB(x00, y04) = 0.25;
        DAMAGE_PROB(x00, y05) = 0.59;
        DAMAGE_PROB(x00, y06) = 0.25;
        DAMAGE_PROB(x01, y00) = 0.37;
        DAMAGE_PROB(x01, y01) = 0.12;
        DAMAGE_PROB(x01, y04) = 0.20;
        DAMAGE_PROB(x01, y05) = 0.86;
        DAMAGE_PROB(x01, y06) = 0.20;
        DAMAGE_PROB(x02, y00) = 0.12;
        DAMAGE_PROB(x02, y05) = 0.20;
        DAMAGE_PROB(x03, y02) = 0.33;
        DAMAGE_PROB(x03, y05) = 0.50;
        DAMAGE_PROB(x03, y06) = 0.27;
        DAMAGE_PROB(x04, y01) = 0.50;
        DAMAGE_PROB(x04, y02) = 0.74;
        DAMAGE_PROB(x04, y03) = 0.33;
        DAMAGE_PROB(x04, y04) = 0.50;
        DAMAGE_PROB(x04, y05) = 1.00;
        DAMAGE_PROB(x04, y06) = 1.00;
        DAMAGE_PROB(x04, y07) = 0.27;
        DAMAGE_PROB(x05, y01) = 0.49;
        DAMAGE_PROB(x05, y02) = 0.83;
        DAMAGE_PROB(x05, y04) = 0.28;
        DAMAGE_PROB(x05, y05) = 1.00;
        DAMAGE_PROB(x05, y06) = 1.00;
        DAMAGE_PROB(x05, y07) = 0.30;
        DAMAGE_PROB(x06, y00) = 0.31;
        DAMAGE_PROB(x06, y01) = 0.89;
        DAMAGE_PROB(x06, y02) = 0.99;
        DAMAGE_PROB(x06, y03) = 0.34;
        DAMAGE_PROB(x06, y04) = 0.20;
        DAMAGE_PROB(x06, y05) = 1.00;
        DAMAGE_PROB(x06, y06) = 1.00;
        DAMAGE_PROB(x06, y07) = 0.27;
        DAMAGE_PROB(x07, y00) = 0.72;
        DAMAGE_PROB(x07, y01) = 0.51;
        DAMAGE_PROB(x07, y02) = 0.34;
        DAMAGE_PROB(x07, y04) = 0.34;
        DAMAGE_PROB(x07, y05) = 0.88;
        DAMAGE_PROB(x07, y06) = 0.61;

        // DETECT_PROBS
        DETECT_PROB = 0.5;
        DETECT_PROB_DAMAGED = 0.25;
        DETECT_PROB_WITH_SUPPORT = 0.8;
        DETECT_PROB_DAMAGED_WITH_SUPPORT = 0.4;

        // OBJECT_AT
        OBJECT_AT(obj00, x05, y03);
        OBJECT_AT(obj01, x00, y00);
        OBJECT_AT(obj02, x06, y00);
        OBJECT_AT(obj03, x05, y06);
        OBJECT_AT(obj04, x07, y00);
        OBJECT_AT(obj05, x05, y07);
        OBJECT_AT(obj06, x06, y03);
        OBJECT_AT(obj07, x01, y05);
        OBJECT_AT(obj08, x01, y01);
        OBJECT_AT(obj09, x07, y03);
        OBJECT_AT(obj10, x06, y07);
        OBJECT_AT(obj11, x02, y00);

        // REWARDS
        GOOD_PIC_REWARD(obj00) = 23.50;
        BAD_PIC_REWARD(obj00) = 10.45;
        GOOD_PIC_REWARD(obj01) = 1.50;
        BAD_PIC_REWARD(obj01) = 1.21;
        GOOD_PIC_REWARD(obj02) = 22.30;
        BAD_PIC_REWARD(obj02) = 11.32;
        GOOD_PIC_REWARD(obj03) = 4.00;
        BAD_PIC_REWARD(obj03) = 0.80;
        GOOD_PIC_REWARD(obj04) = 8.94;
        BAD_PIC_REWARD(obj04) = 5.33;
        GOOD_PIC_REWARD(obj05) = 26.62;
        BAD_PIC_REWARD(obj05) = 24.24;
        GOOD_PIC_REWARD(obj06) = 3.00;
        BAD_PIC_REWARD(obj06) = 0.60;
        GOOD_PIC_REWARD(obj07) = 15.69;
        BAD_PIC_REWARD(obj07) = 12.08;
        GOOD_PIC_REWARD(obj08) = 2.75;
        BAD_PIC_REWARD(obj08) = 2.24;
        GOOD_PIC_REWARD(obj09) = 3.50;
        BAD_PIC_REWARD(obj09) = 1.96;
        GOOD_PIC_REWARD(obj10) = 5.00;
        BAD_PIC_REWARD(obj10) = 1.73;
        GOOD_PIC_REWARD(obj11) = 3.59;
        BAD_PIC_REWARD(obj11) = 1.01;

    };

    init-state { 
        agent-at(a00, x05, y01);
        agent-at(a01, x04, y00);
        agent-at(a02, x05, y01);

    };

    horizon = 80;

    discount = 1.0;
}