Nawinkumar15 commited on
Commit
c0a6e47
·
verified ·
1 Parent(s): bf5300d

Update modules/simulator.py

Browse files
Files changed (1) hide show
  1. modules/simulator.py +15 -17
modules/simulator.py CHANGED
@@ -4,7 +4,12 @@ import datetime
4
 
5
  def simulate_data(n=48, faults=True):
6
  today = datetime.date.today()
7
- sites = ["Hyderabad", "Gadwal", "Kurnool", "Ballari"]
 
 
 
 
 
8
  poles = [f"Pole_{i+1:03}" for i in range(n)]
9
  data = []
10
 
@@ -33,20 +38,13 @@ def simulate_data(n=48, faults=True):
33
  alert = "Yellow"
34
  elif len(anomaly) > 1:
35
  alert = "Red"
 
 
36
 
37
- data.append({
38
- "Pole ID": pole,
39
- "Site": site,
40
- "Date": today,
41
- "Solar Gen (kWh)": solar,
42
- "Wind Gen (kWh)": wind,
43
- "Power Required (kWh)": required,
44
- "Power Sufficient": sufficient,
45
- "Camera Status": cam,
46
- "Tilt (°)": tilt,
47
- "Vibration (g)": vib,
48
- "Anomalies": "; ".join(anomaly) if anomaly else "None",
49
- "Alert Level": alert
50
- })
51
-
52
- return pd.DataFrame(data)
 
4
 
5
  def simulate_data(n=48, faults=True):
6
  today = datetime.date.today()
7
+ site_coords = {
8
+ "Hyderabad": (17.3850, 78.4867),
9
+ "Gadwal": (16.2350, 77.8000),
10
+ "Kurnool": (15.8281, 78.0373),
11
+ "Ballari": (15.1394, 76.9214)
12
+ }
13
  poles = [f"Pole_{i+1:03}" for i in range(n)]
14
  data = []
15
 
 
38
  alert = "Yellow"
39
  elif len(anomaly) > 1:
40
  alert = "Red"
41
+
42
+ lat, lon = site_coords[site]
43
 
44
+ data.append({
45
+ "Pole ID": pole,
46
+ "Site": site,
47
+ "Latitude": lat + np.random.uniform(-0.005, 0.005), # Add small variation for each pole
48
+ "Longitude": lon + np.random.uniform(-0.005, 0.005),
49
+ ...
50
+ })