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
a7f77b00
Commit
a7f77b00
authored
Apr 21, 2021
by
patrick.lambert
Browse files
mobe getSimultationId from group to BainNetwork
parent
435d2e8f
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/main/java/analysis/ExportExchangeSBetweenCatchments.java
View file @
a7f77b00
...
...
@@ -159,8 +159,8 @@ public class ExportExchangeSBetweenCatchments extends AquaNismsGroupProcess<Diad
sep
=
","
;
try
{
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getSimulationId
()
+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"year"
+
sep
+
"migrationBasin"
+
sep
+
"natalBasin"
+
sep
+
"effective"
);
bW
.
write
(
"\n"
);
...
...
src/main/java/analysis/ExportLenghtAgeDistribution.java
View file @
a7f77b00
...
...
@@ -33,8 +33,8 @@ import environment.Time.Season;
import
fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess
;
import
fr.cemagref.simaqualife.pilot.Pilot
;
import
species.DiadromousFish
;
import
species.DiadromousFishGroup
;
import
species.DiadromousFish.Stage
;
import
species.DiadromousFishGroup
;
/**
*
...
...
@@ -46,35 +46,40 @@ public class ExportLenghtAgeDistribution extends AquaNismsGroupProcess<Diadromou
private
String
fileNameOutput
=
"lengthAgeDistribution"
;
private
transient
BufferedWriter
bW
;
private
transient
String
sep
=
";"
;
private
transient
String
sep
=
";"
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
((
new
XStream
(
new
DomDriver
()))
.
toXML
(
new
ExportLenghtAgeDistribution
()));
System
.
out
.
println
((
new
XStream
(
new
DomDriver
())).
toXML
(
new
ExportLenghtAgeDistribution
()));
}
/* (non-Javadoc)
* @see fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess#initTransientParameters(fr.cemagref.simaqualife.pilot.Pilot)
/*
* (non-Javadoc)
*
* @see
* fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess#initTransientParameters(fr.cemagref.simaqualife.
* pilot.Pilot)
*/
@Override
public
void
initTransientParameters
(
Pilot
pilot
)
{
super
.
initTransientParameters
(
pilot
);
sep
=
";"
;
sep
=
";"
;
}
@Override
public
void
doProcess
(
DiadromousFishGroup
group
)
{
if
(
bW
==
null
){
if
(
fileNameOutput
!=
null
){
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
if
(
bW
==
null
)
{
if
(
fileNameOutput
!=
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
try
{
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()+
fileNameOutput
+
group
.
getSimulationId
()+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
+
sep
+
"basin"
+
sep
+
"gender"
+
sep
+
"effective"
+
sep
+
"length"
+
sep
+
"age"
+
sep
+
"nbSpawn"
+
"\n"
);
bW
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
+
sep
+
"basin"
+
sep
+
"gender"
+
sep
+
"effective"
+
sep
+
"length"
+
sep
+
"age"
+
sep
+
"nbSpawn"
+
"\n"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
@@ -84,14 +89,15 @@ public class ExportLenghtAgeDistribution extends AquaNismsGroupProcess<Diadromou
try
{
Time
time
=
group
.
getEnvironment
().
getTime
();
if
(
time
.
getSeason
(
pilot
)
==
exportSeason
&
time
.
getYear
(
pilot
)
>
1900
)
{
if
(
time
.
getSeason
(
pilot
)
==
exportSeason
&
time
.
getYear
(
pilot
)
>
1900
)
{
for
(
RiverBasin
basin
:
group
.
getEnvironment
().
getRiverBasins
())
{
if
(
basin
.
getFishs
(
group
)
!=
null
)
{
for
(
DiadromousFish
fish
:
basin
.
getFishs
(
group
))
{
if
(
fish
.
getStage
()
==
Stage
.
MATURE
)
{
//System.out.println(fish.getAge() + " -> "+ fish.getLength() +" - "+fish.getNumberOfReproduction());
// System.out.println(fish.getAge() + " -> "+ fish.getLength() +" -
// "+fish.getNumberOfReproduction());
bW
.
write
(
pilot
.
getCurrentTime
()
+
sep
);
bW
.
write
(
time
.
getYear
(
pilot
)
+
sep
);
bW
.
write
(
time
.
getSeason
(
pilot
)
+
sep
);
...
...
@@ -99,18 +105,17 @@ public class ExportLenghtAgeDistribution extends AquaNismsGroupProcess<Diadromou
bW
.
write
(
fish
.
getGender
()
+
sep
);
bW
.
write
(
fish
.
getAmount
()
+
sep
);
bW
.
write
(
fish
.
getLength
()
+
sep
);
bW
.
write
(
fish
.
getAge
()+
sep
);
bW
.
write
(
fish
.
getNumberOfReproduction
()
+
"\n"
);
bW
.
write
(
fish
.
getAge
()
+
sep
);
bW
.
write
(
fish
.
getNumberOfReproduction
()
+
"\n"
);
}
}
}
}
}
if
(
group
.
getPilot
().
getCurrentTime
()==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
if
(
group
.
getPilot
().
getCurrentTime
()
==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
bW
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/java/analysis/ExportMeanRecruitment.java
View file @
a7f77b00
...
...
@@ -45,8 +45,8 @@ public class ExportMeanRecruitment extends AquaNismsGroupProcess<DiadromousFish,
if
(
fileNameOutput
!=
null
)
{
try
{
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getSimulationId
()
+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
);
...
...
src/main/java/analysis/ExportPopulationStatus.java
View file @
a7f77b00
...
...
@@ -50,8 +50,8 @@ public class ExportPopulationStatus extends AquaNismsGroupProcess<DiadromousFish
if
(
bWMortality
==
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNameMortality
).
getParentFile
().
mkdirs
();
bWMortality
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameMortality
+
group
.
getSimulationId
()
+
".csv"
)));
bWMortality
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameMortality
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bWMortality
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
);
...
...
@@ -66,8 +66,8 @@ public class ExportPopulationStatus extends AquaNismsGroupProcess<DiadromousFish
if
(
bWMortalityCrash
==
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNameMortalityCrash
).
getParentFile
().
mkdirs
();
bWMortalityCrash
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameMortalityCrash
+
group
.
getSimulationId
()
+
".csv"
)));
bWMortalityCrash
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameMortalityCrash
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bWMortalityCrash
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
);
...
...
@@ -82,8 +82,8 @@ public class ExportPopulationStatus extends AquaNismsGroupProcess<DiadromousFish
if
(
bWStockTrap
==
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNameStockTrap
).
getParentFile
().
mkdirs
();
bWStockTrap
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameStockTrap
+
group
.
getSimulationId
()
+
".csv"
)));
bWStockTrap
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameStockTrap
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bWStockTrap
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
);
...
...
@@ -98,8 +98,8 @@ public class ExportPopulationStatus extends AquaNismsGroupProcess<DiadromousFish
if
(
bwPopulationStatus
==
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNamePopulationStatus
).
getParentFile
().
mkdirs
();
bwPopulationStatus
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNamePopulationStatus
+
group
.
getSimulationId
()
+
".csv"
)));
bwPopulationStatus
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNamePopulationStatus
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bwPopulationStatus
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
);
...
...
src/main/java/analysis/ExportRecruitment.java
View file @
a7f77b00
...
...
@@ -43,8 +43,8 @@ public class ExportRecruitment extends AquaNismsGroupProcess<DiadromousFish, Dia
if
(
fileNameOutput
!=
null
)
{
try
{
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getSimulationId
()
+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
);
...
...
src/main/java/analysis/ExportSpeciesRange.java
View file @
a7f77b00
...
...
@@ -84,8 +84,8 @@ public class ExportSpeciesRange extends AquaNismsGroupProcess<DiadromousFish, Di
if
(
fileNameOutput
!=
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
try
{
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getSimulationId
()
+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
+
sep
+
"medianRange"
+
sep
+
"southRange"
+
sep
+
"northRange"
+
sep
+
"centileRange"
+
"\n"
);
...
...
src/main/java/analysis/TypeTrajectoryCV.java
View file @
a7f77b00
...
...
@@ -235,8 +235,8 @@ public class TypeTrajectoryCV extends AquaNismsGroupProcess<DiadromousFish, Diad
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
try
{
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getSimulationId
()
+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
int
nbBV
=
finalStatesNames
.
length
;
bW
.
write
(
"nom des bv"
);
...
...
src/main/java/analysis/WriteBiomassFluxes.java
View file @
a7f77b00
...
...
@@ -16,8 +16,8 @@ import environment.Time.Season;
import
fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess
;
import
fr.cemagref.simaqualife.pilot.Pilot
;
import
species.DiadromousFish
;
import
species.DiadromousFishGroup
;
import
species.DiadromousFish.Stage
;
import
species.DiadromousFishGroup
;
/**
*
...
...
@@ -31,7 +31,6 @@ public class WriteBiomassFluxes extends AquaNismsGroupProcess<DiadromousFish, Di
private
transient
BufferedWriter
bW
;
private
transient
String
sep
=
";"
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
((
new
XStream
(
new
DomDriver
())).
toXML
(
new
WriteBiomassFluxes
()));
}
...
...
@@ -58,8 +57,8 @@ public class WriteBiomassFluxes extends AquaNismsGroupProcess<DiadromousFish, Di
if
(
fileNameOutput
!=
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
try
{
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getSimulationId
()
+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"year"
+
sep
+
"migrationBasin"
);
// create the field of the column
for
(
String
birthBasinName
:
group
.
getEnvironment
().
getRiverBasinNames
())
{
...
...
src/main/java/analysis/WriteCurrentNutrientExportFluxes.java
View file @
a7f77b00
...
...
@@ -22,7 +22,6 @@ public class WriteCurrentNutrientExportFluxes extends AquaNismsGroupProcess<Diad
private
transient
BufferedWriter
bW
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
((
new
XStream
(
new
DomDriver
())).
toXML
(
new
WriteCurrentNutrientExportFluxes
()));
}
...
...
@@ -41,7 +40,7 @@ public class WriteCurrentNutrientExportFluxes extends AquaNismsGroupProcess<Diad
new
File
(
outputPath
+
fileName
).
getParentFile
().
mkdirs
();
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
outputPath
+
fileName
+
group
.
getSimulationId
()
+
".csv"
)));
new
FileWriter
(
new
File
(
outputPath
+
fileName
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"year"
+
sep
+
"nutrient"
+
sep
+
"originBasin"
+
sep
+
"value"
+
"\n"
);
}
...
...
@@ -64,8 +63,7 @@ public class WriteCurrentNutrientExportFluxes extends AquaNismsGroupProcess<Diad
}
// close the bW
if
(
group
.
getPilot
().
getCurrentTime
()
==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
{
if
(
group
.
getPilot
().
getCurrentTime
()
==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
{
bW
.
flush
();
bW
.
close
();
}
...
...
src/main/java/analysis/WriteCurrentNutrientImportFluxes.java
View file @
a7f77b00
...
...
@@ -22,7 +22,6 @@ public class WriteCurrentNutrientImportFluxes extends AquaNismsGroupProcess<Diad
private
transient
BufferedWriter
bW
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
((
new
XStream
(
new
DomDriver
())).
toXML
(
new
WriteCurrentNutrientImportFluxes
()));
...
...
@@ -43,7 +42,7 @@ public class WriteCurrentNutrientImportFluxes extends AquaNismsGroupProcess<Diad
new
File
(
outputPath
+
fileName
).
getParentFile
().
mkdirs
();
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
outputPath
+
fileName
+
group
.
getSimulationId
()
+
".csv"
)));
new
FileWriter
(
new
File
(
outputPath
+
fileName
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"year"
+
sep
+
"nutrient"
+
sep
+
"originBasin"
);
for
(
String
birthBasinName
:
group
.
getEnvironment
().
getRiverBasinNames
())
{
...
...
@@ -78,8 +77,7 @@ public class WriteCurrentNutrientImportFluxes extends AquaNismsGroupProcess<Diad
}
// close the bW
if
(
group
.
getPilot
().
getCurrentTime
()
==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
{
if
(
group
.
getPilot
().
getCurrentTime
()
==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
{
bW
.
flush
();
bW
.
close
();
}
...
...
src/main/java/analysis/WriteEffectiveAndBiomassExportFluxes.java
View file @
a7f77b00
...
...
@@ -4,7 +4,6 @@ import java.io.BufferedWriter;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Hashtable
;
import
java.util.List
;
import
java.util.ListIterator
;
...
...
@@ -18,8 +17,8 @@ import environment.Time;
import
environment.Time.Season
;
import
fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess
;
import
species.DiadromousFish
;
import
species.DiadromousFishGroup
;
import
species.DiadromousFish.Stage
;
import
species.DiadromousFishGroup
;
public
class
WriteEffectiveAndBiomassExportFluxes
extends
AquaNismsGroupProcess
<
DiadromousFish
,
DiadromousFishGroup
>
{
...
...
@@ -46,40 +45,40 @@ public class WriteEffectiveAndBiomassExportFluxes extends AquaNismsGroupProcess<
new
File
(
outputPath
+
fileName
).
getParentFile
().
mkdirs
();
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
outputPath
+
fileName
+
group
.
getSimulationId
()
+
".csv"
)));
new
FileWriter
(
new
File
(
outputPath
+
fileName
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"year"
+
sep
+
"originBasin"
+
sep
+
"abundance"
+
sep
+
"biomass"
+
"\n"
);
}
// write information for the current year
Map
<
String
,
Double
>
totalOutputFluxes
=
new
Hashtable
<
String
,
Double
>();
Map
<
String
,
Double
>
totalOutputFluxes
=
new
Hashtable
<
String
,
Double
>();
long
year
=
time
.
getYear
(
group
.
getPilot
());
if
(
year
>=
group
.
getMinYearToWrite
()
&
time
.
getSeason
(
group
.
getPilot
())
==
writeSeason
)
{
for
(
RiverBasin
basin
:
group
.
getEnvironment
().
getRiverBasins
()){
if
(
year
>=
group
.
getMinYearToWrite
()
&
time
.
getSeason
(
group
.
getPilot
())
==
writeSeason
)
{
for
(
RiverBasin
basin
:
group
.
getEnvironment
().
getRiverBasins
())
{
totalOutputFluxes
.
put
(
"biomass"
,
0
.);
//cr�ation de la biomasse
totalOutputFluxes
.
put
(
"biomass"
,
0
.);
//
cr�ation de la biomasse
totalOutputFluxes
.
put
(
"abundance"
,
0
.);
List
<
DiadromousFish
>
fishes
=
basin
.
getFishs
(
group
);
if
(
fishes
!=
null
)
{
if
(
fishes
!=
null
)
{
ListIterator
<
DiadromousFish
>
fishIterator
=
fishes
.
listIterator
();
// for (DiadromousFish fish : fishes) {
while
(
fishIterator
.
hasNext
())
{
DiadromousFish
fish
=
fishIterator
.
next
();
if
(
fish
.
getStage
()==
Stage
.
IMMATURE
)
{
if
(
fish
.
getStage
()
==
Stage
.
IMMATURE
)
{
double
abundanceExp
=
fish
.
getAmount
();
double
biomass
=
group
.
getNutrientRoutine
().
getWeight
(
fish
)
*
fish
.
getAmount
();
totalOutputFluxes
.
put
(
"biomass"
,
totalOutputFluxes
.
get
(
"biomass"
)
+
biomass
);
totalOutputFluxes
.
put
(
"abundance"
,
totalOutputFluxes
.
get
(
"abundance"
)
+
abundanceExp
);
}
double
biomass
=
group
.
getNutrientRoutine
().
getWeight
(
fish
)
*
fish
.
getAmount
();
totalOutputFluxes
.
put
(
"biomass"
,
totalOutputFluxes
.
get
(
"biomass"
)
+
biomass
);
totalOutputFluxes
.
put
(
"abundance"
,
totalOutputFluxes
.
get
(
"abundance"
)
+
abundanceExp
);
}
}
}
try
{
bW
.
write
(
time
.
getYear
(
group
.
getPilot
())
+
";"
+
basin
.
getName
()
+
";"
);
bW
.
write
(+
totalOutputFluxes
.
get
(
"abundance"
)
+
";"
+
totalOutputFluxes
.
get
(
"biomass"
));
bW
.
write
(
time
.
getYear
(
group
.
getPilot
())
+
";"
+
basin
.
getName
()
+
";"
);
bW
.
write
(+
totalOutputFluxes
.
get
(
"abundance"
)
+
";"
+
totalOutputFluxes
.
get
(
"biomass"
));
bW
.
write
(
"\n"
);
}
catch
(
IOException
e
)
{
...
...
@@ -89,8 +88,7 @@ public class WriteEffectiveAndBiomassExportFluxes extends AquaNismsGroupProcess<
}
// close the bW
if
(
group
.
getPilot
().
getCurrentTime
()
==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
{
if
(
group
.
getPilot
().
getCurrentTime
()
==
group
.
getPilot
().
getSimBegin
()
+
group
.
getPilot
().
getSimDuration
()
-
1
)
{
bW
.
flush
();
bW
.
close
();
}
...
...
src/main/java/analysis/WriteEffectiveAndBiomassImportFluxes.java
View file @
a7f77b00
...
...
@@ -35,8 +35,8 @@ import environment.Time.Season;
import
fr.cemagref.simaqualife.kernel.processes.AquaNismsGroupProcess
;
import
fr.cemagref.simaqualife.pilot.Pilot
;
import
species.DiadromousFish
;
import
species.DiadromousFishGroup
;
import
species.DiadromousFish.Stage
;
import
species.DiadromousFishGroup
;
/**
*
...
...
@@ -50,7 +50,6 @@ public class WriteEffectiveAndBiomassImportFluxes extends AquaNismsGroupProcess<
private
transient
BufferedWriter
bW
;
private
transient
String
sep
=
";"
;
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
((
new
XStream
(
new
DomDriver
())).
toXML
(
new
WriteEffectiveAndBiomassImportFluxes
()));
}
...
...
@@ -78,8 +77,8 @@ public class WriteEffectiveAndBiomassImportFluxes extends AquaNismsGroupProcess<
if
(
fileNameOutput
!=
null
)
{
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
).
getParentFile
().
mkdirs
();
try
{
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getSimulationId
()
+
".csv"
)));
bW
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
group
.
getOutputPath
()
+
fileNameOutput
+
group
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bW
.
write
(
"year"
+
sep
+
"type"
+
sep
+
"originBasin"
);
// create the field of the column
for
(
String
birthBasinName
:
group
.
getEnvironment
().
getRiverBasinNames
())
{
...
...
src/main/java/environment/BasinNetwork.java
View file @
a7f77b00
...
...
@@ -83,4 +83,19 @@ public abstract class BasinNetwork extends Environment<Basin, DiadromousFish> {
}
/**
*
* concat at RngSatusIndex, temperatureCatchmentFile
*
* @return simulation name
*/
public
String
getSimulationId
()
{
String
id
=
"_"
;
id
=
id
.
concat
(
Integer
.
toString
(
getPilot
().
getParameters
().
getRngStatusIndex
()));
String
temperatureFile
=
getTemperatureCatchmentFile
();
id
=
id
.
concat
(
"-"
).
concat
(
temperatureFile
);
return
id
;
}
}
src/main/java/species/DiadromousFishGroup.java
View file @
a7f77b00
...
...
@@ -435,8 +435,8 @@ public class DiadromousFishGroup extends AquaNismsGroup<DiadromousFish, RIOBasin
sep
=
";"
;
new
File
(
this
.
outputPath
+
fileNameFluxes
).
getParentFile
().
mkdirs
();
try
{
bWForFluxes
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
this
.
outputPath
+
fileNameFluxes
+
this
.
getSimulationId
()
+
".csv"
)));
bWForFluxes
=
new
BufferedWriter
(
new
FileWriter
(
new
File
(
this
.
outputPath
+
fileNameFluxes
+
this
.
getEnvironment
().
getSimulationId
()
+
".csv"
)));
bWForFluxes
.
write
(
"timestep"
+
sep
+
"year"
+
sep
+
"season"
+
sep
+
"basin"
+
sep
+
"abundance"
+
sep
+
"fluxType"
+
sep
+
"origin"
+
sep
+
"abundanceExp"
+
sep
+
"biomass"
);
...
...
@@ -627,24 +627,6 @@ public class DiadromousFishGroup extends AquaNismsGroup<DiadromousFish, RIOBasin
}
/**
*
* concat at RngSatusIndex, temperatureCatchmentFile
*
* @return simulation name
*/
public
String
getSimulationId
()
{
String
id
=
"_"
;
id
=
id
.
concat
(
Integer
.
toString
(
getPilot
().
getParameters
().
getRngStatusIndex
()));
String
temperatureFile
=
((
RIOBasinNetwork
)
getPilot
().
getAquaticWorld
().
getEnvironment
()).
getTemperatureCatchmentFile
();
id
=
id
.
concat
(
"-"
).
concat
(
temperatureFile
);
if
(
parameterSetLine
>
0
)
{
id
=
id
.
concat
(
"-"
).
concat
(
Integer
.
toString
(
parameterSetLine
));
}
return
id
;
}
public
boolean
isThereBasinToUpdate
()
{
return
basinsToUpdate
!=
null
;
}
...
...
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