当前位置: 首页>>代码示例>>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;未经允许,请勿转载。