[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: poisson distr ?
From: |
gepr |
Subject: |
Re: poisson distr ? |
Date: |
Wed, 18 Dec 2002 07:06:46 -0800 |
There is one. Just include random.h. Here's the protocol:
@protocol PoissonDist <UnsignedDistribution, CREATABLE>
//S: Poisson distribution
//D: A distribution used to model the integer number of occurrences
//D: of some event over an interval of time or space.
CREATING
//M: Use this create message if the generator to be attached is a Simple one
//M: and both the occurrence rate and the interval are set at create time:
+ create : (id <Zone>)aZone
setGenerator: (id <SimpleRandomGenerator>)generator
setOccurRate: (double) anOccurRate
setInterval: (double) anInterval;
//M: Use this create message if the generator to be attached is a Split one and
//M: both the occurrence rate and the interval are to be set at create time:
+ create : (id <Zone>)aZone
setGenerator: (id <SplitRandomGenerator>)generator
setVirtualGenerator: (unsigned)vGen
setOccurRate: (double) anOccurRate
setInterval: (double) anInterval;
SETTING
//M: The setInterval method only sets the interval parameter; the occurRate
//M: parameter is left unchanged from its previous or initialized value
- setInterval: (double) anInterval;
//M: The setOccurRate method only sets the occurRate parameter; the interval
//M: parameter is left unchanged from its previous or initialized value
- setOccurRate: (double) anOccurRate;
//M: The setOccurRate:setInterval method sets both the occurrence rate
//M: and the interval parameters.
- setOccurRate: (double) anOccurRate
setInterval: (double) anInterval;
USING
//M: The getOccurRate method returns the occurrence rate parameter.
- (double) getOccurRate;
//M: The getInterval method returns the interval parameter.
- (double) getInterval;
//M: The getUnsignedSampleWithInterval method returns a sample value using
//M: the distribution's current occurrence rate and new interval value.
//M: Causes an error if the occurrence rate has not been previously set.
- (unsigned) getUnsignedSampleWithInterval: (double) anInterval;
//M: The getUnsignedSampleWithOccurRate:andInterval method returns
//M: a sample value for the specified occurrence rate and interval.
//M: Does not change the the distribution's parameter values set by
//M: the setter methods.
- (unsigned) getUnsignedSampleWithOccurRate: (double) anOccurRate
withInterval: (double) anInterval;
@end
Rick Riolo writes:
> has anyone implemented a poisson distribution generator
> in (objective c) swarm? (i didn't see it in the docs,
> but maybe i missed it?)
> if you have one, or have one in C i suppose,
> could you please post/point us to the source?
--
glen e. p. ropella =><= Hail Eris!
H: 831.335.4950 http://www.ropella.net/~gepr
M: 831.247.7901 http://www.tempusdictum.com
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.