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