/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
//                                                                             //
// RDDL MDP version of Cooperative Recon instance #18 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__18 {
    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, obj12, obj13, obj14, obj15 };
        agent              : { a00, a01, a02, a03 };
        tool               : { w00, l00, l01, c01, w02, c02, w03, l03, c03 };
    };

    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(x00, y03);

        // TOOLS
        WATER_TOOL(w00);
        HAS_TOOL(a00, w00);
        LIFE_TOOL(l00);
        HAS_TOOL(a00, l00);
        LIFE_TOOL(l01);
        HAS_TOOL(a01, l01);
        CAMERA_TOOL(c01);
        HAS_TOOL(a01, c01);
        WATER_TOOL(w02);
        HAS_TOOL(a02, w02);
        CAMERA_TOOL(c02);
        HAS_TOOL(a02, c02);
        WATER_TOOL(w03);
        HAS_TOOL(a03, w03);
        LIFE_TOOL(l03);
        HAS_TOOL(a03, l03);
        CAMERA_TOOL(c03);
        HAS_TOOL(a03, c03);

        // DAMAGE_PROBS
        DAMAGE_PROB(x00, y00) = 0.40;
        DAMAGE_PROB(x00, y01) = 0.45;
        DAMAGE_PROB(x00, y02) = 0.13;
        DAMAGE_PROB(x01, y00) = 0.19;
        DAMAGE_PROB(x01, y01) = 0.50;
        DAMAGE_PROB(x01, y06) = 0.63;
        DAMAGE_PROB(x01, y07) = 0.83;
        DAMAGE_PROB(x02, y01) = 1.00;
        DAMAGE_PROB(x02, y02) = 0.37;
        DAMAGE_PROB(x02, y05) = 0.38;
        DAMAGE_PROB(x02, y06) = 1.00;
        DAMAGE_PROB(x02, y07) = 1.00;
        DAMAGE_PROB(x03, y01) = 0.57;
        DAMAGE_PROB(x03, y02) = 0.39;
        DAMAGE_PROB(x03, y04) = 0.18;
        DAMAGE_PROB(x03, y05) = 0.42;
        DAMAGE_PROB(x03, y06) = 0.82;
        DAMAGE_PROB(x03, y07) = 0.25;
        DAMAGE_PROB(x04, y01) = 1.00;
        DAMAGE_PROB(x04, y02) = 0.87;
        DAMAGE_PROB(x04, y03) = 0.57;
        DAMAGE_PROB(x04, y04) = 0.74;
        DAMAGE_PROB(x04, y05) = 1.00;
        DAMAGE_PROB(x04, y06) = 1.00;
        DAMAGE_PROB(x04, y07) = 0.44;
        DAMAGE_PROB(x05, y00) = 0.21;
        DAMAGE_PROB(x05, y01) = 0.20;
        DAMAGE_PROB(x05, y02) = 0.39;
        DAMAGE_PROB(x05, y03) = 0.25;
        DAMAGE_PROB(x05, y04) = 0.18;
        DAMAGE_PROB(x05, y05) = 0.42;
        DAMAGE_PROB(x05, y06) = 0.44;
        DAMAGE_PROB(x06, y00) = 0.59;
        DAMAGE_PROB(x06, y01) = 0.36;
        DAMAGE_PROB(x06, y02) = 0.40;
        DAMAGE_PROB(x06, y03) = 0.46;
        DAMAGE_PROB(x06, y04) = 0.49;
        DAMAGE_PROB(x07, y00) = 0.49;
        DAMAGE_PROB(x07, y01) = 0.65;
        DAMAGE_PROB(x07, y02) = 0.44;
        DAMAGE_PROB(x07, y03) = 0.64;
        DAMAGE_PROB(x07, y04) = 0.41;
        DAMAGE_PROB(x07, y05) = 0.24;

        // DETECT_PROBS
        DETECT_PROB = 0.4;
        DETECT_PROB_DAMAGED = 0.2;
        DETECT_PROB_WITH_SUPPORT = 0.8;
        DETECT_PROB_DAMAGED_WITH_SUPPORT = 0.4;

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

        // REWARDS
        GOOD_PIC_REWARD(obj00) = 13.89;
        BAD_PIC_REWARD(obj00) = 13.78;
        GOOD_PIC_REWARD(obj01) = 5.00;
        BAD_PIC_REWARD(obj01) = 1.58;
        GOOD_PIC_REWARD(obj02) = 10.32;
        BAD_PIC_REWARD(obj02) = 4.35;
        GOOD_PIC_REWARD(obj03) = 5.50;
        BAD_PIC_REWARD(obj03) = 5.24;
        GOOD_PIC_REWARD(obj04) = 5.70;
        BAD_PIC_REWARD(obj04) = 2.54;
        GOOD_PIC_REWARD(obj05) = 18.65;
        BAD_PIC_REWARD(obj05) = 3.73;
        GOOD_PIC_REWARD(obj06) = 5.50;
        BAD_PIC_REWARD(obj06) = 5.41;
        GOOD_PIC_REWARD(obj07) = 1.31;
        BAD_PIC_REWARD(obj07) = 1.18;
        GOOD_PIC_REWARD(obj08) = 20.85;
        BAD_PIC_REWARD(obj08) = 17.28;
        GOOD_PIC_REWARD(obj09) = 18.26;
        BAD_PIC_REWARD(obj09) = 9.18;
        GOOD_PIC_REWARD(obj10) = 2.50;
        BAD_PIC_REWARD(obj10) = 0.50;
        GOOD_PIC_REWARD(obj11) = 11.27;
        BAD_PIC_REWARD(obj11) = 10.17;
        GOOD_PIC_REWARD(obj12) = 5.00;
        BAD_PIC_REWARD(obj12) = 4.77;
        GOOD_PIC_REWARD(obj13) = 1.37;
        BAD_PIC_REWARD(obj13) = 1.03;
        GOOD_PIC_REWARD(obj14) = 4.05;
        BAD_PIC_REWARD(obj14) = 3.57;
        GOOD_PIC_REWARD(obj15) = 10.97;
        BAD_PIC_REWARD(obj15) = 7.10;

    };

    init-state { 
        agent-at(a00, x01, y01);
        agent-at(a01, x00, y05);
        agent-at(a02, x00, y06);
        agent-at(a03, x00, y00);

    };

    horizon = 80;

    discount = 1.0;
}