Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #34037 > unrolled thread
| Started by | Ricky <rakkitha263@gmail.com> |
|---|---|
| First post | 2012-11-28 13:34 -0800 |
| Last post | 2012-11-29 16:24 +0000 |
| Articles | 6 — 5 participants |
Back to article view | Back to comp.lang.python
Exponential arrival distribution in Python Ricky <rakkitha263@gmail.com> - 2012-11-28 13:34 -0800
Re: Exponential arrival distribution in Python David Hutto <dwightdhutto@gmail.com> - 2012-11-28 17:52 -0500
Re: Exponential arrival distribution in Python David Hutto <dwightdhutto@gmail.com> - 2012-11-28 17:55 -0500
Re: Exponential arrival distribution in Python Paul Rubin <no.email@nospam.invalid> - 2012-11-28 15:25 -0800
Re: Exponential arrival distribution in Python Albert Chun-Chieh Huang <alberthuang314@gmail.com> - 2012-11-29 07:29 +0800
Re: Exponential arrival distribution in Python duncan smith <buzzard@invalid.invalid> - 2012-11-29 16:24 +0000
| From | Ricky <rakkitha263@gmail.com> |
|---|---|
| Date | 2012-11-28 13:34 -0800 |
| Subject | Exponential arrival distribution in Python |
| Message-ID | <f241ce20-2bca-4ced-814c-5143f0d82ca4@googlegroups.com> |
Hi all, I am doing a project on traffic simulation. I want to introduce exponential arrival distribution to precede this task. Therefore I want write a code in python for exponential arrival distribution. I am very new for programming and if anybody can help me on this that would be great. Cheers, Ricky
[toc] | [next] | [standalone]
| From | David Hutto <dwightdhutto@gmail.com> |
|---|---|
| Date | 2012-11-28 17:52 -0500 |
| Message-ID | <mailman.348.1354143147.29569.python-list@python.org> |
| In reply to | #34037 |
>> I am doing a project on traffic simulation. I want to introduce
>> exponential arrival distribution to precede this task. Therefore I want
>> write a code in python for exponential arrival distribution. I am very new
>> for programming and if anybody can help me on this that would be great.
First, I would suggest that you give yourself a GUI like tkinter,
wxpython to visualize the data. An average of the sequential(averaged
per 60 second intervals) traveled by drivers on the road, and at what
times.
Then, and I don't know why, but it seems you want a logarithmic, scale where:
for i in range(0,4)
print "%i = %i" % (i * 10 **i)
--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
[toc] | [prev] | [next] | [standalone]
| From | David Hutto <dwightdhutto@gmail.com> |
|---|---|
| Date | 2012-11-28 17:55 -0500 |
| Message-ID | <mailman.349.1354143308.29569.python-list@python.org> |
| In reply to | #34037 |
I mean this one:
for i in range(0,4):
print "%i = %i" % (i * 10 **i)
--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2012-11-28 15:25 -0800 |
| Message-ID | <7xd2yxmhrs.fsf@ruckus.brouhaha.com> |
| In reply to | #34037 |
Ricky <rakkitha263@gmail.com> writes: > I am doing a project on traffic simulation. I want to introduce > exponential arrival distribution to precede this task. Therefore I > want write a code in python for exponential arrival distribution. I've never heard of an "exponential arrival distribution" and googling fails. Do you mean an exponential distribution, that describes the expected arrival times in a Poisson process? Python's "random" module has the random.expovariate function for that: http://docs.python.org/3/library/random.html If you want an actual (discrete) Poisson distribution, see: http://en.wikipedia.org/wiki/Poisson_distribution#Generating_Poisson-distributed_random_variables
[toc] | [prev] | [next] | [standalone]
| From | Albert Chun-Chieh Huang <alberthuang314@gmail.com> |
|---|---|
| Date | 2012-11-29 07:29 +0800 |
| Message-ID | <mailman.351.1354145369.29569.python-list@python.org> |
| In reply to | #34037 |
Hi, Ricky, Traffic simulation sounds like a good topic to use SimPy, which is a discrete-event simulation library in Python, c.f. http://simpy.sourceforge.net Professor Norm Matloff wrote a very good tutorial on SimPy, and you can download it here: http://heather.cs.ucdavis.edu/~matloff/simcourse.html Also, I've presented this SimPy package before, my slides might be helpful, http://alberthuang314.blogspot.tw/2012/01/simpy-slides-in-our-company-and-pyhug_26.html In short, SimPy is a process-oriented discrete-event simulation package, which will be easier to maintain than event-oriented discrete-event simulation. It also contains some tools to help us to visualize simulation data. It takes some time to study it, but if you would like to do some simulation projects, it will definitely be a good investment! Have fun with simulation! with Regards, Albert Huang Ricky <rakkitha263@gmail.com> writes: > Hi all, > > I am doing a project on traffic simulation. I want to introduce exponential arrival distribution to precede this task. Therefore I want write a code in python for exponential arrival distribution. I am very new for programming and if anybody can help me on this that would be great. > > Cheers, > Ricky
[toc] | [prev] | [next] | [standalone]
| From | duncan smith <buzzard@invalid.invalid> |
|---|---|
| Date | 2012-11-29 16:24 +0000 |
| Message-ID | <50b78c40$0$12518$a8266bb1@newsreader.readnews.com> |
| In reply to | #34037 |
On 28/11/12 21:34, Ricky wrote: > > Hi all, > > I am doing a project on traffic simulation. I want to introduce exponential arrival distribution to precede this task. Therefore I want write a code in python for exponential arrival distribution. I am very new for programming and if anybody can help me on this that would be great. > > Cheers, > Ricky > Maybe you mean something like, >>> from random import expovariate >>> expovariate(1) 0.09133428954823608 >>> expovariate(1) 2.5388809393383407 >>> Duncan
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web