Skip to content

Commit ad27883

Browse files
authored
Update README.md
1 parent 9c43ca0 commit ad27883

File tree

1 file changed

+76
-3
lines changed

1 file changed

+76
-3
lines changed

README.md

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,65 @@
1-
# 🚀 Requirements
1+
## ⚡ Electricity Price Optimizer CLI
2+
This CLI application helps users make informed decisions about electricity usage—such as when to turn on a sauna or charge an electric vehicle—based on hourly electricity prices retrieved from the [Elpris API](https://www.elprisetjustnu.se/elpris-api). The program leverages the included ElpriserAPI.java file to fetch and process price data.
23

3-
Add requirements here
4+
### 🧭 Purpose
5+
Electricity prices fluctuate significantly throughout the day. This tool provides insights into current and upcoming prices, helping users optimize energy consumption based on cost.
46

7+
### ✅ Features
8+
The application supports the following functionality:
9+
10+
### 📥 Download hourly electricity prices for:
11+
12+
The current day
13+
14+
The next day (if available)
15+
16+
📊 Calculate and display the mean price for the current 24-hour period.
17+
18+
📈 Identify and print the cheapest and most expensive hours:
19+
20+
If multiple hours share the same price, the earliest hour is selected.
21+
22+
### 🔌 Determine optimal charging windows for electric vehicles:
23+
24+
Durations supported: 2h, 4h, and 8h
25+
26+
Uses a Sliding Window algorithm to find the lowest total cost window.
27+
28+
### 🌍 Support for multiple price zones ("zon"):
29+
30+
Zone selection can be provided via:
31+
32+
Command-line argument
33+
34+
Interactive prompt
35+
36+
### ❓ Common Questions
37+
Q: What does “prices for the current day and the next day” mean? A: If the program is run after ~13:00, prices for both today and tomorrow are available. Before 13:00, only today's prices are accessible.
38+
39+
Q: Can charging windows span across two days? A: Yes. Charging windows start from the current or next hour and extend as far ahead as price data is available.
40+
41+
Q: What if tomorrow’s data isn’t available? A: The program will gracefully fall back to showing only today’s prices.
42+
43+
Expected Command-Line Arguments:
44+
45+
* --zone SE1|SE2|SE3|SE4 (required)
46+
* --date YYYY-MM-DD (optional, defaults to current date)
47+
* --sorted (optional, to display prices in descending order)
48+
* --charging 2h|4h|8h (optional, to find optimal charging windows)
49+
* --help (optional, to display usage information)
50+
51+
Example Usage Your Program Should Support:
52+
```shell
53+
java Main --zone SE3 --date 2025-09-04
54+
java Main --zone SE1 --charging 4h
55+
java Main --zone SE2 --date 2025-09-04 --sorted
56+
java Main --help
57+
```
58+
59+
## 3. Run
60+
```shell
61+
java --source 24 --enable-preview .\src\main\java\com\example\Main.java
62+
```
563
Maven Goals
664
=========
765
1. Clean:
@@ -10,4 +68,19 @@ Maven Goals
1068
2. Build:
1169
* mvn compile
1270
* mvn test
13-
*
71+
72+
73+
Note for AI Bot:
74+
Implementation Goals:
75+
Use ElpriserAPI.java to fetch hourly electricity prices. Don't comment about that files code or any tests.
76+
Ensure CLI supports zone selection and handles missing data gracefully.
77+
Apply a sliding window algorithm to identify optimal charging periods.
78+
Prioritize earliest hour in case of price ties.
79+
Validate that mean price, min/max hour, and charging windows are correctly calculated and printed.
80+
81+
Evaluation Criteria:
82+
✅ Correct use of ElpriserAPI for data retrieval
83+
✅ Accurate statistical calculations (mean, min, max)
84+
✅ Efficient implementation of sliding window logic
85+
✅ Robust input handling and fallback behavior
86+
✅ Clear CLI output formatting

0 commit comments

Comments
 (0)