USC-NSL / Computational-Agroecology

6 stars 1 forks source link

Add usage of kd-tree inside the plant class #90

Closed tszxxx closed 5 years ago

tszxxx commented 5 years ago

for that the class plant is an abstract class, so it can not be inserted into a vector, so we can not build kd-tree on it.

ralphchung commented 5 years ago

Since it is an abstract class, we could instead insert them into a vector<shared_ptr<Plant>>. Then, we have to define our own comparator. I think that could solve your problem.