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.
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