コード例 #1
0
 def test_turtle_load_user(self):
     turtleName = self.get_turtle()
     if not monkapi.has_turtle_in_store(turtleName, self.user):
         monkapi.follow_turtle(turtleName, self.user, self.leader)
     result = monkapi.load_turtle(turtleName, self.user)
     assert result != None
     # load can be repeated, overwrite the memory from database
     result = monkapi.load_turtle(turtleName, self.user)
     assert result != None
コード例 #2
0
 def test_turtle_load_user(self):
     turtleName = self.get_turtle()
     if not monkapi.has_turtle_in_store(turtleName, self.user):
         monkapi.follow_turtle(turtleName, self.user, self.leader)
     result = monkapi.load_turtle(turtleName, self.user)
     assert result != None
     # load can be repeated, overwrite the memory from database
     result = monkapi.load_turtle(turtleName, self.user)
     assert result != None
コード例 #3
0
ファイル: test2.py プロジェクト: TravelGene-ios/travelgene
	stemT.save()
	[ent.save() for ent in ents]
	likeTS = ms.yaml2json('turtle_scripts/turtle_like.yml')
	# print likeTS
	likeT = ms.create_turtle(likeTS)
	likeT.save()
	ent = ents[0]
	# print ents[0].generic()
	ent._setattr('likeTravel', 'Y')
	ms.crane.entityStore.save_one(ent)
	ms.add_data('likeTravel', 'monk', str(ents[0]._id))
	print likeT.tigress.p
	print likeT.pandas[0].mantis.data
	likeT.tigress.defaulting=True
	likeT.save()
	likeT = ms.load_turtle('likeTravel','monk')
	likeT.train()
	for i in ents:
		ent = ms.load_entity(i._id)
		print likeT.pandas[0].predict(ent)
		print sign0(likeT.pandas[0].predict(ent))
	# likeTS = ms.yaml2json('turtle_scripts/turtle_like.yml')
	# # print likeTS
	# likeT = ms.create_turtle(likeTS)
	# likeT.save()

	# ent = ents[0]
	# # print ents[0].generic()

	# ent._setattr('likeTravel', 'Y')
	# ms.crane.entityStore.save_all(ents)
コード例 #4
0
ファイル: monkapi.py プロジェクト: TravelGene-ios/travelgene
def train(turtleName,creator='monk'):
    trainer = ms.load_turtle(turtleName,creator)
    trainer.train()
    return trainer