# File to print data filename = 'boardingData50Luggage500.txt' f = open(filename, 'w') for iSeatsPerSide in range(len(nSeatsPerSide)): for iRows in range(len(nRows)): timeForRandom = [] timeForBackToFront = [] timeForOutsideIn = [] timeForFlyingCarpet = [] # Random boarding for iIteration in range(nIterations): myAirplane1 = airplane.Airplane(nRows[iRows], nSeatsPerSide[iSeatsPerSide], 'random', nBlocks, fracFilled, fracLuggage) myAirplane1.board() timeForRandom.append(myAirplane1.tBoarding) # Back to front boarding nBlocks = 2 for iIteration in range(nIterations): myAirplane2 = airplane.Airplane(nRows[iRows], nSeatsPerSide[iSeatsPerSide], 'backToFront', nBlocks, fracFilled, fracLuggage) myAirplane2.board() timeForBackToFront.append(myAirplane2.tBoarding) # Outside in boarding
# File to print data filename = 'boardingData3Blocks.txt' #f = open(filename,'w') times = open('waitingTimes.txt', 'w') boardingID = 0 for iSeatsPerSide in range(len(nSeatsPerSide)): for iRows in range(len(nRows)): nBlocks = 2 # Random boarding for iIteration in range(nIterations): myAirplane = airplane.Airplane(nRows[iRows], nSeatsPerSide[iSeatsPerSide], 'random', nBlocks) myAirplane.board() # timeForRandom.append(myAirplane.reportWaitingTimes()) boardingID += 1 for waitTime in myAirplane.reportWaitingTimes(): times.write("%d, %.2f\n" % (boardingID, waitTime)) # Back to front boarding for iIteration in range(nIterations): myAirplane = airplane.Airplane(nRows[iRows], nSeatsPerSide[iSeatsPerSide], 'backToFront', nBlocks) myAirplane.board() boardingID += 1 for waitTime in myAirplane.reportWaitingTimes(): times.write("%d, %.2f\n" % (boardingID, waitTime))
filename = 'boardingDataBlocks500.txt' f = open(filename, 'w') for iBlocks in range(len(listBlocks)): for iSeatsPerSide in range(len(nSeatsPerSide)): for iRows in range(len(nRows)): timeForRandom = [] timeForBackToFront = [] timeForOutsideIn = [] timeForFlyingCarpet = [] # Random boarding for iIteration in range(nIterations): myAirplane = airplane.Airplane(nRows[iRows], nSeatsPerSide[iSeatsPerSide], 'random', listBlocks[iBlocks], fracFilled, fracLuggage) myAirplane.board() timeForRandom.append(myAirplane.tBoarding) # Back to front boarding for iIteration in range(nIterations): myAirplane = airplane.Airplane(nRows[iRows], nSeatsPerSide[iSeatsPerSide], 'backToFront', listBlocks[iBlocks], fracFilled, fracLuggage) myAirplane.board() timeForBackToFront.append(myAirplane.tBoarding) # Outside in boarding
def add_player(self): self.player_plane = airplane.Airplane('player', self) x = (self.__window[0] - self.player_plane.plane_rect[2]) / 2 y = self.__window[1] - self.player_plane.plane_rect[3] - 50 self.player_plane.plane_rect.move_ip(x, y) self.window.blit(self.player_plane.plane, (x, y))
def setEnd(num): global start, end appl.log(u'到着地:' + pref[num]) end = pref[num] if start == end: appl.log(u'出発地と到着を同じ場所に設定できません') if __name__ == '__main__': # UI関係モジュールをクラスとして生成し、applに入れる appl = appui.AppUI(pref, rank) # 輸送クラスの初期化した配列 trans = [ ship.Ship(appl), airplane.Airplane(appl), train.Train(appl), track.Track(appl) ] # sliderがスライドされた時に呼び出す関数を設定 appl.valueChanged('horizontalSlider', setVariablescost) appl.valueChanged('horizontalSlider_2', setVariablestime) appl.valueChanged('horizontalSlider_3', setVariablesenvload) # pushButtonが押されたときにdoCalc関数を呼び出すように設定 appl.setClickFunction('pushButton', doCalc) # pushButtonが押されたときにdoCache関数を呼び出すように設定 appl.setClickFunction('pushButton_3', doCache) # pushButtonが押されたときにdoRanking関数を呼び出すように設定 appl.setClickFunction('pushButton_2', doRanking) # テキストインプットに文字が入力された時に呼び出す関数を設定