The physical structure of farming societies: Interactions of settlement, resources, housing and demography in farming communities