I propose to solve a scenario that is pretty familiar. I hope you can help me.
I have a set of home appliances and their power consumption (in watts).
- TV: 250 W
- Oven: 2400 W
- Washing machine: 500 W
I need a way (an algorithm) to find the maximum power consumption in a given interval.
Given, for example that:
- I watch TV from 2 to 4 and from 9 to 11
- I put the oven from 2:30 to 3
- I put the washing machine from 2 to 4
A set of sample results would be:
- from 12 to 2: 250 W (since only the TV is on in the given interval)
- from 2 to 5: 3150 W (there is a moment when the 3 appliances are ON)
- from 2:30 to 3: 2650 W (oven + TV)
I hope the example is easy to get. Thanks in advance!