Class StationApp


  • public class StationApp
    extends java.lang.Object
    The StationApp class in statistics.balance.station : This class has all the algorithms and methods that we need to calculate the statistics in the application for stations, that is to say, plus stations and standard stations.
    • Constructor Detail

      • StationApp

        public StationApp()
    • Method Detail

      • getMostUsedStation

        public static Station getMostUsedStation​(MyVelibSystem system)
        Getter of the most used station of a give system
        Parameters:
        system - the system that is being studied
        Returns:
        the station that has is most used (the number of droppings is used to compare). Return the first one, if there are more
      • getLeastOccupiedStation

        public static Station getLeastOccupiedStation​(MyVelibSystem system)
        Getter for the least occupied station
        Parameters:
        system - the system that is being studied
        Returns:
        the station that is least used (the rate of occupation is used). Return the first one, if there are more
      • stationBalance

        public static void stationBalance​(MyVelibSystem system)
        This method is used to get the station balance, it is used to compute many different parameters parameter 1 : average station balance on the system parameter 2 : the station which gained the most in the system parameter 3 : the station which gained the least in the system
        Parameters:
        system - the system that will be studied
      • getNumberOfRentings

        public static int getNumberOfRentings​(Station station)
        Getter for the number of rentings
        Parameters:
        station - The station that will be studied
        Returns:
        an integer that represents the number of rentings
      • getNumberOfDroppings

        public static int getNumberOfDroppings​(Station station)
        Getter for the number of droppings
        Parameters:
        station - The station that will be studied
        Returns:
        an integer that represents the number of droppings
      • computeAverageRateOfOccupation

        public static double computeAverageRateOfOccupation​(Station station)
        This methods is used to compute the average rate of occupation of a given station
        Parameters:
        station - the station that is being studied
        Returns:
        a double that represents the average rate of occupation of a given station
      • sortStationByMostUsed

        public static java.util.List<Station> sortStationByMostUsed​(java.util.List<Station> stations)
        This method is used to sort a list of station by the most used policy
        Parameters:
        stations - the list of stations that is being used
        Returns:
        the list sorted
      • sortStationByLeastOccupied

        public static void sortStationByLeastOccupied​(java.util.List<Station> stations)
        This method is used to sort a list of station by the least occupied policy
        Parameters:
        stations - the list of stations that is being used