So far as Tofof's concerns of the AI paying too much for resources... I've kind of noticed this. I wouldn't underestimate the use they may be able to get of the resource now and it's kind of a tradition that the AI will make 1 for 1 trades in CIV. I'm probably not going to change it but I may look at reducing the maximum amount they'll pay.
I think resource trades can (and should) be optimized, if the relevant variables are accessible. I don't know how it is done currently, but I would think a good functional form would be:
value = (base for map size) * (linear function for # of cities) ...
The number of cities should be an easily accessible variable since it is needed for calculating maintenance
... * (factor for type of resource) ...
maybe Health = 1.0 ; Luxury = 1.5 ; Strategic = 3.0
... * (factor for doubling era)
Health (Granary) = 1.5 ; Luxury (Forge) =1.5 ; Luxury (Market) = 1.3; Luxury (Grocer, Theater) = 1.20 (happy > health) ; Health (Seafood) = 1.1 ( < Granary because less cities can build Harbors)
So Corn > Crabs > Cows due to likelihood of a city gaining two Health from one resource; Silks > Sugar > Corn because Happiness is more of a limitation in city size/productivity than Health in most cases.
The largest problem with this type of formula is that the human will have a difficult time trading resources pre-Currency, and AIs could have a difficult time trading resources at all (Do I use the 15 gpt to increase the science slider 10%, or do I use it to execute 3 resource trades with my neighbors?). One by-product of this system could be establishment of trading blocks within the AIs, as it should be easier to trade multiple resources in a single trade than to trade single resources in multiple trades.