Commit 49a7a40a authored by patrick.lambert's avatar patrick.lambert
Browse files

test if there is no file for impot for initial observation

parent 4cb664c1
......@@ -201,9 +201,9 @@ public class DiadromousFishGroup extends AquaNismsGroup<DiadromousFish, RIOBasin
Map<String, Double> anExcretionRate = new Hashtable<String, Double>();
anExcretionRate.put("N", 24.71E-6 * 24); // values from Barber et al, Alosa sapidissima in ug/g wet mass/hour :
// convertit en g
// convertit en g
anExcretionRate.put("P", 2.17E-6 * 24); // values from Barber et al, Alosa sapidissima in ug/g wet mass/hour:
// convertit en g
// convertit en g
/*
* A feature pre spawning
......@@ -489,31 +489,32 @@ public class DiadromousFishGroup extends AquaNismsGroup<DiadromousFish, RIOBasin
Scanner scanner;
obs1900 = new HashMap<String, Integer>();
try {
reader = new FileReader(fileNameInputForInitialObservation);
// Parsing the file
scanner = new Scanner(reader);
scanner.useLocale(Locale.ENGLISH); // to have a comma as decimal separator !!!
scanner.useDelimiter(Pattern.compile("[;\r]"));
scanner.nextLine(); // to skip the file first line of headers
while (scanner.hasNextLine()) {
String[] fields = scanner.nextLine().split(",");
// System.out.println(Arrays.toString(fields));
if (fields.length > 2) {
if (!fields[2].isEmpty())
obs1900.put(fields[1], Integer.valueOf(fields[2]));
if (fileNameInputForInitialObservation.isEmpty()) {
try {
reader = new FileReader(fileNameInputForInitialObservation);
// Parsing the file
scanner = new Scanner(reader);
scanner.useLocale(Locale.ENGLISH); // to have a comma as decimal separator !!!
scanner.useDelimiter(Pattern.compile("[;\r]"));
scanner.nextLine(); // to skip the file first line of headers
while (scanner.hasNextLine()) {
String[] fields = scanner.nextLine().split(",");
// System.out.println(Arrays.toString(fields));
if (fields.length > 2) {
if (!fields[2].isEmpty())
obs1900.put(fields[1], Integer.valueOf(fields[2]));
}
}
}
reader.close();
scanner.close();
reader.close();
scanner.close();
} catch (IOException ex) {
Logger.getLogger(DiadromousFishGroup.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(DiadromousFishGroup.class.getName()).log(Level.SEVERE, null, ex);
}
}
// defaut values
if (targetedAgeForFemaleSpawnerForFirstTime == null)
targetedAgeForFemaleSpawnerForFirstTime = 5.5;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment