An agent-based modelling approach to spatial economic theory