k = int(argv[5]) # argv[5] = clique size seed = int(argv[6]) #Seed pddl_file = open(argv[1] + argv[2] + ".pddl", "w") pddl_file.write("(define (problem a)\n\t(:domain clique)\n") pddl_file.write("\t(:objects\n\t\t") objects = "\n\t\t".join(bp.generate_obj(num_vert)) + "\n\t)" pddl_file.write(objects) pddl_file.write("\n\t(:init\n\t\t(guess)\n\t\t") suc_fluents = bp.generate_suc(num_vert) gt_fluents = bp.generate_gt(num_vert) free_rel_fluents = bp.generate_free_rel_2arity(num_vert,"f") free_domain_fluents = bp.generate_free_domain(num_vert,"f") free_range_fluents = bp.generate_free_range(num_vert,"f") e_fluents = generate_random_e(num_vert, p) ssuc_fluents = "\n\t\t".join(suc_fluents) + "\n\t\t" se_fluents = "\n\t\t".join(e_fluents) + "\n\t\t" sgt_fluents = "\n\t\t".join(gt_fluents) + "\n\t\t" sfree_rel_fluents = "\n\t\t".join(free_rel_fluents) + "\n\t\t" sfree_domain_fluents = "\n\t\t".join(free_domain_fluents) + "\n\t\t" sfree_range_fluents = "\n\t\t".join(free_range_fluents) + "\n\t\t" s_notk = "\n\t\t".join(generate_not_k(k)) s_k = "\n\t\t".join(generate_k(k)) + "\n\t\t"
pddl_file = open( str(num_vert) + "_" + argv[1] + argv[2] + "_k" + argv[3] + ".pddl", "w") pddl_file.write("(define (problem a)\n") pddl_file.write("\t(:domain kcolorability)\n") pddl_file.write("\t(:objects\n\t\t") objects = "\n\t\t".join(bp.generate_obj(num_vert)) + "\n\t)" pddl_file.write(objects) pddl_file.write("\n\t(:init\n\t\t(guess)\n\t\t") suc_fluents = bp.generate_suc(num_vert) free_rel_fluents = bp.generate_free_rel_2arity(num_vert, "f") free_domain_fluents = bp.generate_free_domain(num_vert, "f") free_range_fluents = bp.generate_free_range(num_vert, "f") e_fluents, difference = translate_e(tokens, num_vert) e_fluents2 = listDiff(bp.generate_all_2arity("not_e", num_vert), difference) ssuc_fluents = "\n\t\t".join(suc_fluents) + "\n\t\t" se_fluents = "\n\t\t".join(e_fluents) + "\n\t\t" se_fluents2 = "\n\t\t".join(e_fluents2) + "\n\t\t" s_k = "\n\t\t".join(generate_k(k)) + "\n\t\t" sfree_f = "\n\t\t".join(bp.generate_free_rel_2arity(num_vert, 'f')) + "\n\t\t" sfree_domain_f = "\n\t\t".join(bp.generate_free_domain(num_vert, 'f')) + "\n\t\t" pddl_file.write(ssuc_fluents + se_fluents + se_fluents2 + s_k + sfree_f +\
seed = int(argv[5]) #Seed pddl_file = open(argv[1] + argv[2] + ".pddl", "w") pddl_file.write("(define (problem a)\n") pddl_file.write("\t(:domain hamiltonian)\n") pddl_file.write("\t(:objects\n\t\t") objects = "\n\t\t".join(bp.generate_obj(num_vert)) + "\n\t)" pddl_file.write(objects) pddl_file.write("\n\t(:init\n\t\t(guess)\n\t\t") suc_fluents = bp.generate_suc(num_vert) gt_fluents = bp.generate_gt(num_vert) free_rel_fluents = bp.generate_free_rel_2arity(num_vert, "f") free_domain_fluents = bp.generate_free_domain(num_vert, "f") free_range_fluents = bp.generate_free_range(num_vert, "f") e_fluents = generate_random_e(num_vert, p) ssuc_fluents = "\n\t\t".join(suc_fluents) + "\n\t\t" se_fluents = "\n\t\t".join(e_fluents) + "\n\t\t" slt_fluents = "\n\t\t".join(gt_fluents) + "\n\t\t" sfree_rel_fluents = "\n\t\t".join(free_rel_fluents) + "\n\t\t" sfree_domain_fluents = "\n\t\t".join(free_domain_fluents) + "\n\t\t" sfree_range_fluents = "\n\t\t".join(free_range_fluents) pddl_file.write(ssuc_fluents + se_fluents + slt_fluents +\ sfree_rel_fluents + sfree_domain_fluents +\ sfree_range_fluents)
seed = int(argv[6]) #Seed pddl_file = open(argv[1] + argv[2] + ".pddl", "w") pddl_file.write("(define (problem a)\n") pddl_file.write("\t(:domain vertexcover)\n") pddl_file.write("\t(:objects\n\t\t") objects = "\n\t\t".join(bp.generate_obj(num_vert)) + "\n\t)" pddl_file.write(objects) pddl_file.write("\n\t(:init\n\t\t(guess)\n\t\t") suc_fluents = bp.generate_suc(num_vert) free_rel_fluents = bp.generate_free_rel_2arity(num_vert,"f") free_domain_fluents = bp.generate_free_domain(num_vert,"f") free_range_fluents = bp.generate_free_range(num_vert,"f") e_fluents, difference = generate_random_e(num_vert, p) e_fluents2 = listDiff(bp.generate_all_2arity("not_e",num_vert), difference) ssuc_fluents = "\n\t\t".join(suc_fluents) + "\n\t\t" se_fluents = "\n\t\t".join(e_fluents) + "\n\t\t" se_fluents2 = "\n\t\t".join(e_fluents2) + "\n\t\t" sfree_f = "\n\t\t".join(bp.generate_free_rel_2arity(num_vert,'f')) + "\n\t\t" sfree_domain_f = "\n\t\t".join(bp.generate_free_domain(num_vert,'f')) + "\n\t\t" sfree_range_f = "\n\t\t".join(bp.generate_free_range(num_vert,'f')) + "\n\t\t" s_k = "\n\t\t".join(generate_k(k)) + "\n\t\t" s_notk = "\n\t\t".join(generate_not_k(k))