piero-la-lune / FSE-Planner

FSEconomy map vizualisation application
MIT License
41 stars 15 forks source link

Load jobs around airports with available planes #56

Closed ariefwt closed 2 years ago

ariefwt commented 3 years ago

I'd like to propose adding a way to load jobs from airports within a configurable distance/range from airports with available planes (the red-colored airports) — e.g., load jobs from 300 NM around red airports

This will be extremely helpful to find the best routes based red airports (i.e., airports that we can really fly from). Available planes may span across multiple countries or areas, which the current filters doesn't readily support (including a whole country also includes areas of a country that doesn't have available plane, custom area doesn't allow multiple selection)

Thank you for your consideration!

piero-la-lune commented 3 years ago

I can see why this would be interesting. I do see one issue thought: if the user select the Cessna 172 as a rentable plane, it would be the same as loading the entire world... For user/group owned planes, this seems reasonable, no so much for worldwide rentable planes. Not sure what would be the correct radius. 300 NM seems ok for passenger terminal jobs, but not VIP jobs. Obviously, users could choose the radius, but I am a bit afraid that they would set it to high, and basically download the entire world (which is not possible).

ariefwt commented 3 years ago

About the radius, my suggestion is to allow a user input to configure this to each's own liking (at least the way I foresee using it is by searching for airports within 2 hours of flight, which varies from plane to plane)

I agree that we don't need to do any kind of extra filtering for user/group owned planes, they should always be included, but there are many interesting rentable planes that isn't as abundant as C172/C208 (e.g., the ATRs)

With this in mind, how about something like this:

  1. For each user/group owned plane: find airports within the configured radius from the plane's airport and add them to the list
  2. Next, sort rentable planes by its dry/wet/bonus price (i.e., cheapest first)
  3. For each sorted rentable planes: 3.1. Find airports within the configured radius from the plane's airport 3.2. For each nearby airport: 3.2.1. Add it to the list 3.2.2. If the list reaches the limit of airports, break from the loop
  4. Finally, load jobs using the list

(I suggested prioritizing cheapest rentable planes first because it might not be appealing to rent at cutthroat prices, but there may be other better sorting methods)

In this case, there'll be two settings: the radius, and the limit of airports to download (in case the user doesn't mind the system to perform multiple API calls)

piero-la-lune commented 2 years ago

I have finally found some time to implement this, should be available in the next release!