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
7845ba84
Commit
7845ba84
authored
Feb 17, 2021
by
patrick.lambert
Browse files
some test from Rougier et al
parent
7ed954df
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/miscellaneous/EasyABC.java
View file @
7845ba84
...
...
@@ -21,30 +21,37 @@ import fr.cemagref.simaqualife.pilot.Pilot;
public
class
EasyABC
{
public
static
void
runSimulation
(
String
[]
batchArgs
,
String
outputfilename
,
String
[]
paramNames
,
double
[]
paramValues
)
throws
Exception
{
try
{
Pilot
pilot
=
new
Pilot
();
BatchRunner
runner
=
new
BatchRunner
(
pilot
);
pilot
.
init
();
runner
.
parseArgs
(
batchArgs
,
false
,
true
,
false
);
pilot
.
load
();
ReflectUtils
.
setFieldValueFromPath
(
pilot
.
getAquaticWorld
().
getAquaNismsGroupsList
().
get
(
0
),
"processes.processesAtEnd.0.fileNameOutput"
,
outputfilename
);
for
(
int
i
=
0
;
i
<
paramNames
.
length
;
i
++)
{
ReflectUtils
.
setFieldValueFromPath
(
pilot
.
getAquaticWorld
().
getAquaNismsGroupsList
().
get
(
0
),
paramNames
[
i
],
paramValues
[
i
]);
}
pilot
.
run
();
// For forcing resources releasing (like shp files)
System
.
gc
();
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
e
.
printStackTrace
();
}
}
public
static
void
runSimulation
(
String
[]
batchArgs
,
String
outputfilename
,
String
[]
paramNames
,
double
[]
paramValues
)
throws
Exception
{
try
{
Pilot
pilot
=
new
Pilot
();
BatchRunner
runner
=
new
BatchRunner
(
pilot
);
pilot
.
init
();
runner
.
parseArgs
(
batchArgs
,
false
,
true
,
false
);
pilot
.
load
();
ReflectUtils
.
setFieldValueFromPath
(
pilot
.
getAquaticWorld
().
getAquaNismsGroupsList
().
get
(
0
),
"processes.processesAtEnd.0.fileNameOutput"
,
outputfilename
);
for
(
int
i
=
0
;
i
<
paramNames
.
length
;
i
++)
{
ReflectUtils
.
setFieldValueFromPath
(
pilot
.
getAquaticWorld
().
getAquaNismsGroupsList
().
get
(
0
),
paramNames
[
i
],
paramValues
[
i
]);
}
pilot
.
run
();
// For forcing resources releasing (like shp files)
System
.
gc
();
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
e
.
printStackTrace
();
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
runSimulation
(
"-simDuration 400 -simBegin 2 -timeStepDuration 1 -groups data/input/fishTryRealBV_CC.xml -env data/input/BNtryRealBasins.xml -observers data/input/obsTryReal.xml"
.
split
(
"\\ "
),
"data/output/tsointsoin"
,
new
String
[]{
"processes.processesEachStep.5.tempMinRep"
,
"processes.processesEachStep.4.tempMinMortGenInRiv"
,
"processes.processesEachStep.5.ratioS95_S50"
,
"processes.processesEachStep.3.pHomingAfterEquil"
},
new
double
[]{
10
,
8
,
2
,
0.7
});
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
runSimulation
(
"-simDuration 400 -simBegin 2 -timeStepDuration 1 -groups data/input/fishTryRealBV_CC.xml -env data/input/BNtryRealBasins.xml -observers data/input/obsTryRealABC.xml"
.
split
(
"\\ "
),
"data/output/tsointsoin"
,
new
String
[]
{
"processes.processesEachStep.5.tempMinRep"
,
"processes.processesEachStep.4.tempMinMortGenInRiv"
,
"processes.processesEachStep.5.ratioS95_S50"
,
"processes.processesEachStep.3.pHomingAfterEquil"
},
new
double
[]
{
10
,
8
,
2
,
0.7
});
}
}
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