USC-NSL / Computational-Agroecology

6 stars 1 forks source link

Harvest Fruit #27

Closed fxdawnn closed 5 years ago

fxdawnn commented 5 years ago

Finish the Harvest fruit inside the action_adapter. Create a new vector(or whatever structure) to allow the config to track all the fruits being collected. And add a new component to keep track of fruit. (eg. create a new fruit class and let all the fruit(corn/bean/squash) to inheritance from it.)

hrastaar commented 5 years ago

Hey, added harvesting functions for plants in plant_type.h the functions for water and harvesting are used in action_adapter i also pushed a fruit.h that has the same functionality as in plant_type.h but think we are probably just going to keep the harvesting variables/functions in plant_type.h because all the plants are going to generally have something to harvest. let me know if you want another method!

fxdawnn commented 5 years ago

I think grow_plant will let plant_type to add an instance of fruit to an attribute(that allow plant_type to keep track of all fruits, e.g. a vector of pointers to all instance you created). And fruit is supposed to have attributes to keep track of fruit, e.g. weight, stage(ripen or not), status(poisoned by insect or not), still on the tree or fall to the ground.

fxdawnn commented 5 years ago

Also, plz add tests to all the functions.

fxdawnn commented 5 years ago

And Better make the fruit class extensible. Allow corn fruit to have cob, grains or kernel. Allow bean to have its own thing.

The class name fruit here is misleading. Figure out a good class name if possible in that specify whatever we get from the crop/plant.

hrastaar commented 5 years ago

ill work on it right now

hrastaar commented 5 years ago

added capabilities to plant_type.h to store fruits being produced by plants. fruit/produce data structure in produce.h

I created two pull requests, one for the tests, and one for the plant_type.h functions, in case you want me to add more capabilities than the basic produce / harvest