Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SimAquaLife
GR3D
Commits
0f52a527
Commit
0f52a527
authored
Apr 14, 2021
by
patrick.lambert
Browse files
with a package dedicated to temperature effect
parent
c697a18b
Changes
5
Show whitespace changes
Inline
Side-by-side
src/main/java/species/SurviveAfterReproduction.java
View file @
0f52a527
...
...
@@ -18,6 +18,8 @@ import fr.cemagref.simaqualife.kernel.util.TransientParameters.InitTransientPara
import
fr.cemagref.simaqualife.pilot.Pilot
;
import
miscellaneous.BinomialForSuperIndividualGen
;
import
species.DiadromousFish.SpawnerOrigin
;
import
temperatureEffect.Rosso
;
import
temperatureEffect.TemperatureEffect
;
import
umontreal.iro.lecuyer.probdist.NormalDist
;
import
umontreal.iro.lecuyer.randvar.NormalGen
;
...
...
@@ -29,6 +31,8 @@ public class SurviveAfterReproduction extends AquaNismsGroupProcess<DiadromousFi
private
double
survivalRateAfterReproduction
=
0.1
;
private
TemperatureEffect
temperatureEffect
;
private
transient
NormalGen
genNormal
;
/**
...
...
@@ -39,7 +43,9 @@ public class SurviveAfterReproduction extends AquaNismsGroupProcess<DiadromousFi
private
transient
BinomialForSuperIndividualGen
aleaGen
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
((
new
XStream
(
new
DomDriver
())).
toXML
(
new
SurviveAfterReproduction
()));
SurviveAfterReproduction
surviveAfterReproduction
=
new
SurviveAfterReproduction
();
surviveAfterReproduction
.
temperatureEffect
=
new
Rosso
(
0
.,
15
.,
22
.);
System
.
out
.
println
((
new
XStream
(
new
DomDriver
())).
toXML
(
surviveAfterReproduction
));
}
...
...
src/main/java/temperatureEffect/RectangularTemperatureEffect.java
0 → 100644
View file @
0f52a527
/**
* patrick
* @author Patrick Lambert
* @copyright Copyright (c) 2020, INRAE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package
temperatureEffect
;
/**
*
*/
public
class
RectangularTemperatureEffect
implements
TemperatureEffect
{
/**
*
* @unit
*/
private
static
final
long
serialVersionUID
=
-
611999636717694259L
;
/**
* minimal temperature . Below this value, the temperature effect is 0
*
* @unit °C
*/
private
double
Tmin
;
/**
* maximal temperature. Above this value, the temperature effect is 0
*
* @unit °C
*/
private
double
Tmax
;
@Override
public
double
getTemperatureEffect
(
double
temperature
)
{
if
(
temperature
<=
Tmin
||
temperature
>=
Tmax
)
{
return
0
;
}
else
{
return
1
;
}
}
public
RectangularTemperatureEffect
(
double
tmin
,
double
tmax
)
{
super
();
this
.
Tmin
=
tmin
;
this
.
Tmax
=
tmax
;
}
}
src/main/java/temperatureEffect/Rosso.java
0 → 100644
View file @
0f52a527
/**
* patrick
* @author Patrick Lambert
* @copyright Copyright (c) 2020, INRAE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package
temperatureEffect
;
/**
*
*/
public
class
Rosso
implements
TemperatureEffect
{
/**
*
* @unit
*/
private
static
final
long
serialVersionUID
=
-
2646246167644233819L
;
/**
* minimal temperature . Below this value, the temperature effect is 0
*
* @unit °C
*/
private
double
Tmin
;
/**
* optimal temperature. At this value, the temperature effect is 1
*
* @unit °C
*/
private
double
Topt
;
/**
* maximal temperature. Above this value, the temperature effect is 0
*
* @unit °C
*/
private
double
Tmax
;
@Override
public
double
getTemperatureEffect
(
double
temperature
)
{
if
(
temperature
<=
Tmin
||
temperature
>=
Tmax
)
{
return
0
;
}
else
{
return
(
temperature
-
Tmin
)
*
(
temperature
-
Tmax
)
/
((
temperature
-
Tmin
)
*
(
temperature
-
Tmax
)
-
((
temperature
-
Topt
)
*
(
temperature
-
Topt
)));
}
}
public
Rosso
(
double
tmin
,
double
topt
,
double
tmax
)
{
super
();
this
.
Tmin
=
tmin
;
this
.
Topt
=
topt
;
this
.
Tmax
=
tmax
;
}
}
src/main/java/temperatureEffect/TemperatureEffect.java
0 → 100644
View file @
0f52a527
/**
* patrick
* @author Patrick Lambert
* @copyright Copyright (c) 2020, INRAE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package
temperatureEffect
;
import
java.io.Serializable
;
/**
*
*/
public
interface
TemperatureEffect
extends
Serializable
{
public
double
getTemperatureEffect
(
double
temperature
);
}
src/main/java/temperatureEffect/package-info.java
0 → 100644
View file @
0f52a527
/**
* patrick
* @author Patrick Lambert
* @copyright Copyright (c) 2020, INRAE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*
*/
package
temperatureEffect
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment