expyriment.misc.Buffer¶
-
class
expyriment.misc.
Buffer
(name='Buffer', clock=None)¶ A class implementing a general event buffer.
-
__init__
(name='Buffer', clock=None)¶ Create an event buffer.
Parameters: name : str
the name of the buffer
clock : expyriment.Clock object (optional)
an experimental clock
-
add_event
(event)¶ Add an event to the buffer.
Parameters: event : anything
the event to add
-
add_events
(events)¶ Add a list of events to the buffer.
All events get the same time stamp!
Parameters: events : list
the event list to add
-
clear
()¶ Clear the buffer.
-
clock
¶ Getter for clock
-
get_element
(position)¶ Get an element (code, rt) from the buffer.
Parameters: position : int
the position to get the element from
Returns: element : (anything, float)
The element to get from the buffer
-
get_last_event
()¶ Get the last event (code, rt) in the buffer.
Returns: element : (anything, float)
the last element of the buffer
-
get_size
()¶ Return the number of elements in the buffer.
Returns: size : int
the size of the buffer
-
get_whole_buffer
()¶ Get a copy of the buffer.
Returns: copy : list
the copy of the buffer
-
memory
¶ Getter for memory [list of tuples (code, rt)]
-
name
¶ Getter for name
-