Tag Info

New answers tagged


You have one quite elegant way to do it also which consists in providing your Bus class with a function in the constructor to retrieve the passengers: class World: def __init__(self): self.size = 10 self.n_busStops = 10 busStopMatrix = SpatialGraph(self.size, self.n_busStops, 1.0) self.buses = [Bus([0,1,2,3,4,5,6,7,8,9], owner = ...

Top 50 recent answers are included