本文整理汇总了Python中dataset.Dataset.load_library方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.load_library方法的具体用法?Python Dataset.load_library怎么用?Python Dataset.load_library使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.load_library方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: next_solution
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import load_library [as 别名]
def next_solution(current,rotamer_num):
idx = 0
l = len(current)
while idx < l and current[idx] == rotamer_num[idx] - 1:
idx += 1
if idx == l:
return None
re = [0] * l
re[idx] = current[idx] + 1
for i in range(idx+1,l):
re[i] = current[i]
return re
data = Dataset("rotamerLibrary", "energyTable")
data.load_library()
data.lib.calc_energy.restype = c_float
current = [0] * data.residue_num
start = time.time()
solution = dict()
count = 0
while current:
nodes_c = (c_int * len(current))(*current)
e = data.lib.calc_energy(byref(nodes_c), data.residue_num,
byref(data.rotamer_num_c), byref(data.offset_c), byref(data.energy_c));
solution[e] = current
current = next_solution(current,data.rotamer_num)
count += 1
if count % 10000000 == 0:
print count