#include <retinalobjs.h>
Inheritance diagram for Retinal_Composite:
Additional operations are supported for composite objects; other derived Retinal_Objects should rarely need to define their own operations other than those overriding or completing the ones in Retinal_Object.
Definition at line 365 of file retinalobjs.h.
Public Types | |
enum | AccumulationType { Max, Min, Add, OneHot, Replace } |
Possible values for an accum_type. | |
Public Methods | |
Constructors and destructors | |
Retinal_Composite (const string &name_val, AccumulationType accum_type_i=Max, const VarMap &init_vars=VarMap()) | |
RetinalObjectStringArgs::ParamList | paramlist () |
Retinal_Composite (const string &name_val, RetinalObjectStringArgs &sa) | |
Retinal_Composite (const Retinal_Composite &b) | |
Primary Interface | |
virtual bool | next () |
Advance to the next state (whatever that means for this object). | |
virtual void | reset () |
Reset to the starting state. | |
virtual bool | update () const |
Must be called just before calling activation() one or more times. | |
Composite-only interface | |
virtual Coordinate | nominal_height () const |
Most Composites don't have any width or height, and instead just ask their parents. | |
virtual Coordinate | nominal_width () const |
virtual void | add (Retinal_Object *obj) |
Incorporate the given retinal object (must be allocated from the heap). | |
virtual bool | is_empty () const |
Whether there are currently any children. | |
virtual Retinal_Object * | find (const string &othername) |
Returns the first object with a matching name from a preorder search on self and children. | |
virtual void | remove (const string &childname="") |
Remove all children with the specified name. | |
virtual void | remove_all () |
Remove all children; separate routine for use with for_each. | |
virtual const Retinal_Object & | mostactive (Coordinate x, Coordinate y) const |
Rarely needed: Returns child which has the highest activation at that location, or self if childless. | |
Retinal_Object * | operator[] (unsigned int idx) const |
Deprecated: Returns child specified by number. | |
size_t | size () const |
Other functions which may be useful | |
virtual string | stringrep () const |
(Partial) representation of this object's state as a string | |
virtual Retinal_Object * | clone () const |
Return an identical copy of this object allocated from the heap. | |
bool | inside (Coordinate x, Coordinate y) const |
Returns true if the given coordinate is inside the active area of this object, favoring the most precise response possible, regardless of performance. | |
Protected Types | |
typedef std::vector< Retinal_Object * > | ChildrenContainer |
Container with pointers to the child objects managed by this instance. | |
typedef ChildrenContainer::iterator | iterator |
Iterator over this instance's children. | |
typedef ChildrenContainer::const_iterator | const_iterator |
Iterator over this instance's children. | |
Protected Methods | |
Activity | accum_base () const |
Starting value for an accumulation. | |
Protected Attributes | |
ChildrenContainer | children |
The child objects managed by this instance. | |
AccumulationType | accum_type |
How to combine the responses from multiple children. | |
Variable | cosmt |
Cached values for activ(). | |
Variable | sinmt |
Cached values for activ(). | |
Variable | cx |
Cached values for activ(). | |
Variable | cy |
Cached values for activ(). | |
Variable | div_size |
Cached values for activ(). | |
Retinal_Object * | dominant_child |
If accum_type is OneHot, the currently-dominant child. |
|
Returns the first object with a matching name from a preorder search on self and children. The empty string matches the first object found, whatever it is. Reimplemented from Retinal_Object. Definition at line 439 of file retinalobjs.h. References children, Retinal_Object::find(), and iterator. |
|
Returns true if the given coordinate is inside the active area of this object, favoring the most precise response possible, regardless of performance. A rectangular bounding box will suffice, but if an object can give a more precise answer, e.g. if it really has a circular or irregular shape instead of a box, it should give the more precise answer here. This call should be used only when such precision is needed; the regular rectangular bounding box can be used in other cases. Reimplemented from Retinal_Object. Definition at line 317 of file retinalobjs.c. References accum_type, Retinal_Object::bounding_box, Retinal_Obj::Coordinate, cx, cy, div_size, dominant_child, and Retinal_Object::inside(). |
|
Rarely needed: Returns child which has the highest activation at that location, or self if childless. There might be a way to encode this using max_element, mem_fun, bind1st, bind2nd, etc. Definition at line 280 of file retinalobjs.c. References Retinal_Object::activation(), Retinal_Obj::Activity, children, and const_iterator. |
|
Most Composites don't have any width or height, and instead just ask their parents. With any luck, they will have a parent that knows the width and height, and overrides this implementation. Reimplemented in Retinal_AnchoredManagedComposite. Definition at line 415 of file retinalobjs.h. References Retinal_Obj::Coordinate, Retinal_Object::get_parent(), and Retinal_Object::get_var(). |