The crime building sources are currently all constant sources (type PROPERTYSOURCE_CONSTANT). Law buildings are negative crime sources.Definately.
This should be easy based on the existing code for evaluating property values provided the code can fairly readily assess the sources and decays etc. to figure out what the tyrend value of the property is likely to be given a building change. I have not been keeping up with the details really ogf how crime has translated to property effects - can you post a summary of how it auto-decays, how it auto-generates (i.e. - non-building sources), and what its effects currently are (the property value assesment system we put in really assumed effects were via events, so just has the concept of an efective range and which is the bad end of it - if coupling to effects is more complex now that will need to be revisited).
Once I have a full summary I'll be in a better position to evaluate how hard it's going to be to add the necessary AI evaluation.
We definately will need this for v22.
CvPropertySourceConstant::getAmountPerTurn() returns the amount of the property, CvPropertySource::getProperty() the property type.
There is also a global crime source that adds crime per population each turn to each city (type PROPERTYSOURCE_ATTRIBUTE_CONSTANT). Currently set to 5 per population and turn.
The decay (type PROPERTYSOURCE_DECAY) currently decays 4% of crime (or law) each turn.
Crime diffuses from cities to surrounding plots with 5% each turn and from plot to plot with 4%.
There is also a diffusion to cities that a city has a trade route with (5%).
There are a number of pseudo buildings representing crimes that are auto built when the crime rating is in a certain range (and the prerequisites of the building are met).
So the cost of having a certain crime rating compared to another can be evaluated by the value of the buildings that are built/removed by the change.