| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
Controller
Control parameters.
This abstract base class defines the interface to any controller.
Methods:
returns_type() -- Get the type of the value returned by the eval functions
during_go_eval() -- Evaluate controller during the main 'go' loop.
between_go_eval() -- Evaluate controller between runs of the main 'go' loop.
The during_go_eval() and between_go_eval() methods are called to
update a particular parameter such as the position of a stimulus
on the screen. These methods must return a value specified by the
returns_type() method. These methods are called at particular
intervals as specified by eval_frequency and with temporal
parameters specified by temporal_variables (see below for more
details). Also, see the documentation for the Presentation class.
Attributes:
return_type -- type of the value returned by the eval functions
eval_frequency -- when eval functions called (see above)
temporal_variables -- what time variables used (see above)
A Controller instance's attribute "eval_frequency" controls when a
controller is evaluated. This variable is a bitwise "or" (the |
operator) of the following flags:
EVERY_FRAME -- every frame
TRANSITIONS -- on enter and exit from go loop
ONCE -- at the next chance possible (see below)
NOT_DURING_GO -- as above, but never during go loop (see below)
NOT_BETWEEN_GO -- as above, but never between go loops (see below)
The ONCE flag is automatically unset after evaluation,
hence its name. As an example, if eval_frequency is set to
ONCE | TRANSITIONS, it will be evaluated
before drawing the next frame and then only before and after the
go loop.
NOT_DURING_GO and NOT_BETWEEN_GO modify other behavior. For
example, to evaluate a controller on every frame during go loops
but not between go loops:
eval_frequency = EVERY_FRAME | NOT_BETWEEN_GO
If none of the above flags is set, the value is:
NEVER -- this controller is never called
A Controller instance's attribute "temporal_variables" controls
what time variables are set for use. This variable is a bitwise
"or" of the following flags:
TIME_SEC_ABSOLUTE -- seconds, continuously increasing
TIME_SEC_SINCE_GO -- seconds, reset to 0.0 each go loop
FRAMES_ABSOLUTE -- frames, continuously increasing
FRAMES_SINCE_GO -- frames, reset to 0 each go loop
If none of these flags is set, the value is:
TIME_INDEPENDENT -- No temporal variables.
When the eval methods (during_go_eval and between_go_eval) are
called, attributes are set depending on the temporal variables
used:
temporal_variable attribute set
----------------- -------------
TIME_SEC_ABSOLUTE self.time_sec_absolute
TIME_SEC_SINCE_GO self.time_sec_since_go
FRAMES_ABSOLUTE self.frames_absolute
FRAMES_SINCE_GO self.frames_since_go
Other information:
Instances of Controller are called by instances of the
Presentation class. during_go_eval() is called during a go()
loop, and between_go_eval() is called by between_presentations()
(during run_forever(), for example). Before calling these
methods, attributes of the controller are set accoring to
ttribute{temporal_variables}.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
| Class Variables | |
TIME_INDEPENDENT = 0x00
|
|
TIME_SEC_ABSOLUTE = 0x01
|
|
TIME_SEC_SINCE_GO = 0x02
|
|
FRAMES_ABSOLUTE = 0x04
|
|
FRAMES_SINCE_GO = 0x08
|
|
NEVER = 0x00
|
|
EVERY_FRAME = 0x01
|
|
TRANSITIONS = 0x02
|
|
ONCE = 0x04
|
|
NOT_DURING_GO = 0x08
|
|
NOT_BETWEEN_GO = 0x10
|
|
flag_dictionary = {'TIME_INDEPENDENT': TIME_INDEPENDENT, 'TIME
|
|
| Properties | |
|
Inherited from |
| Method Details |
Create instance of Controller. Arguments: eval_frequency -- Int, bitwise "or" of flags temporal_variables -- Int, bitwise "or" of flags return_type -- Set to type() of the parameter under control
|
Called by Presentation. Get the return type of this controller. |
Called by Presentation. Evaluate during the main 'go' loop. Override this method in subclasses. |
Called by Presentation. Evaluate between runs of the main 'go' loop. Override this method in subclasses. |
| Class Variable Details |
flag_dictionary
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Sat Jun 7 09:06:46 2008 | http://epydoc.sourceforge.net |