def set_unyou(): tr.un1 = tr.UnyouClass(dp.goku.desc_cars()[0], 0, 20, 1) tr.un2 = tr.UnyouClass(dp.E03.desc_car(),0, 5, 2) tr.un3 = tr.UnyouClass(dp.T05A.desc_car(),dp.T05B.desc_car(), 5, 3) tr.un4 = tr.UnyouClass(dp.T26A.desc_car(),dp.T26B.desc_car(), 26, 4) tr.un5 = tr.UnyouClass(dp.goku.desc_cars()[2],dp.goku.desc_cars()[3], 10, 5) tr.un6 = tr.UnyouClass(dp.T21A.desc_car(),dp.T21B.desc_car(), 21, 6) tr.un7 = tr.UnyouClass(0, 0, 21, 6) tr.testrun = tr.UnyouClass(0, 0, 20, 6)
def input_unyou(): with open('save/unyo.json') as uload: noon = json.load(uload) tr.un1 = tr.UnyouClass(noon["[1]"][0], noon["[1]"][1], 0, 1) tr.un2 = tr.UnyouClass(noon["[2]"][0], noon["[2]"][1], 5, 2) tr.un3 = tr.UnyouClass(noon["[3]"][0], noon["[3]"][1], 10, 3) tr.un4 = tr.UnyouClass(noon["[4]"][0], noon["[4]"][1], 16, 4) tr.un5 = tr.UnyouClass(noon["[5]"][0], noon["[5]"][1], 21, 5) tr.un6 = tr.UnyouClass(noon["[6]"][0], noon["[6]"][1], 26, 6)
def input_unyou(stationid): with open('save/unyo.json') as uload: noon = json.load(uload) del tr.un1 del tr.un2 del tr.un3 del tr.un4 del tr.un5 del tr.un6 tr.un1 = tr.UnyouClass(noon["[1]"][0], noon["[1]"][1], 0, 1) tr.un2 = tr.UnyouClass(noon["[2]"][0], noon["[2]"][1], 26, 2) tr.un3 = tr.UnyouClass(noon["[3]"][0], noon["[3]"][1], 21, 3) tr.un4 = tr.UnyouClass(noon["[4]"][0], noon["[4]"][1], 16, 4) tr.un5 = tr.UnyouClass(noon["[5]"][0], noon["[5]"][1], 10, 5) tr.un6 = tr.UnyouClass(noon["[6]"][0], noon["[6]"][1], 5, 6) del dp.goku dp.goku = dp.templeClass(noon["goku"]) tr.un1.set_train(stationid) tr.un2.set_train(stationid) tr.un3.set_train(stationid) tr.un4.set_train(stationid) tr.un5.set_train(stationid) tr.un6.set_train(stationid)
def run_train(hour,min, stationid): if tc.timesig(5,43, hour, min) == True: del tr.un1 tr.un1 = tr.UnyouClass(dp.goku.pull_car(), 0, 20, 1) tr.un1.set_train(stationid) if tc.timesig(5,22, hour, min) == True: del tr.un2 tr.un2 = tr.UnyouClass(dp.E03.pull_car(),0, 5, 2) tr.un2.set_train(stationid) if tc.timesig(5,9, hour, min) == True: del tr.un3 tr.un3 = tr.UnyouClass(dp.T05A.pull_car(),dp.T05B.pull_car(), 5, 3) tr.un3.set_train(stationid) if tc.timesig(5,10, hour, min) == True: del tr.un4 tr.un4 = tr.UnyouClass(dp.T26A.pull_car(),dp.T26B.pull_car(), 26, 4) tr.un4.set_train(stationid) if tc.timesig(6,11, hour, min) == True: del tr.un5 tr.un5 = tr.UnyouClass(dp.goku.pull_car(),dp.goku.pull_car(), 10, 5) tr.un5.set_train(stationid) if tc.timesig(5,22, hour, min) == True: del tr.un6 tr.un6 = tr.UnyouClass(dp.T21A.pull_car(),dp.T21B.pull_car(), 21, 6) tr.un6.set_train(stationid) if tc.timesig(6, 00, hour, min) == True: tr.un1.add_cars(26, dp.E01.pull_car(), stationid) if tc.timesig(5, 55, hour, min) == True: tr.un2.add_cars(20,dp.goku.pull_car(), stationid) if tc.timesig(6, 18, hour, min) == True: tr.un4.add_cars(20,dp.goku.pull_car(), stationid) if tc.timesig(9, 7, hour, min) == True: dp.goku.push_cars(tr.un6.change_all_cars(20, dp.goku.pull_car(), stationid)) if tc.timesig(9, 24, hour, min) == True: tr.un6.add_cars(26, dp.E04B.pull_car(), stationid) if tc.timesig(17, 50, hour, min) == True: dp.goku.push_car(tr.un3.parge_cars(11, stationid)) if tc.timesig(18, 14, hour, min) == True: dp.goku.push_car(tr.un5.parge_cars(11, stationid)) if tc.timesig(19, 0, hour, min) == True: dp.E04B.push_car(tr.un6.parge_cars(26, stationid)) if tc.timesig(18, 38, hour, min) == True: dp.goku.push_car(tr.un1.parge_cars(11, stationid)) #32 1 33 2 34 3 35 4A 36 4B if tc.timesig(22,16, hour, min) == True: tr.un1.out_train(stationid,11,dp.goku,dp.goku) if tc.timesig(24,0, hour, min) == True: tr.un2.out_train(stationid,21,dp.T21A,dp.T21B) if tc.timesig(22,0, hour, min) == True: tr.un3.out_train(stationid,26,dp.E03,'') if tc.timesig(23,50, hour, min) == True: tr.un4.out_train(stationid,5,dp.T05A,dp.T05B) if tc.timesig(22,25, hour, min) == True: tr.un5.out_train(stationid,26,dp.E01,'') if tc.timesig(23,49, hour, min) == True: tr.un6.out_train(stationid,26,dp.T26A,dp.T26B) delete_depot() if tc.timesig(24,0, hour, min) == True: delete_depot() if tc.timesig(11, 00, hour, min) == True: # 1から6までの運用を出力する。 output_unyo() pass """
def locate_train(stationid, unyo_num, idno): stationid[int(idno)] = unyo_num return stationid """ un1= tr.UnyouClass(" 501","", 0, 1) #un1= tr.UnyouClass(" 501","2003", 0, 1) un2= tr.UnyouClass(" 10 ","1001", 5, 2) un3= tr.UnyouClass("2002","1502", 10, 3) un4= tr.UnyouClass("1101"," 22 ", 16, 4) un5= tr.UnyouClass(" 21 ","1501", 21, 5) un6= tr.UnyouClass("1002"," 305", 26, 6) """ if __name__ == '__main__': un1= tr.UnyouClass(1002, 22 , 0, 1) un2= tr.UnyouClass(2001,1201, 5, 2) un3= tr.UnyouClass( 10 ,1501, 10, 3) un4= tr.UnyouClass(2003,1502, 16, 4) un5= tr.UnyouClass( 501, 305, 21, 5) un6= tr.UnyouClass(1101,1001, 26, 6) stationid =[0 for i in range(42)] """ tr.UnyouClass.set_train(un1,stationid) tr.UnyouClass.set_train(un2,stationid) tr.UnyouClass.set_train(un3,stationid) tr.UnyouClass.set_train(un4,stationid) tr.UnyouClass.set_train(un5,stationid) tr.UnyouClass.set_train(un6,stationid) """
def run_train(hour, min, stationid): if tc.timesig(5, 43, hour, min) == True: del tr.un1 tr.un1 = tr.UnyouClass(dp.goku.pull_car(), 0, 20, 1) tr.un1.set_train(stationid) if tc.timesig(5, 22, hour, min) == True: del tr.un2 tr.un2 = tr.UnyouClass(dp.E03.pull_car(), 0, 5, 2) tr.un2.set_train(stationid) if tc.timesig(5, 9, hour, min) == True: del tr.un3 tr.un3 = tr.UnyouClass(dp.T05A.pull_car(), dp.T05B.pull_car(), 5, 3) tr.un3.set_train(stationid) if tc.timesig(5, 10, hour, min) == True: del tr.un4 tr.un4 = tr.UnyouClass(dp.T26A.pull_car(), dp.T26B.pull_car(), 26, 4) tr.un4.set_train(stationid) if tc.timesig(6, 11, hour, min) == True: del tr.un5 tr.un5 = tr.UnyouClass(dp.goku.pull_car(), 0, 10, 5) tr.un5.set_train(stationid) if tc.timesig(5, 22, hour, min) == True: del tr.un6 tr.un6 = tr.UnyouClass(dp.T21A.pull_car(), dp.T21B.pull_car(), 21, 6) tr.un6.set_train(stationid) if tc.timesig(6, 00, hour, min) == True: tr.un1.add_cars(26, dp.E01.pull_car(), stationid) if tc.timesig(8, 19, hour, min) == True: tr.un2.add_cars(20, dp.goku.pull_car(), stationid) if tc.timesig(8, 43, hour, min) == True: tr.un4.add_cars(20, dp.goku.pull_car(), stationid) if tc.timesig(6, 48, hour, min) == True: tr.un5.add_cars(26, dp.E04B.pull_car(), stationid) if tc.timesig(19, 2, hour, min) == True: dp.goku.push_car(tr.un3.parge_cars(11, stationid)) if tc.timesig(19, 12, hour, min) == True: dp.E04B.push_car(tr.un1.parge_cars(26, stationid)) #if tc.timesig(19, 2, hour, min) == True: # tr.un3.parge_cars(11, stationid) if tc.timesig(18, 14, hour, min) == True: dp.Gtemp.push_car(tr.un5.parge_cars(11, stationid)) #ここで切り離した車は後続6番に交換される if tc.timesig(18, 26, hour, min) == True: dp.goku.push_cars( tr.un6.change_all_cars(11, dp.Gtemp.pull_car(), stationid)) if tc.timesig(22, 16, hour, min) == True: tr.un1.out_train(stationid, 11, dp.goku, dp.goku) if tc.timesig(24, 0, hour, min) == True: tr.un2.out_train(stationid, 21, dp.T21A, dp.T21B) if tc.timesig(22, 0, hour, min) == True: tr.un3.out_train(stationid, 26, dp.E03, '') if tc.timesig(23, 50, hour, min) == True: tr.un4.out_train(stationid, 5, dp.T05A, dp.T05B) if tc.timesig(22, 25, hour, min) == True: tr.un5.out_train(stationid, 26, dp.E01, '') if tc.timesig(23, 49, hour, min) == True: tr.un6.out_train(stationid, 26, dp.T26A, dp.T26B) if tc.timesig(24, 0, hour, min) == True: delete_depot() if tc.timesig(11, 00, hour, min) == True: # 1から6までの運用を出力する。 input_unyou(stationid) pass """