本文整理汇总了Python中Input.small_problem方法的典型用法代码示例。如果您正苦于以下问题:Python Input.small_problem方法的具体用法?Python Input.small_problem怎么用?Python Input.small_problem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input.small_problem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: duplicate
# 需要导入模块: import Input [as 别名]
# 或者: from Input import small_problem [as 别名]
self.yts = yts
def duplicate(self):
d_cut = self.cut[:]
d_scheduled_jobs = self.scheduled_jobs[:]
d_agreeable_yt_of_job = [x[:] for x in self.agreeable_yt_of_job]
d_qcs = [qc.duplicate() for qc in self.qcs]
d_ycs = [yc.duplicate() for yc in self.ycs]
d_yts = [yt.duplicate() for yt in self.yts]
return Node(d_cut, d_scheduled_jobs, d_agreeable_yt_of_job, d_qcs, d_ycs, d_yts)
if __name__ == '__main__':
'''
test code
'''
import Input
jobs, qcs, ycs, yts = Input.small_problem()
scheduled_jobs = [[] for _ in jobs]
not_agreeable_yt_of_job = [[] for _ in jobs]
cut = []
a = Node(cut, scheduled_jobs, not_agreeable_yt_of_job, qcs, ycs, yts)
print scheduled_jobs
'''
for test duplication
'''
a = QC(1,(1,2,5,23), 3)
b = a.duplicate()
print a.job_seq
print b.job_seq[0]