Simulation of ecological, social and economic factors in agricultural systems