Пример #1
0
    '''cleancups = 0
	while cleancups <= state.NUMBER_OF_DIRTY_TEACUPS:
		cup = 'teacup'+str(random.randint(1, state.TOTAL_NUMBER_OF_TEACUPS))
		if(state2.itemstate[cup]['cleanstate'] == Itemstate.unknown):
			state2.itemstate[cup]['cleanstate'] = Itemstate.clean
			cleancups = cleancups + 1'''

    state.currentcup = ''
    return state


print(
    '''Running: pyhop.pyhop(teaathome.setupRobotArm(test1()),[('taskmaketea','robot','teabag', 1)],verbose=2)'''
)
print('')

teaathome.setupTeaAtHome()
pyhop.print_operators()
print('')
pyhop.print_methods()
print('')

pyhop.pyhop(teaathome.setupRobotArm(test1()),
            [('taskmaketea', 'robot', 'teabag', 1)],
            verbose=2)

sys.stdout.close()

sys.stdout = sys.__stdout__
print('Result log file: logs/test1.log')
Пример #2
0
	while cleancups <= numcupsknownclean:
		cup = 'teacup'+str(random.randint(1, state.TOTAL_NUMBER_OF_TEACUPS))
		if(state2.itemstate[cup]['cleanstate'] == Itemstate.unknown):
			state2.itemstate[cup]['cleanstate'] = Itemstate.clean
			cleancups = cleancups + 1"""
		
	state.currentcup = ""
	return state

	#goal = pyhop.Goal('goal 2')
	#goal.loc = {'robot':Location.startlocation, 'kettle':Location.kettlebase, 'teabag':Location.inteacup}
	#goal.itemstate = {'kettle':{'openstate':Itemstate.closed, 'fillstate': Itemstate.empty}, 'coldtap':{'openstate':Itemstate.closed}}
	#goal.robotarm = {'robot':RobotArm.free}
	#pyhop.print_goal(goal)

print('''Running: pyhop.pyhop(teaathome.setupRobotArm(test2()),[('taskmaketea','robot','teabag', 1)],verbose=2)''')
print('')

teaathome.setupTeaAtHome()
pyhop.print_operators()
print('')
pyhop.print_methods()
print('')

pyhop.pyhop(teaathome.setupRobotArm(test2()),[('taskmaketea','robot','teabag', 1)],verbose=2)

sys.stdout.close()

sys.stdout = sys.__stdout__
print('Result log file: logs/test2.log')