Kamaelia

Nuts & Bolts | Components | Tools | Cookbook | Systems
wiki:( guest720932, Dev Console, Index, Recent, Edit )


Home, News
Dev Console

How, Why
Project Blog
Summer of Code

Documentation
Download
SVN (web)
Sourceforge page

Project Admin
License

Contact Us

  Page Tags

No tags are defined for this page yet - how would you classify/think of this page? Add your notes below!

Kamaelia docs : 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.

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

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.

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.

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.

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)

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, 20 Jul 2008 at 03:02:36 UTC/GMT


Your tags for this page: If you had set UserPreferences (name & email) and validated them (simple single click in your email), you would be able to define personal tags

Versions: current , 1


(C) 2005 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved,
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC.