Optimizing a closed greenhouse