Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time buffer for routes that don't start on time #9

Open
moshobo opened this issue Aug 7, 2024 · 1 comment
Open

Add time buffer for routes that don't start on time #9

moshobo opened this issue Aug 7, 2024 · 1 comment

Comments

@moshobo
Copy link
Owner

moshobo commented Aug 7, 2024

Problem

Currently, if there are no active routes at the start of the output GIF, the simulation will just start showing the first route available. For example, a train that leaves at 4:33pm and the simulation runs from 4:00-5:00pm. Instead of simulating 33 minutes of "buffer", the simulated train will depart at 4:00pm as the simulation starts

Solution

There should be some sort of "time buffer" so that a route only begins at the correct frame in the simulation

Workarounds

The current workaround is to add additional transit routes that are active before and through the start of the animation, but that isn't really a good solution...

@moshobo
Copy link
Owner Author

moshobo commented Aug 21, 2024

I think the issue is that this line of code only updates the lon/lat values if there are values for that time frame. There needs to be another bit of code that inserts an empty/None value if there is no transit vehicles to plot for any given time frame

for time in times:
    matching_rows = filtered_route_loc[filtered_route_loc['time'] == time]
    
    if not matching_rows.empty:
        lon_values = matching_rows['lon'].tolist()
        lat_values = matching_rows['lat'].tolist()

        x_trip.append(lon_values)
        y_trip.append(lat_values)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant