コード例 #1
0
        'truck4',
        'truck5',
    ],
    'plane': [
        'plane1',
    ],
    'pkg': [
        'pkg1',
        'pkg2',
        'pkg3',
    ]
})
new_tihtn_planner.declare_funs({
    load_plane: ['pkg', 'location', 'plane'],
    load_truck: ['pkg', 'location', 'truck'],
    by_plane: ['plane', 'location'],
    drive_truck: ['truck', 'location'],
    unload_truck: ['pkg', 'location', 'truck'],
    unload_plane: ['pkg', 'location', 'plane']
})
new_tihtn_planner.instance()


def execute(completable):
    return new_tihtn_planner.pyhop(completable, allow, state0, [
        ('delievery', 'pkg1', ('city4', 'loc2')),
        ('delievery', 'pkg2', ('city1', 'loc2')),
        ('delievery', 'pkg3', ('city5', 'loc1')),
    ], [
        [0, 1],
        [1, 2],
    ], 9)
コード例 #2
0
        'mode-1',
        'mode-2',
        'mode-3',
    ],
    'direction': [
        'direc-1',
        'direc-2',
        'direc-3',
        'direc-4',
        'direc-5',
    ]
})
new_tihtn_planner.declare_funs({
    switch_off: ['satellite'],
    switch_on: ['instrument', 'satellite'],
    turn_to: ['satellite', 'direction'],
    calibrate: ['instrument', 'satellite', 'direction'],
    take_img: ['satellite', 'direction', 'instrument', 'mode']
})
new_tihtn_planner.instance()


def execute(completable):
    return new_tihtn_planner.pyhop(completable, allow, state0, [
        ('get_img', 'direc-5', 'mode-1'),
        ('get_img', 'direc-5', 'mode-2'),
        ('get_img', 'direc-2', 'mode-1'),
        ('get_img', 'direc-5', 'mode-3'),
    ], [
        [0, 1],
        [1, 2],
コード例 #3
0
#!/usr/bin/env python
# coding=utf-8
import sys  
sys.path.insert(0, './') 
from blockworld import *
import new_tihtn_planner
state0 = new_tihtn_planner.State('state0')

allow = False
state0.on = {'block-2':False,'block-3':'block-2','block-5':False,'block-1':'block-5','block-4':False,}
state0.down = {'block-2':'block-3','block-3':False,'block-5':'block-1','block-1':False,'block-4':False,}
state0.clear = {'block-2':True,'block-3':False,'block-5':True,'block-1':False,'block-4':True,}
state0.on_table = {'block-2':False,'block-3':True,'block-5':False,'block-1':True,'block-4':True,}
state0.holding = False
new_tihtn_planner.declare_types({'block':['block-1','block-2','block-3','block-4','block-5',],'nothing':[()]})
new_tihtn_planner.declare_funs({pick_up:['block'],put_down:['block'],stack:['block', 'block'],checkpile1:['nothing'],checkpile2:['nothing'],checkpile3:['nothing'],checkpile4:['nothing']})
new_tihtn_planner.instance()
def execute(completable):
	return new_tihtn_planner.pyhop(completable, allow, state0,[('tower5','block-1','block-2', 'block-3', 'block-4', 'block-5')], [],9)
def add_methods(fun_obj_list):
	for fun in fun_obj_list:
		new_tihtn_planner.add_method(fun.func_name.split('__')[0], fun)
def reverse_methods():
	new_tihtn_planner.reverse_methods()