當前位置: 首頁>>代碼示例>>Python>>正文


Python Proxy.make_train方法代碼示例

本文整理匯總了Python中proxy.Proxy.make_train方法的典型用法代碼示例。如果您正苦於以下問題:Python Proxy.make_train方法的具體用法?Python Proxy.make_train怎麽用?Python Proxy.make_train使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在proxy.Proxy的用法示例。


在下文中一共展示了Proxy.make_train方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: len

# 需要導入模塊: from proxy import Proxy [as 別名]
# 或者: from proxy.Proxy import make_train [as 別名]
				# points = res + points
				# values = [v] * len(res) + values
				print 'Added ', (x, v), 'to points'


def add_mismatched(x):
	res = [(x, randint(0, LAST), randint(0, LAST))]
	tmp = x
	for i in xrange(8):
		point = (x, tmp % 256, 0)
		res.append(point)
		tmp /= 256
	return res


if __name__ == "__main__":
	random.seed(0)
	Config.TRAINING = True
	# p = proxy.make_train(8, ["tfold"])
	# p = proxy.make_train(15, ["tfold"])
	p = proxy.make_train(12, ["tfold"])
	inc_solve(p)








開發者ID:pankdm,項目名稱:icfpc-2013,代碼行數:24,代碼來源:incremental_solver.py

示例2: map

# 需要導入模塊: from proxy import Proxy [as 別名]
# 或者: from proxy.Proxy import make_train [as 別名]
		if status == "error":
			print 'Error!, proceeding to another guess'
			h_gen.next()

		if status == "mismatch":
			x, y, my = map(from_hex, data["values"])
			xs.append(x)
			ys.append(y)
			h_current, delta = find_first_good2(h_gen, xs, ys)
			index += delta

if __name__ == "__main__":
	seed(0)
	Config.TRAINING = True
	p = proxy.make_train(42)
	solve2(p)
	
	exit()

	OPS = ["not", "and", "or", "xor", "shr1", "shr4", "shr16", "plus", "shl1", "if0"]
	OPS = ["and","if0","or","plus","shr16","shr4"]
	AR = tuple([randint(0, LAST) for i in xrange(1)])

	g = gen_tree_values(12, OPS, AR, tuple(map(f, AR)))
	print len(g[-1]), tuple(map(f, AR)) in g[-1]
	h = find_all_trees_with_values(g, AR, tuple(map(f, AR)), OPS)
	for a in h:
		print a.dump()#, map(lambda x: a.getx(x), AR)
	print len(h)
開發者ID:pankdm,項目名稱:icfpc-2013,代碼行數:31,代碼來源:no_fold_plz_bonus1.py

示例3: map

# 需要導入模塊: from proxy import Proxy [as 別名]
# 或者: from proxy.Proxy import make_train [as 別名]
		if status == "error":
			print 'Error!, proceeding to another guess'
			h_gen.next()

		if status == "mismatch":
			x, y, my = map(from_hex, data["values"])
			xs.append(x)
			ys.append(y)
			h_current, delta = find_first_good2(h_gen, xs, ys)
			index += delta

if __name__ == "__main__":
	seed(0)
	Config.TRAINING = True
	p = proxy.make_train(15)
	solve2(p)
	
	exit()

	OPS = ["not", "and", "or", "xor", "shr1", "shr4", "shr16", "plus", "shl1", "if0"]
	OPS = ["and","if0","or","plus","shr16","shr4"]
	AR = tuple([randint(0, LAST) for i in xrange(1)])

	g = gen_tree_values(12, OPS, AR, tuple(map(f, AR)))
	print len(g[-1]), tuple(map(f, AR)) in g[-1]
	h = find_all_trees_with_values(g, AR, tuple(map(f, AR)), OPS)
	for a in h:
		print a.dump()#, map(lambda x: a.getx(x), AR)
	print len(h)
開發者ID:pankdm,項目名稱:icfpc-2013,代碼行數:31,代碼來源:no_fold_plz_smart_rush.py

示例4: map

# 需要導入模塊: from proxy import Proxy [as 別名]
# 或者: from proxy.Proxy import make_train [as 別名]
			h_gen.next()

		if status == "mismatch":
			x, y, my = map(from_hex, data["values"])
			xs.append(x)
			ys.append(y)
			h_current, delta = find_first_good2(h_gen, xs, ys)
			if h_current == None:
				print ":("
				return
			index += delta

if __name__ == "__main__":
	seed(0)
	Config.TRAINING = True
	p = proxy.make_train(137)
	solve2(p)
	
	exit()

	OPS = ["not", "and", "or", "xor", "shr1", "shr4", "shr16", "plus", "shl1", "if0"]
	OPS = ["and","if0","or","plus","shr16","shr4"]
	AR = tuple([randint(0, LAST) for i in xrange(1)])

	g = gen_tree_values(12, OPS, AR, tuple(map(f, AR)))
	print len(g[-1]), tuple(map(f, AR)) in g[-1]
	h = find_all_trees_with_values(g, AR, tuple(map(f, AR)), OPS)
	for a in h:
		print a.dump()#, map(lambda x: a.getx(x), AR)
	print len(h)
開發者ID:pankdm,項目名稱:icfpc-2013,代碼行數:32,代碼來源:no_fold_plz.py


注:本文中的proxy.Proxy.make_train方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。