Exploiting Artificial Intelligence and Optimization for Smart Agriculture