Does the constant updating the dicts have any performance impact?
I added in some basic marriage, birth, and death stuff today. Parts of the code are a mess and there are a few bugs left to hunt down, but amazingly I did a test run of 40 years without any crashes. People married, had kids, died, and succession for the city governors went without a hitch. Of course, the figures don't actually do anything yet, but I got up to 1000 figures without any noticeable performance hit.
Even more amazingly, there were still merchants running around at the end of the 40 years. My earlier tests showed that they had stopping moving pretty quickly, which was a sign that nobody was buying the stuff that they were offering, or nobody was offering any stuff that they needed. This happened in the current test, but after a few years they started picking up and moving around again.
What's puzzling though is that by the end of the test, it seemed like every city almost exclusively had farmers as workers. A city who was a major copper exporter, for example, only had a single copper miner agent type, and about 40 farmers. While all cities should have a large farmer population, there should be a lot more miners and smiths for a town that exports copper.
Also, at the end of the test, one city had food prices of 37 gold, while another's was 2500 gold. There should be some differences in food prices from city to city, but 2500 gold is a lot in this simulation. So, although it appears as though some of the economy stuff is functioning, I'm going to have to revisit it in-depth at some point.