Ejemplo n.º 1
0
pddl_file.write("\t(:objects ")

maxim = num_vert
for i in range(1, maxim - 1):
    pddl_file.write("\t\t\tobj" + str(i) + " \n")
pddl_file.write("\n\t)\n")

pddl_file.write("\t(:init\n\t\t(guess)\n\t\t")

suc_fluents = bp.generate_suc(num_vert)

ssuc_fluents = "\n\t\t".join(suc_fluents) + "\n\t\t"
T_set = generateRandomInput(num_vert, p)

st_fluents = "\n\t\t".join(T_set) + "\n\t\t"
sfree_f = "\n\t\t".join(bp.generate_all_2arity("not_f", num_vert)) + "\n\t\t"
sfree_g = "\n\t\t".join(bp.generate_all_2arity("not_g", num_vert)) + "\n\t\t"

free_domain_f = bp.generate_free_domain(num_vert, "f")
free_domain_g = bp.generate_free_domain(num_vert, "g")
free_range_f = bp.generate_free_range(num_vert, "f")
free_range_g = bp.generate_free_range(num_vert, "g")

sfree_domain_f = "\n\t\t".join(free_domain_f) + "\n\t\t"
sfree_domain_g = "\n\t\t".join(free_domain_g) + "\n\t\t"
sfree_range_f = "\n\t\t".join(free_range_f) + "\n\t\t"
sfree_range_g = "\n\t\t".join(free_range_g) + "\n\t\t"

pddl_file.write(ssuc_fluents + st_fluents + sfree_f + sfree_g +\
        sfree_domain_f + sfree_range_f + sfree_domain_g + \
        sfree_range_g)
Ejemplo n.º 2
0
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))

pddl_file.write(ssuc_fluents + se_fluents + se_fluents2 +\
        sfree_f + sfree_domain_f + \
        sfree_range_f + s_k + s_notk)
Ejemplo n.º 3
0
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 +\
                sfree_domain_f)

pddl_file.write("\n\t)\n\t(:goal (holds_goal)\n\t)\n)")
Ejemplo n.º 4
0
pddl_file.write("\t(:objects ")

maxim = num_vert 
for i in range (1,maxim-1):
    pddl_file.write("\t\t\tobj"+ str(i)+" \n")
pddl_file.write("\n\t)\n")

pddl_file.write("\t(:init\n\t\t(guess)\n\t\t")

suc_fluents = bp.generate_suc(num_vert)
    
ssuc_fluents = "\n\t\t".join(suc_fluents) + "\n\t\t"
T_set = generateRandomInput(num_vert, p)

st_fluents = "\n\t\t".join(T_set) + "\n\t\t"
sfree_f = "\n\t\t".join(bp.generate_all_2arity("not_f",num_vert)) + "\n\t\t"
sfree_g = "\n\t\t".join(bp.generate_all_2arity("not_g",num_vert)) + "\n\t\t"

free_domain_f = bp.generate_free_domain(num_vert, "f")
free_domain_g = bp.generate_free_domain(num_vert, "g")
free_range_f = bp.generate_free_range(num_vert, "f")
free_range_g = bp.generate_free_range(num_vert, "g")

sfree_domain_f = "\n\t\t".join(free_domain_f) + "\n\t\t"
sfree_domain_g = "\n\t\t".join(free_domain_g) + "\n\t\t"
sfree_range_f = "\n\t\t".join(free_range_f) + "\n\t\t"
sfree_range_g = "\n\t\t".join(free_range_g) + "\n\t\t"

pddl_file.write(ssuc_fluents + st_fluents + sfree_f + sfree_g +\
        sfree_domain_f + sfree_range_f + sfree_domain_g + \
        sfree_range_g)