Functional assessment of agricultural ecosystems