SpaceX has a ground station to communicate with its numerous satellites. The ground station has max bandwidth that it can handle satellite at any one time and can handle multiple satellites in parallel. Every satellite has a downlink rate measured in units per 30 minutes.
A satellite can only downlink data when ground station can see it and this window is called a pass. All passes are a minimum of 30 minutes. When the pass begins, the connection and downlink to the ground station is instant with no delays. Likewise, when the pass ends the downlink will immediately stop .
Make a java program that can take(or import) schedule of satellites from text file detailed below and find the 30 minute period where the total downlink (all satellite passes) will be at its maximum. The ground station bandwidth should be provided as an argument to the program. Apart from this, Also determine if ground station has the bandwidth to support this.
Text file will contain number of satellites given below with format as follows:
Each line denotes a single pass. The four elements of pass are comma separated. A pass contains satellite name, it’s bandwidth per 30 minute period, the start time of pass and the end time of the pass.
satA,2,00:00,01:30
satA,2,02:30,04:00
satA,2,10:00,11:30
satB,5,00:30,03:30
satB,5,05:30,08:30
satD,3,00:00,00:00
satC,10,03:00,03:30
satC,10,15:00,15:30
satF,30,12:00,16:30
satE,10,00:00,03:00
satH,30,09:00,10:30
satG,2,12:00,15:00
What I have tried:
As of now, my approach to solve this exercise is as follows, although I haven't done it practically yet because i am unsure if i am going in right direction or not:-
1) Ground Station bandwidth will be provided as an argument to the program.
2) Start time and end time will be provided as an argument to the program(I am not sure about whether to provide this or not as question does not states this, but in order to accomplish the program, i am just assuming it).
2) Create the logic that will first import the text file containing the satellites details
3) Parse the satellite details one by one by going it through loop and segregate its four parameters.
4) Check and validate the segregated start, end and bandwidth parameters of satellite whether it lies in between our explicitly provided start/end time/bandwidth of ground station
5) Return the list as a result which will contain satellites those who lies and those who don't.
I hope my approach is relevant in some sense. Please assist/guide or suggest regarding its logic and how to proceed further to accomplish this