diff --git a/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/os/OS.java b/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/os/OS.java index 6834bcf39ce6fff33b3c0755c63abcb2f330e614..faa34402733831c20dd0d3169a6441ec1e9e1c32 100644 --- a/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/os/OS.java +++ b/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/os/OS.java @@ -11,6 +11,7 @@ import java.util.*; public class OS extends ArrayList< Coordinate > { private static TreeSet <Integer> list = new TreeSet<>(); + private static TreeMap<Integer, Integer> occ = new TreeMap<>(); private static int startingSize; @@ -38,6 +39,8 @@ public class OS extends ArrayList< Coordinate > public void set( ) { list.add( this.size() ); + Integer j = occ.get(this.size() ); + occ.put( this.size(), ( j == null ) ? 1 : j + 1 ); /* Not necessary for the program.*/ this.name = count; /*----------------*/ @@ -97,7 +100,6 @@ public class OS extends ArrayList< Coordinate > this.start = false; } - /** * Sets the visited parameter to the specified value. * @@ -153,7 +155,7 @@ public static void setStartingStatus(int dimension) startingSize = 0; if ( dimension == 0 ) { - for ( int i = 0; list.size() > 10 && i <= list.size() / 4; i++ ) + for ( int i = 0; list.size() > 20 && i <= list.size()/2 ;i++ ) { list.remove( list.last() ); } @@ -167,8 +169,12 @@ public static void setStartingStatus(int dimension) } startingSize = list.last(); list = new TreeSet<>(); - } + }} + + public static void setStartingStatusStats(int dimension) + { + startingSize = list.last(); } @@ -181,4 +187,9 @@ public static void setStartingStatus(int dimension) { OS.count = count; } + + public static TreeMap< Integer, Integer > getOcc() + { + return occ; + } }