In the original version of the model, settlements that do not have agriculture cells after 5 years are removed. This is an ad hoc asumption and inconsistent in a number of ways. If the product of agriculture can not be substituted by that from ecosystems or trade, there should be some impact on demographics before the death of the settlement. If agriculture can be substituted by using trade and ecosystem services however, killing settlements withou agriculture is nonsensical.
Therefore, I test the model without killing settlements without agriculture to see the difference.
In [1]:
%pylab inline
pylab.rcParams['figure.figsize'] = (14, 6)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
data = pd.read_pickle('/home/jakob/Project_MayaSim/Python/output_data/X1_default/results/mayasim_default_setup')
lvs = data.index.levels
cmap = mpl.cm.get_cmap('Spectral')
cls = cmap(np.linspace(0, 1, 2))
def plotlines(data, level, key, unstack):
fig = plt.figure()
ax1 = fig.add_subplot(111)
ln = data['<mean_trajectories>'].xs(level=level, key=key).unstack(unstack).plot(ax=ax1, color=cls)
lg = ln.get_legend()
bb = lg.get_bbox_to_anchor().inverse_transformed(ax1.transAxes)
xOffset = .3
bb.x0 += xOffset
bb.x1 += xOffset
lg.set_bbox_to_anchor(bb, transform = ax1.transAxes)
ax1.set_ylabel(key[0])
data.head()
Out[1]:
In [2]:
key=['total_population']
level=['observables']
unstack = ['kill_cropless']
plotlines(data, level, key, unstack)
key=['total_settlements']
level=['observables']
unstack = ['kill_cropless']
plotlines(data, level, key, unstack)
Killing of cities without crops obviously makes a huge difference. Leaving cities without crops alive leads to significantly less pronounced overshoot and collapse behavior in population and no collapse in number of settlements. Although I wonder, if settlements do propperly die from low population.
The different sources of income for both conditions are shown below:
In [7]:
fig = plt.figure()
ax1 = fig.add_subplot(121)
data['<mean_trajectories>'].xs(level='kill_cropless', key=False).unstack('observables')[['total_income_agriculture', 'total_income_ecosystem', 'total_income_trade']].plot.area(ax=ax1)
ax2 = fig.add_subplot(122)
data['<mean_trajectories>'].xs(level='kill_cropless', key=True).unstack('observables')[['total_income_agriculture', 'total_income_ecosystem', 'total_income_trade']].plot.area(ax=ax2)
ax1.set_ylim([0, 9000000])
ax2.set_ylim([0, 9000000])
Out[7]:
To compare the two conditions better, lets have a look at the different source of income separately:
In [4]:
key=['total_income_agriculture']
level=['observables']
unstack = ['kill_cropless']
plotlines(data, level, key, unstack)
key=['total_income_ecosystem']
level=['observables']
unstack = ['kill_cropless']
plotlines(data, level, key, unstack)
key=['total_income_trade']
level=['observables']
unstack = ['kill_cropless']
plotlines(data, level, key, unstack)
Curiously, the total output of agriculture is higher, if cities whithout agriculure die. For the other outputs, leaving settlements without agriculture alive increases the output.
Apparently, climate variability has big impact on Income from agriculture, little impact on income from ecosystems and no impact on income from trade. All of this leaves me wondering
In [5]:
key=['total_trade_links']
level=['observables']
unstack = ['kill_cropless']
plotlines(data, level, key, unstack)
So, apparently the net number of trade links does not decrease. A more indepth inquiry of this follows in Experiment 3
In [ ]: