本文整理汇总了Python中problem.Problem.type方法的典型用法代码示例。如果您正苦于以下问题:Python Problem.type方法的具体用法?Python Problem.type怎么用?Python Problem.type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类problem.Problem
的用法示例。
在下文中一共展示了Problem.type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_fake
# 需要导入模块: from problem import Problem [as 别名]
# 或者: from problem.Problem import type [as 别名]
def generate_fake(self, paper):
for i in range(3000):
model = Problem()
model.id = i
model.difficulty = random.random()
if i < 1001:
model.type = 1
model.score = paper.each_type_score[model.type-1] / \
paper.each_type_count[model.type-1]
if i > 1000 and i < 2001:
model.type = 2
model.score = paper.each_type_score[model.type-1] / \
paper.each_type_count[model.type-1]
if i > 2000 and i < 3001:
model.type = 3
model.score = paper.each_type_score[model.type-1] / \
paper.each_type_count[model.type-1]
points = []
# count = random.randint(1, 2)
count = 1
for j in range(count):
points.append(random.randint(1, 10))
model.points = points
self.problem_db.append(model)