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
fe8449ef
Commit
fe8449ef
authored
Apr 23, 2020
by
Poulet Camille
Browse files
Merge branch 'patrick' into Camille_Bis
parents
2e26e0e5
38d7b8a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/environment/BasinNetworkSWithContinent.java
View file @
fe8449ef
...
...
@@ -348,17 +348,20 @@ public class BasinNetworkSWithContinent extends BasinNetwork {
// skip the first line with headers
scanner
.
nextLine
();
int
i
,
j
;
int
index
=
0
;
while
(
scanner
.
hasNext
()
&
index
<
Math
.
pow
(
nbBasin
,
2
.))
{
j
=
index
%
nbBasin
;
i
=
(
index
-
j
)
/
nbBasin
;
if
(
j
==
0
)
scanner
.
next
();
// to skip the first column
// System.out.println("i"+i+"j"+j+"index"+index);
distanceGrid
[
i
][
j
]
=
Double
.
valueOf
(
scanner
.
next
());
index
++;
/*
* int i, j; int index = 0; while (scanner.hasNext() & index < Math.pow(nbBasin, 2.)) { j = index % nbBasin;
* i = (index - j) / nbBasin; if (j == 0) scanner.next(); // to skip the first column //
* System.out.println("i"+i+"j"+j+"index"+index); distanceGrid[i][j] = Double.valueOf(scanner.next());
* index++; }
*/
int
i
=
0
;
while
(
scanner
.
hasNextLine
())
{
String
[]
fields
=
scanner
.
nextLine
().
split
(
","
);
for
(
int
j
=
0
;
j
<
nbBasin
;
j
++)
{
distanceGrid
[
i
][
j
]
=
Double
.
valueOf
(
fields
[
j
+
1
]);
}
}
reader
.
close
();
scanner
.
close
();
}
catch
(
Exception
e
)
{
...
...
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