Resource Optimization in Controlled Environment Agriculture