डिस्क्रीट-इवेंट सिमुलेशन का परिचय

Python में Discrete Event Simulation

Diogo Costa (PhD, MSc)

Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific

डिस्क्रीट-इवेंट बनाम कंटीन्युअस मॉडल्स

Continuous models

  • फिक्स्ड टाइम स्टेप्स पर चलते हैं

  • समय एक dummy वैरिएबल है

    • लूप के अंदर समय अपडेट नहीं होता
  • समय-आधारित for-लूप्स का उपयोग

    for t in range(time_range):
    

Discrete-event models

  • वैरिएबल टाइम स्टेप्स पर चलते हैं

    • समय के साथ अलग अवधि वाले discrete events को रन/शेड्यूल करें
  • समय एक state-variable है

    • while-लूप के अंदर समय अपडेट होता है
    • समय dummy वैरिएबल नहीं है
  • अक्सर while-लूप्स का उपयोग होता है

    while (time < 365):
    time += process_duration
    
Python में Discrete Event Simulation

डिस्क्रीट-इवेंट मॉडल्स के घटक

  • State-variables
  • Clock
  • Event list (या Process list)
  • Ending condition(s)
Python में Discrete Event Simulation

मॉडल के घटक

उदाहरण: टैक्सी कंपनी मॉडल

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

Ending condition

while (time < 10)
  • वे condition(s) जो simulation को समाप्त करती हैं
Python में Discrete Event Simulation

मॉडल के घटक

उदाहरण: टैक्सी कंपनी मॉडल

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

Clock

time += time_duration_1
time += time_duration_2
  • time मौजूदा simulation समय ट्रैक करता है
  • सिमुलेशन बढ़ते ही clock अगले इवेंट के start time पर कूदता है
  • समय "हॉप" करता है क्योंकि events तात्कालिक होते हैं
Python में Discrete Event Simulation

मॉडल के घटक

उदाहरण: टैक्सी कंपनी मॉडल

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

State-variable

time
  • ग्राहक के कॉल करने से ड्रॉप-ऑफ तक का समय घटाना

  • वे वैरिएबल जो सिस्टम के आउटपुट और दक्षता को दर्शाते हैं

Python में Discrete Event Simulation

अभ्यास करते हैं!

Python में Discrete Event Simulation

Preparing Video For Download...