Python으로 배우는 이산 사건 시뮬레이션
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific
연속 모델
고정된 시간 간격으로 실행
시간은 더미 변수
시간 for 루프 사용
for t in range(time_range):
이산 사건 모델
가변 시간 간격으로 실행
시간은 상태 변수
주로 while 루프 사용
while (time < 365):
time += process_duration
예시: 택시 회사 모델
while (time < 10):
# Process 1
time_duration_1 = manage_requests()
time += time_duration_1
# Process 2
time_duration_2 = dispatch_taxi()
time += time_duration_2
종료 조건
while (time < 10)
예시: 택시 회사 모델
while (time < 10):
# Process 1
time_duration_1 = manage_requests()
time += time_duration_1
# Process 2
time_duration_2 = dispatch_taxi()
time += time_duration_2
클록
time += time_duration_1
time += time_duration_2
time은 현재 시뮬레이션 시간을 추적예시: 택시 회사 모델
while (time < 10):
# Process 1
time_duration_1 = manage_requests()
time += time_duration_1
# Process 2
time_duration_2 = dispatch_taxi()
time += time_duration_2
상태 변수
time
고객 호출부터 하차까지의 시간 단축
시스템 출력 및 효율성을 나타내는 변수
Python으로 배우는 이산 사건 시뮬레이션