Python으로 배우는 이산 사건 시뮬레이션
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific
참고: '이벤트'와 '프로세스'는 혼용됩니다.
이벤트(또는 프로세스) 결정론이란?
결정론적 프로세스가 중요한 이유
자연 현상
인간 주도 또는 인간이 시작한 활동
결정론적 프로세스
프로세스 지속 시간은 시뮬레이션 시간에 반영되어야 함
# Deterministic processes (time in hours) duration_process_1 = 10 duration_process_2 = 5while sim_time < total_sim_time:# Update simulation time: Process 1 sim_time += duration_process_1# Update simulation time: Process 2 sim_time += duration_process_2
결정론적 이벤트의 SimPy 구현:
.timeout() 메서드가 프로세스 지속 시간을 기록# Deterministic processes
duration_process_1 = 10
duration_process_2 = 5
while True:
# Update simulation time: Process 1
yield env.timeout(duration_process_1)
# Update simulation time: Process 2
yield env.timeout(duration_process_2)
Python으로 배우는 이산 사건 시뮬레이션