本文整理匯總了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]