コード例 #1
0
#----
all_base = '& G F base1 & G F base2 G F base3'
order1 = 'G i supply X U ! supply base'
order2 = 'G i base X U ! base supply'
order = '& %s %s' %(order1, order2)
task1 = '& %s & G ! obstacle %s' %(all_base, order2)
task2 = '& %s G F supply' %all_base
task3 = '& %s %s' %(all_base, order2)
dra = Dra(all_base)
t3 = time.time()
print '------------------------------'
print 'DRA done, time: %s' %str(t3-t2)

#----
prod_dra = Product_Dra(motion_mdp, dra)
t41 = time.time()
print '------------------------------'
print 'Product DRA done, time: %s' %str(t41-t3)
#----
prod_dra.compute_S_f()
t42 = time.time()
print '------------------------------'
print 'Compute MEC done, time: %s' %str(t42-t41)

print '------------------------------'
t43 = time.time()
clean_prod_dra = dict()
clean_prod_dra['name'] = 'size%d_all_base' %N
clean_prod_dra['init'] = prod_dra.graph['initial']
clean_prod_dra['states'] = prod_dra.nodes()
コード例 #2
0
base = '& G F b G F w'
#order = 'G i h X U ! w b'
order = 'G F h'
safe = 'G ! o'
task = '& %s & %s %s' % (base, order, safe)
#task = '& G F b G F h'
print 'Formula received: %s' % str(task)
dra = Dra(task)
t3 = time.time()

print 'DRA done, time: %s' % str(t3 - t2)

#----
print '------------------------------'
gamma = [0.8, 0.5]  # gamma_o, gamma_r
prod_dra = Product_Dra(mdp=robot_mdp, dra=dra, gamma=gamma)
#prod_dra.dotify()
t41 = time.time()
print 'Product DRA constructed, time: %s' % str(t41 - t3)
#prod_dra.verify()
#----
prod_dra.init_dirichlet()
t42 = time.time()
print 'Compute init_dirichlet done, time: %s' % str(t42 - t41)
#----
prod_dra.compute_init_mean_sigma()
t43 = time.time()
print 'Compute init_mean_sigma done, time: %s' % str(t43 - t42)
#prod_dra.verify()
#----
prod_dra.compute_S_f()