
#include <Neuro/SaccadeController.H>
Inheritance diagram for SaccadeController:


This base class handles the basic queuing of percepts and fixations. Typically, new percepts (e.g., winner-take-all winners over the saliency map) should be passed to the saccade controller using setPercept(). During normal evolution of a simulation, evolve() should be called at every time step, in a manner similar to that of Brain, WTA and SM. In order to obtain coordinates of saccade targets computed by this class, getDecision() should be called. It will return (-1, -1) if no new saccade target is decided (either because it cannot be decided, or because it is the same as the last valid returned one). So, saccading to and fixating a new target will yield one initial valid set of returned coordinates, followed by subsequent returns of (-1, -1) as long as fixation is to be held stationary. Derived classes should overload computeWhenNewPercept(), called each time a new percept has arrived, and computeWhenNewDecision(), called each time a new decision is requested. In addition, derived classes should usually overload doEvolve(), typically called at each time step during a simulation. See SaccadeControllers.H for examples of derived classes which actually implement saccadic control strategies.
Definition at line 72 of file SaccadeController.H.
Public Member Functions | |
| SaccadeController (OptionManager &mgr, const std::string &descrName, const std::string &tagName, const SaccadeBodyPart bodypart, const int percept_qlen, const int decision_qlen) | |
| Constructor. | |
| virtual | ~SaccadeController () |
| Destructor (virtual to ensure that derived classes correctly destroyed). | |
| void | evolve (SimEventQueue &q) |
| evolve one time step (called, e.g., by Brain::evolve()) | |
| virtual void | setPercept (const WTAwinner &fix, SimEventQueue &q) |
| Receive a new percept (e.g., winner from saliency map). | |
| virtual void | resetPos (const Point2D< int > &p, SimEventQueue &q) |
| Reset to an externally-given position. | |
| virtual Point2D< int > | getDecision (SimEventQueue &q, const bool dopoststatus=false) |
| Get the fixation decided by the controller. | |
| WTAwinner | getPreviousPercept (const unsigned int index=0) const |
| Get a previous percept. | |
| bool | havePercepts () const |
| Do we already have any percepts queued up? | |
| int | getPqlen () const |
| Returns length of percept queue. | |
| void | resetPqlen (const int len) |
| Reset length of percept queue (contents will be lost). | |
| void | killPercepts () |
| Kill all previous percepts (empty the percept queue). | |
| Point2DT | getPreviousDecision (const unsigned int index=0) const |
| Get a previous decision. | |
| bool | haveDecisions () const |
| Do we already have any decisions queued up? | |
| int | getDqlen () const |
| Returns length of decision queue. | |
| void | resetDqlen (const int len) |
| Reset length of decision queue (contents will be lost). | |
| void | killDecisions () |
| Kill all previous decisions (empty the decision queue). | |
| SaccadeBodyPart | bodyPart () const |
| get our body part | |
| void | dumpQueues () const |
| Show contents of the queues, for debugging. | |
Protected Member Functions | |
| virtual void | reset1 () |
| Reset SaccadeController. | |
| virtual void | doEvolve (SimEventQueue &q)=0 |
| Called from within evolve(). | |
| virtual void | computeWhenNewPercept (SimEventQueue &q)=0 |
| This method is called each time a new percept has arrived. | |
| virtual void | computeWhenResetPos (SimEventQueue &q)=0 |
| This method is called each time a reset() occurs. | |
| virtual Point2D< int > | computeWhenNewDecision (SaccadeState &sacstate, bool &blinkstate, SimEventQueue &q)=0 |
| This method is called each time a new decision is requested. | |
| SaccadeState | getState () const |
| Helper for derived classes to get our internal saccade/fix/smooth state. | |
| bool | getBlinkState () const |
| Helper for derived classes to get our internal blink state. | |
Protected Attributes | |
| OModelParam< Point2D< int > > | itsInitialPosition |
| start position | |
|
||||||||||||||||||||||||||||
|
Constructor.
Definition at line 47 of file SaccadeController.C. References LFATAL. |
|
|
Destructor (virtual to ensure that derived classes correctly destroyed).
Definition at line 69 of file SaccadeController.C. |
|
|
get our body part
Definition at line 276 of file SaccadeController.C. |
|
||||||||||||||||
|
This method is called each time a new decision is requested. The latest percept is at the front of the percept queue, and the latest previous decision at the front of the decision queue. The method should return the decision to be taken given the time passed as argument. This method should return the current decision for fixation, as well as current saccade and blink states. The wrapping getDecision() call will take care of eliminating decisions that are the same as the previous ones. Derived classes must provide some implementation for this method, as it is called from within getDecision(). Implemented in StubSaccadeController, TrivialSaccadeController, FixedSaccadeController, FrictionSaccadeController, ThresholdSaccadeController, ThresholdFrictionSaccadeController, and MonkeySaccadeController. Referenced by getDecision(). |
|
|
This method is called each time a new percept has arrived. The latest percept is at the front of the percept queue. Derived classes must provide some implementation for this method, as it is called from within setPercept(). Implemented in StubSaccadeController, TrivialSaccadeController, FixedSaccadeController, FrictionSaccadeController, ThresholdSaccadeController, ThresholdFrictionSaccadeController, and MonkeySaccadeController. Referenced by setPercept(). |
|
|
This method is called each time a reset() occurs. The reset location/time is at the front of the percept queue. Derived classes must provide some implementation for this method, as it is called from within resetPos(). NOTE: a resetPos(), even if it is to a location far away from the current one, should not create a saccade, because it is a way to break a simulation and reset it, not a way to drive saccades externally. Saccades should arise internally in computeWhenNewDecision(). You should not change the state here as resetPos() itself will change if to fixation or unknown anyway. Implemented in StubSaccadeController, TrivialSaccadeController, FixedSaccadeController, FrictionSaccadeController, ThresholdSaccadeController, ThresholdFrictionSaccadeController, and MonkeySaccadeController. Referenced by resetPos(). |
|
|
Called from within evolve(). Classes deriving from SaccadeController should implement this. Implemented in StubSaccadeController, TrivialSaccadeController, FixedSaccadeController, FrictionSaccadeController, ThresholdSaccadeController, ThresholdFrictionSaccadeController, and MonkeySaccadeController. Referenced by evolve(). |
|
|
Show contents of the queues, for debugging.
Definition at line 211 of file SaccadeController.C. References CLINFO, Point2D< T >::i, i, Point2D< T >::j, SimTime::msecs(), Point2DT::p, WTAwinner::p, sformat(), WTAwinner::sv, Point2DT::t, WTAwinner::t, and win. |
|
|
evolve one time step (called, e.g., by Brain::evolve()) evolve() should be invoked by external callers to allow the internals of the controller to evolve as time passes by but no new percept is available. Derived classes should not override this function, but should instead override doEvolve(), which is called from inside evolve(). Definition at line 280 of file SaccadeController.C. References doEvolve(). |
|
|
Helper for derived classes to get our internal blink state.
Definition at line 295 of file SaccadeController.C. |
|
||||||||||||
|
Get the fixation decided by the controller.
Definition at line 125 of file SaccadeController.C. References c, SimEventQueue::check(), CLDEBUG, CLFATAL, CLINFO, computeWhenNewDecision(), e, getPreviousDecision(), OModelParam< T >::getVal(), Point2D< T >::i, Point2D< T >::isValid(), itsInitialPosition, Point2D< T >::j, last, SimTime::msecs(), SimEventQueue::now(), p, SimEventQueue::post(), resetPos(), s, saccadeBodyPartName(), saccadeStateName(), SEQ_ANY, and SimTime::ZERO(). |
|
|
Returns length of decision queue. Note that the queue may not be full to that length yet Definition at line 264 of file SaccadeController.C. |
|
|
Returns length of percept queue. Note that the queue may not be full to that length yet Definition at line 240 of file SaccadeController.C. |
|
|
Get a previous decision. This method allows one to access a previous valid decision. It will not attempt to determine whether a new decision can be made now, like getDecision() does. It will simply return the result of what was previously decided (or (-1, -1) if no valid previous decision exists).
Definition at line 252 of file SaccadeController.C. References SimTime::ZERO(). Referenced by MonkeySaccadeController::computeWhenNewDecision(), ThresholdFrictionSaccadeController::computeWhenNewDecision(), ThresholdSaccadeController::computeWhenNewDecision(), TrivialSaccadeController::computeWhenNewDecision(), and getDecision(). |
|
|
|
Helper for derived classes to get our internal saccade/fix/smooth state.
Definition at line 291 of file SaccadeController.C. |
|
|
Do we already have any decisions queued up?
Definition at line 260 of file SaccadeController.C. Referenced by ThresholdFrictionSaccadeController::computeWhenNewDecision(), and ThresholdSaccadeController::computeWhenNewDecision(). |
|
|
Do we already have any percepts queued up?
Definition at line 236 of file SaccadeController.C. Referenced by ThresholdSaccadeController::computeWhenNewDecision(), FrictionSaccadeController::computeWhenNewDecision(), and FrictionSaccadeController::doEvolve(). |
|
|
Kill all previous decisions (empty the decision queue).
Definition at line 272 of file SaccadeController.C. |
|
|
Kill all previous percepts (empty the percept queue).
Definition at line 248 of file SaccadeController.C. |
|
|
Reset SaccadeController.
Reimplemented from ModelComponent. Reimplemented in ThresholdSaccadeController. Definition at line 73 of file SaccadeController.C. References ModelComponent::reset1(), and SACSTATE_UNK. Referenced by ThresholdSaccadeController::reset1(). |
|
|
Reset length of decision queue (contents will be lost).
Definition at line 268 of file SaccadeController.C. |
|
||||||||||||
|
Reset to an externally-given position. This will force the current position to the position given as argument, disregarding any internal physical model. So this may be used to externally drive the SaccadeController to given locations. A percept will be queued up, which will be built from the passed position/time plus default values for the WTAwinner fields. Do not overload this method, overload computeWhenReset() instead. NOTE: this will abort any current blink and will reset our internal state to fixation (if p is valid) or unknown (if p is invalid). Definition at line 98 of file SaccadeController.C. References CLDEBUG, computeWhenResetPos(), Point2D< T >::i, Point2D< T >::isValid(), Point2D< T >::j, SimTime::msecs(), SimEventQueue::now(), saccadeStateName(), SACSTATE_FIX, SACSTATE_UNK, and win. Referenced by getDecision(). |
|
|
Reset length of percept queue (contents will be lost).
Definition at line 244 of file SaccadeController.C. Referenced by ThresholdSaccadeController::start1(). |
|
||||||||||||
|
Receive a new percept (e.g., winner from saliency map). This method should be invoked by external callers each time a new percept is available. Do not overload this method, overload computeWhenNewPercept() instead if you need to perform some computation for each new percept. Definition at line 85 of file SaccadeController.C. References computeWhenNewPercept(). |
|
|
start position
Definition at line 187 of file SaccadeController.H. Referenced by getDecision(). |
1.4.4