Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Model_ROUGHAGENU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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_ROUGHAGENU
Commits
1815f8b4
Commit
1815f8b4
authored
1 year ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' into 'release'
Main See merge request
!2
parents
cd7e52ea
e31bc170
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2
Main
Pipeline
#2313
passed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
pom.xml
+1
-1
1 addition, 1 deletion
pom.xml
src/main/java/no/bioforsk/vips/model/roughagenutritionmodel/RoughageNutritionModelImpl.java
+29
-4
29 additions, 4 deletions
...el/roughagenutritionmodel/RoughageNutritionModelImpl.java
with
31 additions
and
5 deletions
README.md
+
1
−
0
View file @
1815f8b4
# Grovfôrmodellen
## Bruksområde
Modellen skal underveis i vekstsesongen gi støtte for valg av høstetid i to- og
treslåttsystem i eng som brukes til fôrproduksjon. Den er utvikla på grunnlag av
data fra timoteidominert eng, men kan også brukes på bestand dominert av fleirårig raigras.
...
...
This diff is collapsed.
Click to expand it.
pom.xml
+
1
−
1
View file @
1815f8b4
...
...
@@ -10,7 +10,7 @@
<groupId>
no.nibio.vips.model
</groupId>
<artifactId>
RoughageNutritionModel
</artifactId>
<version>
1.1.
2
</version>
<version>
1.1.
3-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<dependencies>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/no/bioforsk/vips/model/roughagenutritionmodel/RoughageNutritionModelImpl.java
+
29
−
4
View file @
1815f8b4
...
...
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
import
java.util.stream.Collectors
;
import
no.nibio.vips.entity.WeatherObservation
;
import
no.nibio.vips.model.ModelExcecutionException
;
import
no.nibio.vips.util.WeatherUtil
;
// Using Commons math and Nelder-Mead for parameter optimization
import
org.apache.commons.math.ConvergenceException
;
...
...
@@ -736,6 +737,24 @@ public class RoughageNutritionModelImpl implements CostFunction {
//System.out.println("m=" + m);
return
m
;
}
/**
* @return
* @throws ModelExcecutionException
*/
private
Date
getForsteApril
()
throws
ModelExcecutionException
{
// Calculating start and end date of weather data retrieval
// Start is April 1st
Calendar
cal
=
Calendar
.
getInstance
(
timeZone
);
cal
.
setTime
(
this
.
getVekstStart
());
cal
.
set
(
Calendar
.
MONTH
,
Calendar
.
APRIL
);
cal
.
set
(
Calendar
.
DATE
,
1
);
WeatherUtil
wUtil
=
new
WeatherUtil
();
return
wUtil
.
normalizeToExactDate
(
cal
.
getTime
(),
timeZone
);
}
/**
* Løper gjennom eksisterende klimadatasett og beregner utvikling
...
...
@@ -751,6 +770,7 @@ public class RoughageNutritionModelImpl implements CostFunction {
}
boolean
first
=
true
;
boolean
firstTemperaturSum
=
true
;
Date
forrigeDato
=
null
;
List
<
WeatherObservation
>
tempCopy
=
new
ArrayList
<>(
this
.
luftTemperaturVerdier
);
for
(
Iterator
<
WeatherObservation
>
tempI
=
tempCopy
.
iterator
();
tempI
.
hasNext
();)
{
...
...
@@ -758,10 +778,15 @@ public class RoughageNutritionModelImpl implements CostFunction {
temperatur
=
tempI
.
next
();
//Setter Ts1
if
(
first
)
{
this
.
AIBakgrunnsdataMatrise
.
setParamDoubleValueForDate
(
temperatur
.
getTimeMeasured
(),
AIDataMatrix
.
TS1
,
temperatur
.
getValue
());
}
else
{
this
.
AIBakgrunnsdataMatrise
.
setParamDoubleValueForDate
(
temperatur
.
getTimeMeasured
(),
AIDataMatrix
.
TS1
,
temperatur
.
getValue
()
+
this
.
AIBakgrunnsdataMatrise
.
getParamDoubleValueForDate
(
forrigeDato
,
AIDataMatrix
.
TS1
));
// At første april (og ikke f.eks. vekststart) er grense her, er pr. 2023-09 til vurdering av Anne Kjersti Bakken
if
(
temperatur
.
getTimeMeasured
().
compareTo
(
this
.
getForsteApril
())
>=
0
)
{
if
(
firstTemperaturSum
)
{
this
.
AIBakgrunnsdataMatrise
.
setParamDoubleValueForDate
(
temperatur
.
getTimeMeasured
(),
AIDataMatrix
.
TS1
,
temperatur
.
getValue
());
firstTemperaturSum
=
false
;
}
else
{
this
.
AIBakgrunnsdataMatrise
.
setParamDoubleValueForDate
(
temperatur
.
getTimeMeasured
(),
AIDataMatrix
.
TS1
,
temperatur
.
getValue
()
+
this
.
AIBakgrunnsdataMatrise
.
getParamDoubleValueForDate
(
forrigeDato
,
AIDataMatrix
.
TS1
));
}
}
// Beregner DVR
...
...
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