Skip to content
Snippets Groups Projects
Commit d565e7e8 authored by Peter Alexander's avatar Peter Alexander
Browse files

Potential fixes to energy crop issues with profit optimisation

parent d36cde23
No related branches found
No related tags found
No related merge requests found
......@@ -247,7 +247,10 @@ public class CountryAgent {
double changeDown = 0.0;
if (allowedImportChange > 0.0) {
double maxOfProdOrSupply = cropUsage.getProduction() + Math.max(baseTradeOrProd, 0);
double maxOfProdOrSupply = ModelConfig.ORIG_LEAST_COST_MIN ?
(cropUsage.getProduction() + Math.max(baseTradeOrProd, 0)) :
Math.max(cropUsage.getNetImports() + baseTradeOrProd, baseTradeOrProd);
changeDown = changeUp = allowedImportChange * maxOfProdOrSupply;
}
if (CropType.ENERGY_CROPS.equals(crop)) {
......@@ -257,7 +260,10 @@ public class CountryAgent {
baseTradeOrProd = 0.0;
ecMaxExport = 0.0;
}
changeDown = ecMaxExport;
if (ModelConfig.ORIG_LEAST_COST_MIN)
changeDown = ecMaxExport;
else
changeUp = ecMaxExport;
if (Double.isNaN(baseTradeOrProd))
baseTradeOrProd=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment