Spaces:
Sleeping
Sleeping
Update modules/simulator.py
Browse files- modules/simulator.py +3 -1
modules/simulator.py
CHANGED
@@ -3,8 +3,9 @@ import numpy as np
|
|
3 |
import datetime
|
4 |
import uuid
|
5 |
|
6 |
-
def simulate_data(n=50, faults=True):
|
7 |
today = datetime.date.today()
|
|
|
8 |
poles = [f"Pole_{i+1:03}" for i in range(n)]
|
9 |
# Distribute poles across 4 locations
|
10 |
locations = ["Hyderabad"] * 12 + ["Gadwal"] * 12 + ["Kurnool"] * 12 + ["Bangalore"] * 14
|
@@ -57,6 +58,7 @@ def simulate_data(n=50, faults=True):
|
|
57 |
"Latitude": lat,
|
58 |
"Longitude": lon,
|
59 |
"Date": today,
|
|
|
60 |
"SolarGen(kWh)": solar,
|
61 |
"WindGen(kWh)": wind,
|
62 |
"PowerRequired(kWh)": required,
|
|
|
3 |
import datetime
|
4 |
import uuid
|
5 |
|
6 |
+
def simulate_data(n=50, faults=True, update_time=None):
|
7 |
today = datetime.date.today()
|
8 |
+
update_time = update_time or datetime.datetime.now() # Use provided time or current time
|
9 |
poles = [f"Pole_{i+1:03}" for i in range(n)]
|
10 |
# Distribute poles across 4 locations
|
11 |
locations = ["Hyderabad"] * 12 + ["Gadwal"] * 12 + ["Kurnool"] * 12 + ["Bangalore"] * 14
|
|
|
58 |
"Latitude": lat,
|
59 |
"Longitude": lon,
|
60 |
"Date": today,
|
61 |
+
"Timestamp": update_time,
|
62 |
"SolarGen(kWh)": solar,
|
63 |
"WindGen(kWh)": wind,
|
64 |
"PowerRequired(kWh)": required,
|