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

Seems to be working a bit better...

parent 0689de39
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ $gdxin ...@@ -60,7 +60,7 @@ $gdxin
fertI.L(crop, location) = 0.5; fertI.L(crop, location) = 0.5;
irrigI.L(crop, location) = 0.5; irrigI.L(crop, location) = 0.5;
otherIntensity.L(crop, location) = 0.5; otherIntensity.L(crop, location) = 1.0;
area.L(crop, location) = previousArea(crop, location) area.L(crop, location) = previousArea(crop, location)
EQUATIONS EQUATIONS
...@@ -82,8 +82,8 @@ $gdxin ...@@ -82,8 +82,8 @@ $gdxin
ENERGY_EQ total energy objective function; ENERGY_EQ total energy objective function;
UNIT_ENERGY_EQ(crop, location) .. unitEnergy(crop, location) =E= fertI(crop, location) + UNIT_ENERGY_EQ(crop, location) .. unitEnergy(crop, location) =E= fertI(crop, location) +
irrigI(crop, location)*irrigCost(location) + (1+irrigI(crop, location)*irrigCost(location) ** 1.3) +
power((1+otherIntensity(crop, location)), 2); (1+otherIntensity(crop, location) ** 2);
YIELD_EQ(crop, location) .. yield(crop, location) =E= ( YIELD_EQ(crop, location) .. yield(crop, location) =E= (
yieldNone(crop, location) + yieldNone(crop, location) +
......
...@@ -45,7 +45,7 @@ public class DemandManager { ...@@ -45,7 +45,7 @@ public class DemandManager {
double thisFudgeFactorShouldBeSomewhereElse; double thisFudgeFactorShouldBeSomewhereElse;
if (dc.getCropType().equals(CropType.MEAT_OR_PASTURE)) if (dc.getCropType().equals(CropType.MEAT_OR_PASTURE))
d *= 0.1; d *= 0.9;
demandMap.put(dc.getCropType(), d); demandMap.put(dc.getCropType(), d);
} }
......
...@@ -51,9 +51,10 @@ public class AreasItem implements RasterItem { ...@@ -51,9 +51,10 @@ public class AreasItem implements RasterItem {
public CropToDouble getCropChanges(AreasItem prevAreaAggItem) { public CropToDouble getCropChanges(AreasItem prevAreaAggItem) {
CropToDouble changes = new CropToDouble(); CropToDouble changes = new CropToDouble();
for (Entry<CropType, Double> entry : cropAreas.entrySet()) { for (Entry<CropType, Double> entry : prevAreaAggItem.cropAreas.entrySet()) {
double change = entry.getValue() - prevAreaAggItem.getCropArea(entry.getKey()); CropType crop = entry.getKey();
changes.put(entry.getKey(), change); double change = getCropArea(crop) - entry.getValue();
changes.put(crop, change);
} }
return changes; return changes;
......
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