Module hermes :: Class Instance
[frames | no frames]

Class Instance


Temporary data storage for the current run of the external. Each time a user runs this external, a new Instance object is created to store information about this run. Data in the Instance object is temporary and is not stored between runs.
Method Summary
  __init__(self)
int randrange(self, start, stop)
Return a random integer from range(start, stop).

Instance Variable Summary
    External Data
ExternalData data: Instance-specific data for this external.
    Instance Properties
long randomSeed: The seed value used to initialize the random number generator.

Method Details

randrange(self, start, stop=None)

Return a random integer from range(start, stop). Note that if only start is given, this will be the maximum value that randrange will return. Otherwise the value will be in the range [start, stop). In other words, stop will not be included in the result set.

Examples:
  • randrange(5) returns a random value from the set (0, 1, 2, 3, 4)
  • randrange(2, 5) returns a randomvalue from the set (2, 3, 4)
Parameters:
start - The minimum number (inclusive) of the random range if stop is also given, otherwise the range is from [0, start) if start is the only parameter.
           (type=int)
stop - The end of the range (exclusive) of values that will be returned. If this value is not given or is None, then start will be the end of the range.
           (type=int)
Returns:
A random integer from range(start, stop).
           (type=int)

Instance Variable Details

data

Instance-specific data for this external.
Type:
ExternalData

randomSeed

The seed value used to initialize the random number generator. This value can changed during debugging to reproduce the exact sequence of random numbers that were produced in every other run with the external with the same randomSeed constant.
Type:
long

Generated by Epydoc 2.1 on Mon Mar 27 20:48:40 2006 http://epydoc.sf.net