Package core.statistics.balance.station
Class StationApp
- java.lang.Object
-
- core.statistics.balance.station.StationApp
-
public class StationApp extends java.lang.ObjectThe 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 Summary
Constructors Constructor Description StationApp()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublecomputeAverageRateOfOccupation(Station station)This methods is used to compute the average rate of occupation of a given stationstatic StationgetLeastOccupiedStation(MyVelibSystem system)Getter for the least occupied stationstatic StationgetMostUsedStation(MyVelibSystem system)Getter of the most used station of a give systemstatic intgetNumberOfDroppings(Station station)Getter for the number of droppingsstatic intgetNumberOfRentings(Station station)Getter for the number of rentingsstatic voidsortStationByLeastOccupied(java.util.List<Station> stations)This method is used to sort a list of station by the least occupied policystatic java.util.List<Station>sortStationByMostUsed(java.util.List<Station> stations)This method is used to sort a list of station by the most used policystatic voidstationBalance(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
-
-
-
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
-
-