Browse Source

Getlength

Favary Pierre 8 months ago
parent
commit
8ab68ac6e7
2 changed files with 6 additions and 4 deletions
  1. 5
    3
      be-graphes-model/src/main/java/org/insa/graphs/model/Path.java
  2. 1
    1
      pom.xml

+ 5
- 3
be-graphes-model/src/main/java/org/insa/graphs/model/Path.java View File

@@ -210,11 +210,13 @@ public class Path {
210 210
      * 
211 211
      * @return Total length of the path (in meters).
212 212
      * 
213
-     * @deprecated Need to be implemented.
214 213
      */
215 214
     public float getLength() {
216
-        // TODO:
217
-        return 0;
215
+        float longeur=0;
216
+        for (int i=0;i<this.arcs.size();i++) {
217
+        	longeur+=this.arcs.get(i).getLength();
218
+        }
219
+        return longeur;
218 220
     }
219 221
 
220 222
     /**

+ 1
- 1
pom.xml View File

@@ -12,7 +12,7 @@
12 12
 	<name>be-graphes-all</name>
13 13
 
14 14
 	<properties>
15
-		<jdk.version>1.8</jdk.version>
15
+		<jdk.version>1.11</jdk.version>
16 16
 		<maven.compiler.source>${jdk.version}</maven.compiler.source>
17 17
 		<maven.compiler.target>${jdk.version}</maven.compiler.target>
18 18
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Loading…
Cancel
Save