August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)

Kamaelia.Automata.Behaviours

Simple behaviours

A collection of components that send to their "outbox" outbox, values according to simple behaviours - such as constant value, bouncing, looping etc.

Example Usage

Generate values that bounce up and down between 0 and 1 in steps of 0.05:

bouncingFloat(scale_speed=0.05*10)

Generate (x,y) coordinates, starting at (50,50) that bounce within a 200x100 box with a 10 unit inside margin:

cartesianPingPong(point=(50,50), width=200, height=100, border=10)

Generate the angles for the seconds hand on an analog watch:

loopingCounter(increment=360/60, modulo=360)

Constantly generate the number 7:

continuousIdentity(original=7)

Constantly generate the string "hello":

continuousIdentity(original="hello")

Constantly generate the value 0:

continuousZero()

Constantly generate the value 1:

continuousOne()

More detail

All components start emitting values as soon as they are activated. They then emit values as fast as they can (there is no throttling/rate control).

All components will terminate if they receive the string "shutdown" on their "control" inbox. They also then send "shutdown" to their "signal" outbox.

All components will pause and stop emitting values if they receive the string "pause" on their "control" inbox. They will resume from where they left off if they receive the string "unpause" on the same inbox.


Kamaelia.Automata.Behaviours.bouncingFloat

class bouncingFloat(Axon.Component.component)

bouncingFloat(scale_speed) -> new bouncingFloat component

A component that emits a value that constantly bounces between 0 and 1.

scale_speed scales the rate at which the value changes. 1.0 = tenths, 0.5 = twentieths, etc.

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, scale_speed)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

main(self)

Main loop

Kamaelia.Automata.Behaviours.cartesianPingPong

class cartesianPingPong(Axon.Component.component)

cartesianPingPong(point,width,height,border) -> new cartesianPingPong component

A component that emits (x,y) values that bounce around within the specified bounds.

Keyword arguments:

  • point -- starting (x,y) coordinates
  • width, height -- bounds of the area
  • border -- distance in from bounds at which bouncing happens

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, point, width, height, border)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

main(self)

Main loop.

Kamaelia.Automata.Behaviours.continuousIdentity

class continuousIdentity(Axon.Component.component)

continuousIdentity(original) -> new continuousIdentity component

A component that constantly emits the original value.

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, original, *args)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

main(self)

Main loop.

Kamaelia.Automata.Behaviours.continuousOne

class continuousOne(Axon.Component.component)

continuousOne() -> new continuousOne component

A component that constantly emits the value 1.

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, *args)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

main(self)

Main loop.

Kamaelia.Automata.Behaviours.continuousZero

class continuousZero(Axon.Component.component)

continuousZero() -> new continuousZero component

A component that constantly emits the value 0.

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, *args)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

main(self)

Main loop.

Kamaelia.Automata.Behaviours.loopingCounter

class loopingCounter(Axon.Component.component)

loopingCounter(increment[,modulo]) -> new loopingCounter component

Emits an always incrementing value, that wraps back to zero when it reaches the specified limit.

Keyword arguments: - increment -- increment step size - modulo -- counter wrap back to zero before reaching this value (default=360)

Inboxes

Outboxes

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, increment[, modulo])

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

main(self)

Main loop.

Feedback

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, 05 Jun 2009 at 03:01:38 UTC/GMT