Beispiel #1
0
def AllPassengersAccommodated():
    #t = Train("Express One", 50, 100)
    #c1 = City("City 1",0,3,300)
    #j = Journey(t,[c1],200)
    #print(j.all_passengers_accommodated([5],[5])) # False #no passenger to be unloaded

    #t = Train("Express One", 50, 100)
    #c1 = City("City 1",0,3,300)
    #j = Journey(t,[c1],200)
    #print(j.all_passengers_accommodated([0],[100])) # False) #too many to load

    #t = Train("Express One", 50, 10)
    #c1 = City("City 1",0,3,300)
    #j = Journey(t,[c1],200)
    #print(j.all_passengers_accommodated([0],[30])) # ,True)

    t = Train("Express One", 50, 10)
    c1 = City("City 1", 0, 3, 300)
    c2 = City("City 2", 78, 300, 300)
    j = Journey(t, [c1, c2], 200)
    print(j.all_passengers_accommodated([0, 40], [30, 10]))  #,False)