C-Wire is an academic project aimed at analyzing and processing data about electricity distribution stations. It relies on the use of an AVL tree to dynamically model and balance data extracted from a CSV file. A Shell script processes the .csv input file to extract relevant information, while the C program calculates the total load of consumers connected to each station using a balanced binary search tree for optimized performance.
- A recent version of the C compiler and make.
- gnuplot and bash
- This project was created in unix/linux environment.
- Make sure you have installed
gnuplot:sudo apt update && sudo apt install gnuplot - Clone this repository:
git clone https://github.com/deltahmed/C-Wire.git
- Navigate to the project directory:
cd C-Wire - Run the project:
bash c-wire.sh -h
bash c-wire.sh <path_to_csv> <station_type: hva hvb lv> <consumer_type: comp indiv all> [<plant_identifier>] [-h] [-r]-
<path_to_csv>: Path to the CSV file containing the data. (mandatory) -
<station_type>: Type of station to process (hvb, hva, lv). (mandatory) -
<consumer_type>: Type of consumer to process (comp, indiv, all). (mandatory) -
<plant_identifier>: Identifier of the plant (optional). -
-h: Displays this help message and ignores all other parameters. -
-r: force C compilation can only be the last parameter
- Forbidden combinations:
hvb all,hvb indiv,hva all,hva indiv.
bash c-wire.sh data.csv hva comp
bash c-wire.sh data.csv lv indiv 1Make sure your CSV file is correctly formatted to avoid errors.
Power plant;HV-B Station;HV-A Station;LV Station;Company;Individual;Capacity;Load-
With the command
lv allyou have in addition to the classic output the 10 station with the lowest load and the 10 LV station with the most load (You also have the station Electrical efficiency displayed in this file), you have also a graph of this 20 LV stations -
Here some exemple of the additionnal calculations
bash c-wire.sh c-wire_v25.dat lv all
bash c-wire.sh c-wire_v25.dat lv all 1