expyriment.misc.Buffer

class expyriment.misc.Buffer(name='Buffer', clock=None)[source]

A class implementing a general event buffer.

Methods

__init__(name='Buffer', clock=None)[source]

Create an event buffer.

Parameters:

name : str

the name of the buffer

clock : expyriment.Clock object (optional)

an experimental clock

add_event(event)[source]

Add an event to the buffer.

Parameters:

event : anything

the event to add

add_events(events)[source]

Add a list of events to the buffer.

All events get the same time stamp!

Parameters:

events : list

the event list to add

clear()[source]

Clear the buffer.

clock

Getter for clock

get_element(position)[source]

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()[source]

Get the last event (code, rt) in the buffer.

Returns:

element : (anything, float)

the last element of the buffer

get_size()[source]

Return the number of elements in the buffer.

Returns:

size : int

the size of the buffer

get_whole_buffer()[source]

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