Closed leroycorentin closed 1 month ago
Now all canopy classes inherit from
BaseCanopyParameters
, and all grapevine canopy classes inherit fromBaseGrapeVineParameters
.
This allowed to remove duplicate code for the canopy type classes, but there is still some redundancy. I think maybe something like a decorator pattern could be used to improve this in the future.
Merged in Helios v1.3.20. Thank you for your contribution!
Hey @bnbailey-psl I don't understand why but the sample projects (_treeorchard and vineyard) I added are not there. I can see the new files in the changes summary of commit 9601e54 on master, but I can't see their content, and they don't seem to have actually been created. This is weird because on my branch they are present, as we can see in this PR. Was there a problem while merging the PR in v1.3.20?
Hey @leroycorentin , apologies for the confusion. I changed the names of these samples slightly so that it was more explicit which plugins they correspond to. They are weberpenntree_orchard
and canopygenerator_vineyard
. I should have been more explicit on the name change in the CHANGELOG. Hopefully other than that they merged correctly?
Oh right sorry, I don't know how I missed that. Thanks!
This pull request allows to easily build configurable and realistic tree orchards and vineyards. It contains the following changes:
BaseCanopyParameters
, and all grapevine canopy classes inherit fromBaseGrapeVineParameters
. On top of that, parameters read from an XML file are stored so that canopies or individual plants can be built later on. This allows client code to have no knowledge at all about the types of canopies or plants that can be built; this information is exclusively written in the configuration file.Note that existing client code does not need to be altered in any way because of these changes. They only affect the inner Helios code of WeberPennTree and CanopyGenerator plugins.
For the CanopyGenerator plugin I mainly added features for the grapevine canopies because they are what I am interested in building, and it is quite tedious to reflect the changes for all canopy types. If you think these features (such as dead plant probability or spread parameters) are useful, maybe you can make the changes to implement them for other canopy types as well.
I have not changed the documentation to reflect these changes yet, because if I run doxygen, it makes changes pretty much everywhere, mainly because I have a more up-to-date version. If you accept these changes I can add some information in the documentation and downgrade doxygen to avoid having many changes in all documentation files.
I tried to accommodate to the existing syntax in the files I changed. However in the sample projects I added, I used tabulation indents (mainly because I am used to it and space indentation is very painful to my eyes). I can change it to spaces for consistency if you want.
I also wrote my commit messages with the format I am used to, but let me know if you want me to change them so it complies with your own rules.
Thank you for making such a great Open Source project. I hope my contributions can help people using Helios.