Feature #1625

PFAF companionship algorithm

Added by Petteri Pitkänen over 1 year ago. Updated 6 months ago.

Start date:
Due date:
% Done:


Estimated time:
(Total: 0.00 h)

Next release


Task is to implement algorithm that is given a set of plants as input and that calculates a companionship score based on combined information from the PFAF database and our current companionship database. Score of 0 indicates that the input set is not mutually compatible. Positive score indicates the goodness of the input set.

Companionship score is calculated in two steps. First the mutual compatibility (boolean) of the input set is determined. Then, if the plants are compatible, the goodness (positive integer) of the input set is calculated.

score = compatibility * goodness

PFAF categories that are used for determining compatibility are hardiness zone, soil type, pH, moisture and shade. These values must partially match between all pairs of the input set. Also all pairs must be neutral or positive in our current companionship database.

Goodness is the sum of diversity and preference values. Diversity correlates with the amount of different plant features that the input set spans. Preference correlates with the presence of specific plant features. Each diversity and preference value is also associated with an importance factor.

goodness = diversity + preference
diversity = sum(diversity[i] * importance[i])
preference = sum(preference[i] * importance[i])

Each individual diversity value corresponds with a PFAF category. PFAF categories are treated as enum types. Individual diversity value is then the number of different enum values that the input set spans. This ensures that a diversity of edible uses (or medicinal uses, pollinators, physical dimensions, habits, etc.) is preferred over only single edible use.

The PFAF categories of edible rating and medicinal rating correspond to two preference values (calculated as sum of ratings of input plants). Another preference value is the number of positive pairs of the input set in our current companionship database.



Support #1716: Generate Q&A document for 'practical plants' companionship algorithmIn Progress

Related issues

Related to powerplant - Feature #1624: Publish Next ReleaseClosed2018-08-06


#1 Updated by Petteri Pitkänen over 1 year ago

#3 Updated by Petteri Pitkänen about 1 year ago

  • Status changed from Assigned to Done
  • % Done changed from 20 to 90

Closing. This has been completely moved to github and partly implemented.

#4 Updated by Franz Gatzke 6 months ago

  • Assignee deleted (Petteri Pitkänen)

#5 Updated by Franz Gatzke 6 months ago

  • Status changed from Done to In Progress
  • % Done changed from 90 to 30

#6 Updated by Franz Gatzke 6 months ago

  • Status changed from In Progress to Done
  • % Done changed from 30 to 90

Also available in: Atom PDF