How do I generate a Poisson Process?

后端 未结 8 2013
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 06:07

Original Question:

I want to generate a Poisson process. If the number of arrivals by time t is N(t) and I have a Poisson distribution with parameter

相关标签:
8条回答
  • 2021-02-20 07:05

    The discussion here has all the details about using inverse sampling to generate inter-arrivals, which is usually what people want to do for games.

    https://stackoverflow.com/a/15307412/1650437

    0 讨论(0)
  • 2021-02-20 07:12

    In python, you can try below code.

    If you want to generate 20 random readings in 60 seconds. ie (20 is the lambda)

     def poisson_job_generator():
        rateParameter = 1.0/float(60/20) 
        while True:
            sl = random.expovariate(rateParameter)
    
    0 讨论(0)
提交回复
热议问题