本文整理汇总了Python中Input.big_problem方法的典型用法代码示例。如果您正苦于以下问题:Python Input.big_problem方法的具体用法?Python Input.big_problem怎么用?Python Input.big_problem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input.big_problem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import Input [as 别名]
# 或者: from Input import big_problem [as 别名]
def run():
# jobs, qcs, ycs, yts = Input.small_problem()
jobs, qcs, ycs, yts = Input.big_problem()
#===========================================================================
# find job which satisfy cut's condition
#===========================================================================
cut = []
for qc in qcs:
is_first_loading_job_of_qc = True
for i, j_id in enumerate(qc.job_seq):
if j_id == qc.primary_j:
#===============================================================
# or if i == 0
# it means first job of qc.job_seq
#===============================================================
cut.append(j_id)
if jobs[j_id].type == 'loading':
#===============================================================
# all loading job will be in cut
# and discharging job before finding first loading job will be in cut
#===============================================================
if is_first_loading_job_of_qc:
for x in range(i + 1):
if qc.job_seq[x] == qc.primary_j: continue
#=======================================================
# discharging job will be in cut
#=======================================================
cut.append(qc.job_seq[x])
is_first_loading_job_of_qc = False
continue
#===============================================================
# after is_first_loading_job_of_qc = False
# all loading job will be into cut
#===============================================================
cut.append(j_id)
stack_for_cut = []
scheduled_jobs = [False for _ in jobs]
agreeable_yt_of_job = [[True for x in range(len(yts))] for _ in jobs]
# node is for data saving
init_node = Node(cut, scheduled_jobs, agreeable_yt_of_job, qcs, ycs, yts)
stack_for_cut.append(init_node)
print [(job.id, job.type)for job in jobs]