discrete allocation
- Details
- Last Updated on Saturday, 13 April 2013 09:46
click here for more information on discrete land use allocation
container allocation
{
unit<fpoint> TestCoords: Range = "[{300000, 0}, {625000, 280000})";
unit<spoint> DomainGrid:
expr = "range(gridset(TestCoords, "
"point(float32( -500.0), float32(500.0), TestCoords), "
"point(float32(625000.0), float32(10000.0), TestCoords), "
"SPoint), "
"point(int16(0), int16(0)),"
"point(int16(6), int16(6)))",
DialogType = "Map";
container source
{
unit<int32> EurM2: Range = "[0, 20)";
unit <uint8> lu_type: nrofrows = 3
{
attribute<string> Name: ['Living', 'Working', 'Nature'];
attribute<string> PartioningName: ['Living', 'Working', 'Nature'];
attribute<lu_type> partioning: expr = "id(lu_type)";
}
attribute<lu_type> landuse (DomainGrid):
[
2, 2, 2, 1, null, null,
2, 2, 0, 0, null, 1,
2, 0, 0, 1, 1, 1,
2, 0, 0, 0, 1, 1,
2, 0, 0, 1, null, 1,
2, 2, 2, 2, 2, 2
];
container SuitabilityMaps
{
attribute<EurM2> Living (DomainGrid):
[
1, 2, 5, 4, 3, -1,
2, 5, 8, 9, 7, 3,
4, 10, 12,13, 12, 6,
5, 11, 13,14, 12, 6,
4, 9, 9, 5, 3, 2,
2, 2, 4, 3, 1, 1
];
attribute<EurM2> Working (DomainGrid):
[
1, 1, 2, 3, 4, -6,
2, 3, 4, 6, 8, 9,
2, 4, 9,11, 12, 10,
1, 3, 5, 9, 10, 6,
2, 4, 5, 5, 3, 2,
1, 1, 2, 1, 1, 1
];
attribute<EurM2> Nature (DomainGrid):
[
3, 3, 3, 2, 2, -2,
3, 3, 2, 2, 2, 2,
3, 2, 1, 1, 1, 1,
3, 2, 1, 1 ,1, 2,
3, 3, 2, 1, 2, 2,
3, 3, 3, 3, 3, 3
];
}
container regMaps
{
unit<uint8> p1: nrofrows = 1;
unit<uint8> p2: nrofrows = 2;
attribute<p1> p1Map (DomainGrid): expr = "const(0, DomainGrid, p1)";
attribute<p2> p2Map (DomainGrid):
expr = "pointRow(id(DomainGrid)) < int16(4)
"? value(0, p2) : value(1, p2)";
}
container claim_sources
{
unit<float32> Meter: expr = "BaseUnit('m', float32)";
unit<float32> Ha: expr = "10000.0 * Meter * Meter";
container p1
{
attribute<Ha> Nature_min (regMaps/p1): [12];
attribute<Ha> Nature_max (regMaps/p1): [20];
attribute<Ha> Living_min (regMaps/p1): [5];
attribute<Ha> Living_max (regMaps/p1): [9];
}
container p2
{
attribute<Ha> Working_min (regMaps/p2): [6,2];
attribute<Ha> Working_max (regMaps/p2): [10,4];
}
}
parameter<float32> nrHaPerCel: expr = "value(1, claim_sources/Ha)";
container claims_min
{
attribute<uint32> Living (regionMaps/p1):
expr = "uint32(claim_sources/p1/Living_min / nrHaPerCel)";
attribute<uint32> Working(regionMaps/p2):
expr = "uint32(claim_sources/p2/Working_min / nrHaPerCel)";
attribute<uint32> Nature (regionMaps/p1):
expr = "uint32(claim_sources/p1/Nature_min / nrHaPerCel)";
}
container claims_max
{
attribute<uint32> Living (regionMaps/p1):
expr = "uint32(claim_sources/p1/Living_max / nrHaPerCel)";
attribute<uint32> Working(regionMaps/p2):
expr = "uint32(claim_sources/p2/Working_max / nrHaPerCel)";
attribute<uint32> Nature (regionMaps/p1):
expr = "uint32(claim_sources/p1/Nature_max / nrHaPerCel)";
}
container regionSets
{
attribute<regMaps/p1> Nature (DomainGrid): expr = "regMaps/p1Map";
attribute<regMaps/p1> Living (DomainGrid): expr = "regMaps/p1Map";
attribute<regMaps/p2> Working(DomainGrid): expr = "regMaps/p2Map";
}
unit<uint16> AtomicRegions:
expr = "overlay(lu_type/PartioningName, DomainGrid, regionSets)";
attribute<Bool> InRegio (DomainGrid):
[
True, True, True, True, False, True,
True, True, True, True, False, True,
True, True, True, True, True, True,
True, True, True, True, True, True,
True, True, True, True, False, True,
True, True, True, True, True, True
];
attribute<Bool> FreeLand (DomainGrid): expr = "InRegio";
container Compacted
{
unit <uint32> ADomain:
expr = "Subset(FreeLand = True)",
label = "allocation domain";
attribute<ADomain> BaseGrid (DomainGrid):
expr = "invert(ADomain/nr_OrgEntity)";
container SuitabilityMaps
{
attribute<EurM2> Living (ADomain):
expr = "source/SuitabilityMaps/Living[ADomain/nr_orgEntity]";
attribute<EurM2> Working (ADomain):
expr = "source/SuitabilityMaps/Working[ADomain/nr_orgEntity]";
attribute<EurM2> Nature (ADomain):
expr = "source/SuitabilityMaps/Nature[ADomain/nr_orgEntity]";
}
attribute<AtomicRegions> AtomicRegionMap (ADomain):
expr = "AtomicRegions/UnionData[ADomain/nr_orgEntity]";
}
parameter<EurM2> treshold: expr = "value(0, EurM2)";
container FeasibleSolution;
}
container allocate_discrete:
expr = "discrete_alloc("
" source/lu_type/name,"
" source/Compacted/ADomain,"
" source/Compacted/SuitabilityMaps,"
" source/lu_type/partioning,"
" source/lu_type/PartioningName,"
" source/AtomicRegions,"
" source/Compacted/AtomicRegionsMap,"
" source/claims_min,"
" source/claims_max,"
" source/treshold,"
" source/FeasibleSolution"
")"
{
attribute<Source/lu_type> att (GridDomain):
expr = "landuse[Source/Compacted/BaseGrid]";
}
}
| att | ||||||
| 2 | 2 | 2 | 1 | null | null | |
| 2 | 2 | 0 | 0 | null | 1 | |
| 2 | 0 | 0 | 1 | 1 | 1 | |
| 2 | 0 | 0 | 0 | 1 | 1 | |
| 2 | 0 | 0 | 1 | null | 1 | |
| 2 | 2 | 2 | 2 | 2 | 2 | |