Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Model_DAYDEGREES
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
VIPS
Models
Java
Model_DAYDEGREES
Commits
9ae0a88a
Commit
9ae0a88a
authored
1 year ago
by
Brita Linnestad
Browse files
Options
Downloads
Patches
Plain Diff
Add BasisTemp to config file
parent
735cef0f
No related branches found
No related tags found
1 merge request
!2
Main
Pipeline
#3721
passed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/model/daydegreemodel/DayDegreeModel.java
+16
-16
16 additions, 16 deletions
...va/no/nibio/vips/model/daydegreemodel/DayDegreeModel.java
with
16 additions
and
16 deletions
src/main/java/no/nibio/vips/model/daydegreemodel/DayDegreeModel.java
+
16
−
16
View file @
9ae0a88a
...
...
@@ -52,18 +52,15 @@ import no.nibio.vips.util.WeatherUtil;
public
class
DayDegreeModel
implements
Model
{
private
ModelUtil
modelUtil
;
//
private
Double
dayDegreeBaseTemp;
private
Float
dayDegreeBaseTemp
;
private
List
<
WeatherObservation
>
TM
;
private
final
Double
dayDegreeBaseTemp
=
0.0
;
private
final
static
TimeZone
DEFAULT_TIME_ZONE
=
TimeZone
.
getTimeZone
(
"Europe/Oslo"
);
private
DataMatrix
dataMatrix
;
public
final
static
ModelId
MODEL_ID
=
new
ModelId
(
"DAYDEGREES"
);
public
DayDegreeModel
()
{
//super("");
this
.
modelUtil
=
new
ModelUtil
();
}
...
...
@@ -71,14 +68,14 @@ public class DayDegreeModel implements Model {
public
List
<
Result
>
getResult
()
throws
ModelExcecutionException
{
Collections
.
sort
(
this
.
TM
);
Double
dayDegreeSum
=
0.0
;
List
<
Result
>
results
=
new
ArrayList
<>();
Calendar
cal
=
Calendar
.
getInstance
(
this
.
DEFAULT_TIME_ZONE
);
DecimalFormat
dFormat
=
new
DecimalFormat
(
"###.##"
);
for
(
WeatherObservation
obs:
this
.
TM
)
{
...
...
@@ -86,7 +83,7 @@ public class DayDegreeModel implements Model {
{
dayDegreeSum
+=
obs
.
getValue
();
}
Result
result
=
new
ResultImpl
();
result
.
setValidTimeStart
(
obs
.
getTimeMeasured
());
result
.
setValue
(
this
.
getModelId
().
toString
(),
"DayDegreeSum"
,
dayDegreeSum
.
toString
());
...
...
@@ -105,12 +102,11 @@ public class DayDegreeModel implements Model {
@Override
public
String
getModelName
()
{
return
null
;
//this.getModelName(Model.DEFAULT_LANGUAGE);
return
null
;
}
@Override
public
String
getModelName
(
String
language
)
{
//return this.getText("name", language);
return
"Day Degree model"
;
}
...
...
@@ -148,27 +144,27 @@ public class DayDegreeModel implements Model {
@Override
public
String
getModelDescription
(
String
language
)
{
return
null
;
//this.modelUtil.getTextWithBase64EncodedImages(this.getText("description", language), this.getClass());
return
null
;
}
@Override
public
String
getWarningStatusInterpretation
()
{
return
null
;
//this.getWarningStatusInterpretation(Model.DEFAULT_LANGUAGE);
return
null
;
}
@Override
public
String
getWarningStatusInterpretation
(
String
language
)
{
return
null
;
//this.getText("statusInterpretation", language);
return
null
;
}
@Override
public
String
getModelUsage
()
{
return
null
;
//this.getModelUsage(Model.DEFAULT_LANGUAGE);
return
null
;
}
@Override
public
String
getModelUsage
(
String
language
)
{
return
null
;
//this.getText("usage", language);
return
null
;
}
@Override
...
...
@@ -181,6 +177,7 @@ public class DayDegreeModel implements Model {
"\t},\n"
+
"\t\"modelId\":\""
+
MODEL_ID
.
toString
()
+
"\",\n"
+
"\t\"configParameters\":{\n"
+
"\t\t\"basisTemp\":0,\n"
+
"\t\t\"observations\":[\n"
+
"\t\t{\n"
+
"\t\t\t\t\"timeMeasured\": \"2015-01-01T00:00:00+02:00\",\n"
+
...
...
@@ -193,8 +190,11 @@ public class DayDegreeModel implements Model {
@Override
public
void
setConfiguration
(
ModelConfiguration
config
)
throws
ConfigValidationException
{
// Initialize the weather data collections
this
.
TM
=
new
ArrayList
<>();
this
.
dayDegreeBaseTemp
=
Float
.
parseFloat
((
String
)
config
.
getConfigParameter
(
"basisTemp"
));
ObjectMapper
mapper
=
new
ObjectMapper
();
List
<
WeatherObservation
>
observations
=
this
.
modelUtil
.
extractWeatherObservationList
(
config
.
getConfigParameter
(
"observations"
));
...
...
@@ -216,7 +216,7 @@ public class DayDegreeModel implements Model {
{
this
.
TM
.
add
(
o
);
}
break
;
break
;
default
:
// TODO: Throw validation error?
break
;
...
...
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