25 lines
		
	
	
		
			812 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			812 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import yaml
 | |
| from Utilities.Time import get_current_time
 | |
| from LoadProfile import get_load_profile
 | |
| 
 | |
| # read config file
 | |
| c = yaml.safe_load(open("YAMLs/config.yml"))
 | |
| 
 | |
| ## simulation time setup
 | |
| # get current time
 | |
| c["sim_start_time"] = get_current_time()
 | |
| # get time step in minutes, then convert to seconds
 | |
| dt = c["sim_time"]["time_step_minutes"] * 60
 | |
| # compute end time based on duration in days
 | |
| duration = c["sim_time"]["duration_days"] * 24 * 60 * 60
 | |
| c["sim_end_time"] = c["sim_start_time"] + duration
 | |
| 
 | |
| # batch process hours in seconds
 | |
| c["sim_time"]["batch_process_seconds"] = c["sim_time"]["batch_process_hours"] * 60 * 60
 | |
| 
 | |
| # load site info
 | |
| c["site_info"] = yaml.safe_load(open(c["paths"]["site_info"]))
 | |
| 
 | |
| # generate load profiles
 | |
| get_load_profile(c, dt, c["sim_start_time"], c["sim_time"]["batch_process_seconds"])
 |