/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
//                                                                             //
// RDDL MDP version of Cooperative Recon instance #14 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__14 {
    domain = cooperative-recon_mdp;

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

    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_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);

        // BASE
        BASE(x05, y06);

        // 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);

        // DAMAGE_PROBS
        DAMAGE_PROB(x00, y01) = 0.78;
        DAMAGE_PROB(x00, y02) = 0.35;
        DAMAGE_PROB(x00, y03) = 0.16;
        DAMAGE_PROB(x00, y04) = 0.41;
        DAMAGE_PROB(x00, y05) = 0.16;
        DAMAGE_PROB(x01, y00) = 0.39;
        DAMAGE_PROB(x01, y01) = 0.56;
        DAMAGE_PROB(x01, y03) = 0.24;
        DAMAGE_PROB(x01, y04) = 1.00;
        DAMAGE_PROB(x01, y05) = 0.86;
        DAMAGE_PROB(x01, y06) = 0.23;
        DAMAGE_PROB(x02, y00) = 0.22;
        DAMAGE_PROB(x02, y03) = 0.45;
        DAMAGE_PROB(x02, y04) = 0.82;
        DAMAGE_PROB(x02, y05) = 0.68;
        DAMAGE_PROB(x03, y02) = 0.12;
        DAMAGE_PROB(x03, y03) = 0.29;
        DAMAGE_PROB(x03, y04) = 0.58;
        DAMAGE_PROB(x03, y05) = 0.34;
        DAMAGE_PROB(x03, y06) = 0.24;
        DAMAGE_PROB(x04, y03) = 0.29;
        DAMAGE_PROB(x04, y04) = 0.13;
        DAMAGE_PROB(x04, y05) = 0.52;
        DAMAGE_PROB(x04, y06) = 0.45;
        DAMAGE_PROB(x05, y02) = 0.49;
        DAMAGE_PROB(x05, y03) = 0.43;
        DAMAGE_PROB(x05, y04) = 0.16;
        DAMAGE_PROB(x05, y05) = 0.13;
        DAMAGE_PROB(x06, y01) = 0.33;
        DAMAGE_PROB(x06, y02) = 0.84;
        DAMAGE_PROB(x06, y03) = 0.75;
        DAMAGE_PROB(x06, y04) = 0.12;
        DAMAGE_PROB(x06, y05) = 0.24;
        DAMAGE_PROB(x06, y06) = 0.41;

        // 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, x02, y00);
        OBJECT_AT(obj02, x04, y01);
        OBJECT_AT(obj03, x02, y06);
        OBJECT_AT(obj04, x03, y01);
        OBJECT_AT(obj05, x01, y01);
        OBJECT_AT(obj06, x00, y01);
        OBJECT_AT(obj07, x02, y03);
        OBJECT_AT(obj08, x01, y02);
        OBJECT_AT(obj09, x02, y04);

        // REWARDS
        GOOD_PIC_REWARD(obj00) = 14.37;
        BAD_PIC_REWARD(obj00) = 2.87;
        GOOD_PIC_REWARD(obj01) = 24.47;
        BAD_PIC_REWARD(obj01) = 4.89;
        GOOD_PIC_REWARD(obj02) = 17.38;
        BAD_PIC_REWARD(obj02) = 3.48;
        GOOD_PIC_REWARD(obj03) = 1.50;
        BAD_PIC_REWARD(obj03) = 0.30;
        GOOD_PIC_REWARD(obj04) = 21.68;
        BAD_PIC_REWARD(obj04) = 11.04;
        GOOD_PIC_REWARD(obj05) = 25.21;
        BAD_PIC_REWARD(obj05) = 9.67;
        GOOD_PIC_REWARD(obj06) = 45.61;
        BAD_PIC_REWARD(obj06) = 20.81;
        GOOD_PIC_REWARD(obj07) = 11.06;
        BAD_PIC_REWARD(obj07) = 2.21;
        GOOD_PIC_REWARD(obj08) = 35.85;
        BAD_PIC_REWARD(obj08) = 29.83;
        GOOD_PIC_REWARD(obj09) = 4.52;
        BAD_PIC_REWARD(obj09) = 2.47;

    };

    init-state { 
        agent-at(a00, x06, y05);
        agent-at(a01, x04, y04);

    };

    horizon = 70;

    discount = 1.0;
}