April 2024 - This site, and Kamaelia are being updated. There is significant work needed, and PRs are welcome.
The methods of the idGen class are used to generate unique IDs in various forms (numbers, strings, etc) which are used to give microprocesses and other Axon objects a unique identifier and name.
Do not use the idGen class defined in this module directly. Instead, use any of these module methods to obtain a unique ID:
Calling tupleId(thing) is not equivalent to calling numId() then strId(thing) because doing that would return two different id values!
Examples:
>>> x=Component.component()
>>> idGen.newId(x)
'Component.component_4'
>>> idGen.strId(x)
'Component.component_5'
>>> idGen.numId()
6
>>> idGen.tupleId(x)
(7, 'Component.component_7')
Unique ID creator.
Use numId(), strId(), and tupleId() methods to obtain unique IDs.
INTERNAL
Combines the 'str()' of the object's class with the id to form a string id
INTERNAL
Returns the next unique id, incrementing the private class variable
INTERNAL
Returns the next unique id, incrementing the private class variable
Allocates & returns the next available id
Allocates & returns the next available id combined with the object's class name, in string form
Allocates the next available id and returns it both as a tuple (num,str) containing both the numeric version and a string version where it is combined with the object's class name.
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 09 Dec 2009 at 04:00:25 UTC/GMT