Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PLUM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Land Use Lab
PLUM
Commits
195e9d21
Commit
195e9d21
authored
7 years ago
by
Peter Alexander
Browse files
Options
Downloads
Patches
Plain Diff
Be able to use existing cluster files even for calibration
parent
a031e2f2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ac/ed/lurg/ModelConfig.java
+1
-0
1 addition, 0 deletions
src/ac/ed/lurg/ModelConfig.java
src/ac/ed/lurg/ModelMain.java
+8
-8
8 additions, 8 deletions
src/ac/ed/lurg/ModelMain.java
with
9 additions
and
8 deletions
src/ac/ed/lurg/ModelConfig.java
+
1
−
0
View file @
195e9d21
...
@@ -173,6 +173,7 @@ public class ModelConfig {
...
@@ -173,6 +173,7 @@ public class ModelConfig {
public
static
final
double
INITIAL_PRICE_SHIFT
=
getDoubleProperty
(
"INITIAL_PRICE_SHIFT"
,
1.0
);
public
static
final
double
INITIAL_PRICE_SHIFT
=
getDoubleProperty
(
"INITIAL_PRICE_SHIFT"
,
1.0
);
public
static
final
boolean
CHANGE_YIELD_DATA_YEAR
=
IS_CALIBRATION_RUN
?
false
:
getBooleanProperty
(
"CHANGE_YIELD_DATA_YEAR"
,
true
);
public
static
final
boolean
CHANGE_YIELD_DATA_YEAR
=
IS_CALIBRATION_RUN
?
false
:
getBooleanProperty
(
"CHANGE_YIELD_DATA_YEAR"
,
true
);
public
static
final
String
CLUSTERED_YIELD_FILE
=
getProperty
(
"CLUSTERED_YIELD_FILE"
,
OUTPUT_DIR
+
File
.
separator
+
"cluster.asc"
);
public
static
final
String
CLUSTERED_YIELD_FILE
=
getProperty
(
"CLUSTERED_YIELD_FILE"
,
OUTPUT_DIR
+
File
.
separator
+
"cluster.asc"
);
public
static
final
boolean
GENERATE_NEW_YIELD_CLUSTERS
=
getBooleanProperty
(
"GENERATE_NEW_YIELD_CLUSTERS"
,
IS_CALIBRATION_RUN
);
// Temporal configuration
// Temporal configuration
public
static
final
int
START_TIMESTEP
=
getIntProperty
(
"START_TIMESTEP"
,
0
);
public
static
final
int
START_TIMESTEP
=
getIntProperty
(
"START_TIMESTEP"
,
0
);
...
...
This diff is collapsed.
Click to expand it.
src/ac/ed/lurg/ModelMain.java
+
8
−
8
View file @
195e9d21
...
@@ -103,7 +103,7 @@ public class ModelMain {
...
@@ -103,7 +103,7 @@ public class ModelMain {
fpuManager
=
new
FPUManager
(
desiredProjection
);
fpuManager
=
new
FPUManager
(
desiredProjection
);
currentIrrigationData
=
getFixedIrrigationData
();
currentIrrigationData
=
getFixedIrrigationData
();
countryBoundaryRaster
=
getCountryBoundaryRaster
();
countryBoundaryRaster
=
getCountryBoundaryRaster
();
clusterIdRaster
=
(
ModelConfig
.
IS_CALIBRATION_RUN
)
?
new
RasterSet
<
IntegerRasterItem
>(
desiredProjection
)
:
getClusterRaster
();
clusterIdRaster
=
ModelConfig
.
GENERATE_NEW_YIELD_CLUSTERS
?
new
RasterSet
<
IntegerRasterItem
>(
desiredProjection
)
:
getClusterRaster
();
initLU
=
getInitialLandUse
();
initLU
=
getInitialLandUse
();
countryAgents
=
createCountryAgents
(
compositeCountryManager
.
getAll
());
countryAgents
=
createCountryAgents
(
compositeCountryManager
.
getAll
());
...
@@ -194,7 +194,7 @@ public class ModelMain {
...
@@ -194,7 +194,7 @@ public class ModelMain {
// if first timestep and calibration get the clustering info, which
// if first timestep and calibration get the clustering info, which
// doesn't change through time
// doesn't change through time
if
(
ModelConfig
.
IS_CALIBRATION_RUN
&&
timestep
.
isInitialTimestep
())
if
(
ModelConfig
.
GENERATE_NEW_YIELD_CLUSTERS
&&
timestep
.
isInitialTimestep
())
clusterIdRaster
.
putAll
(
ca
.
getYieldClusters
());
clusterIdRaster
.
putAll
(
ca
.
getYieldClusters
());
// Get values for world input costs
// Get values for world input costs
...
@@ -360,15 +360,15 @@ public class ModelMain {
...
@@ -360,15 +360,15 @@ public class ModelMain {
}
}
}
}
if
(
ModelConfig
.
IS_CALIBRATION_RUN
)
{
if
(
ModelConfig
.
IS_CALIBRATION_RUN
)
serializeLandUse
(
landUseRaster
);
serializeLandUse
(
landUseRaster
);
if
(
timestep
.
isInitialTimestep
())
if
(
timestep
.
isInitialTimestep
())
{
if
(
ModelConfig
.
GENERATE_NEW_YIELD_CLUSTERS
)
outputClusters
(
clusterIdRaster
);
outputClusters
(
clusterIdRaster
);
}
if
(
timestep
.
isInitialTimestep
())
outputWaterAvailablity
(
currentIrrigationData
);
outputWaterAvailablity
(
currentIrrigationData
);
}
// Output LandUses to tabular file, for analysis (perhaps)
// Output LandUses to tabular file, for analysis (perhaps)
LogWriter
.
println
(
"Outputing land uses Year: "
+
timestep
.
getYear
());
LogWriter
.
println
(
"Outputing land uses Year: "
+
timestep
.
getYear
());
...
@@ -450,7 +450,7 @@ public class ModelMain {
...
@@ -450,7 +450,7 @@ public class ModelMain {
LogWriter
.
printlnError
(
"No commodities data for "
+
cc
+
", so skipping"
);
LogWriter
.
printlnError
(
"No commodities data for "
+
cc
+
", so skipping"
);
}
else
{
}
else
{
RasterSet
<
LandUseItem
>
initCountryLandUse
=
initLU
.
createSubsetForKeys
(
keys
);
RasterSet
<
LandUseItem
>
initCountryLandUse
=
initLU
.
createSubsetForKeys
(
keys
);
RasterSet
<
IntegerRasterItem
>
yieldClusters
=
(
ModelConfig
.
IS_CALIBRATION_RUN
)
?
null
:
clusterIdRaster
.
createSubsetForKeys
(
keys
);
RasterSet
<
IntegerRasterItem
>
yieldClusters
=
ModelConfig
.
GENERATE_NEW_YIELD_CLUSTERS
?
null
:
clusterIdRaster
.
createSubsetForKeys
(
keys
);
if
(
initCountryLandUse
.
size
()
==
0
)
{
if
(
initCountryLandUse
.
size
()
==
0
)
{
LogWriter
.
printlnError
(
"No initial land use for "
+
cc
+
", so skipping"
);
LogWriter
.
printlnError
(
"No initial land use for "
+
cc
+
", so skipping"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment