public static double [ ] getMaximumValues ( Front front ) { if ( front == null ) { throw new NullFrontException ( ) ; } else if ( front . getNumberOfPoints ( ) == 0 ) { throw new EmptyFrontException ( ) ; } int numberOfObjectives = front . getPoint ( 0 ) . getDimension ( ) ; double [ ] maximumValue = new double [ numberOfObjectives ] ; for ( int i = 0 ; i < numberOfObjectives ; i ++ ) { maximumValue [ i ] = Double . NEGATIVE_INFINITY ; } for ( int i = 0 ; i < front . getNumberOfPoints ( ) ; i ++ ) { for ( int j = 0 ; j < numberOfObjectives ; j ++ ) { if ( front . getPoint ( i ) . getValue ( j ) > maximumValue [ j ] ) { maximumValue [ j ] = front . getPoint ( i ) . getValue ( j ) ; } } } return maximumValue ; }
Gets the maximum values for each objectives in a front