File size: 847 Bytes
3aea0a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from Models.central_coordinator import CentralCoordinator

# Initialize the CentralCoordinator
coordinator = CentralCoordinator()

# Generate recommendation with sample input values and real-time weather for a city
result = coordinator.generate_recommendation(
    soil_ph=4.0,
    soil_moisture=10,
    temperature=32,
    rainfall=35,
    fertilizer=0.5,
    pesticide=0.3,
    crop_yield=15,
    city_name="bangalore"  # Use real-time weather for Delhi
)

# Print recommendation results
print("\n--- Final Crop Recommendation ---")
for key, value in result.items():
    if key == "Warnings" and value:
        print("Warnings:")
        for warning in value:
            print(f"  - {warning}")
    else:
        print(f"{key}: {value}")

# Automatically plot the result scores
CentralCoordinator.plot_scores(result)