CreatureSignals class in Global context

Signal sources associated with the creature. See also: Signal, WorldSignals, NeuroSignals

9 members:

integer size
integer

Signal count

Number of signals in this set

function add
returns Signal

add

function add(string channel)

Create a new signal

function addProperty
returns Signal

add

function addProperty(string channel, untyped property)

Create a signal that automatically reflects one of the creature's properties (i.e. its power is equal to the property value).
Example:
Creature.signals.addProperty("energy","energy"); //then, Neuro.signals.receive("energy") in custom neuron would work similarly to the built-in smell sensor

function clear
doesn't return a value

clear

function clear()

Delete all signals

function get
returns Signal

get

function get(integer index)

Access individual signals (index=0 .. size-1)

function receive
returns float

receive

function receive(string channel)

Receive the aggregated signal power in a given channel.

function receiveFilter
returns float

receive

function receiveFilter(string channel, float max_distance, float flavor, float filter)

Receive the aggregated signal power in a given channel.

Additional filtering options:
- Max distance only receives the neighbor signals (based on their physical location)
- Flavor filtering: only signals having the flavor close to the specified one will be received. The filter value is the maximum allowed difference.

function receiveSet
returns Vector

receive

function receiveSet(string channel, float max_distance)

Get all signals in the specified range. Returns a readonly vector object containing Signal objects (individual signals can be accessed as result[0], .., result[result.size-1]).

function receiveSingle
returns Signal

receive

function receiveSingle(string channel, float max_distance)

Find the signal source having the highest signal power (including the distance)


Global context