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
f3d058ba
Commit
f3d058ba
authored
3 years ago
by
Peter Alexander
Browse files
Options
Downloads
Patches
Plain Diff
Changes to try to allow start timestep other than 0
parent
0ad2fbd3
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/Timestep.java
+6
-2
6 additions, 2 deletions
src/ac/ed/lurg/Timestep.java
src/ac/ed/lurg/country/CountryAgent.java
+1
-1
1 addition, 1 deletion
src/ac/ed/lurg/country/CountryAgent.java
with
7 additions
and
3 deletions
src/ac/ed/lurg/Timestep.java
+
6
−
2
View file @
f3d058ba
...
@@ -19,13 +19,17 @@ public class Timestep implements Serializable {
...
@@ -19,13 +19,17 @@ public class Timestep implements Serializable {
return
timestep
;
return
timestep
;
}
}
private
static
int
getYear
(
int
tstep
)
{
return
ModelConfig
.
TIMESTEP_SIZE
*
tstep
+
ModelConfig
.
BASE_YEAR
;
}
public
int
getYear
()
{
public
int
getYear
()
{
return
ModelConfig
.
TIMESTEP_SIZE
*
(
timestep
-
ModelConfig
.
START_TIMESTEP
)
+
ModelConfig
.
BASE_YEAR
;
return
getYear
(
timestep
)
;
}
}
public
int
getYieldYear
()
{
public
int
getYieldYear
()
{
if
(
isInitialTimestep
())
{
if
(
isInitialTimestep
())
{
return
ModelConfig
.
BASE_YEAR
;
return
getYear
(
ModelConfig
.
START_TIMESTEP
)
;
}
}
else
{
else
{
return
getPreviousTimestep
().
getYear
();
return
getPreviousTimestep
().
getYear
();
...
...
This diff is collapsed.
Click to expand it.
src/ac/ed/lurg/country/CountryAgent.java
+
1
−
1
View file @
f3d058ba
...
@@ -167,7 +167,7 @@ public class CountryAgent extends AbstractCountryAgent {
...
@@ -167,7 +167,7 @@ public class CountryAgent extends AbstractCountryAgent {
private
GamsRasterInput
getGamsRasterInput
(
RasterSet
<
IrrigationItem
>
irrigData
,
YieldRaster
countryYieldSurfaces
)
{
private
GamsRasterInput
getGamsRasterInput
(
RasterSet
<
IrrigationItem
>
irrigData
,
YieldRaster
countryYieldSurfaces
)
{
double
allowedImportChange
;
double
allowedImportChange
;
if
(
currentTimestep
.
isInitialTimestep
()
||
(
ModelConfig
.
IS_CALIBRATION_RUN
&&
currentTimestep
.
getTimestep
()
<=
ModelConfig
.
END_FIRST_STAGE_CALIBRATION
)
)
{
// initialisation time-step
if
(
ModelConfig
.
IS_CALIBRATION_RUN
&&
currentTimestep
.
getTimestep
()
<=
ModelConfig
.
END_FIRST_STAGE_CALIBRATION
)
{
// initialisation time-step
allowedImportChange
=
0.0
;
allowedImportChange
=
0.0
;
}
}
else
{
// normal (not the initial) time-step
else
{
// normal (not the initial) time-step
...
...
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