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

Bed planner #54

Open
petteripitkanen opened this issue Jun 17, 2019 · 1 comment
Open

Bed planner #54

petteripitkanen opened this issue Jun 17, 2019 · 1 comment
Assignees
Labels

Comments

@petteripitkanen
Copy link
Collaborator

In previous git versions we had a bed planner where it was possible to select a crop for the bed from only those crops that were companion plants with all the other crops that were already in the bed. This worked well for the relatively small dataset that we had back then, but now that we've moved to using the practicalplants.org data with over 8000 crops, we also need to redesign the bed planner.

In the new bed planner there could be a search field where one could find crops by name, and it'd open a dropdown list of the crops that match a given string (if no characters are given it'd show all crops). From this list those crops that are incompatible (cannot be grown in the same environment) with the other crops that are already in the bed, would be filtered out, and the list would be ordered by how good companion a crop would be. Then the user could select additional filters to further limit the list to only those crops that have specific properties.

The filtering function should be independent from the UI and tested separately, it should also use the companionship algorithm in shared/companionship.js.

It turned out that the algorithm that was used in the previous bed planner has a serious performance problem, it doesn't scale at all to the size of the new dataset. The algorithm that's sketched here would have the time complexity NMK (plus sorting and filtering), where N is the number of crops (around 10000), M is the number of compatibility/goodness values (around 30), and K is the number of crops in the bed (around 5), so it should be usable, especially with some caching.

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

No branches or pull requests

1 participant