25 lines
		
	
	
		
			684 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			684 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import numpy as np
 | |
| from Utilities.Time import generate_timestrings
 | |
| 
 | |
| 
 | |
| def get_no_of_peaks(peak_bounds):
 | |
|     peak_occurences = np.random.randint(peak_bounds["min"], peak_bounds["max"], 1)
 | |
|     return peak_occurences
 | |
| 
 | |
| 
 | |
| def generate_peak_info(c, dt):
 | |
|     no_of_peaks = get_no_of_peaks(c["site_info"]["no_of_peaks"])
 | |
|     operating_hours = generate_timestrings(
 | |
|         c["site_info"]["operating hours"]["start"],
 | |
|         c["site_info"]["operating hours"]["end"],
 | |
|         dt,
 | |
|     )
 | |
|     peak_times = np.random.choice(operating_hours, no_of_peaks, replace=False)
 | |
| 
 | |
|     print(f"Peak times: {peak_times}")
 | |
|     return peak_times
 | |
| 
 | |
| 
 | |
| def get_load_profile(c, dt):
 | |
|     return generate_peak_info(c, dt)
 |