buffer

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package buffer implements ACT-R buffers.

Index

Constants

View Source
const (
	BuiltIn    = true
	NotBuiltIn = false
)

Variables

This section is empty.

Functions

func IsValidState added in v0.12.0

func IsValidState(state string) bool

IsValidState checks if 'state' is a valid buffer state.

func ValidStatesStr added in v0.12.0

func ValidStatesStr() string

ValidStatesStr returns a list of (sorted) valid buffer states. Used for error output.

Types

type Interface added in v0.12.0

type Interface interface {
	Name() string
	IsBuiltIn() bool

	DefaultSpreadingActivation() float64
	SpreadingActivation() float64

	Parameters() param.ParametersInterface
	SetParam(param *keyvalue.KeyValue) error

	RequestParameters() param.ParametersInterface
	SetRequestParam(param *keyvalue.KeyValue) error
}

func NewBuffer added in v0.12.0

func NewBuffer(name string, builtIn bool, spreadingActivation float64, requestParameters param.ParametersInterface) Interface

type List added in v0.12.0

type List []Interface

List is a list of buffers that we provide operations on

func (List) At added in v0.12.0

func (l List) At(index int) Interface

At returns the buffer at "index" or nil if out of range

func (List) Count added in v0.12.0

func (l List) Count() int

Count returns the number of buffers in the list

func (List) Has added in v0.12.0

func (l List) Has(name string) bool

Has returns true if the buffer "name" exists

func (List) Lookup added in v0.12.0

func (l List) Lookup(name string) Interface

Lookup looks up a buffer by name (returns nil if not found)

func (List) Names added in v0.12.0

func (l List) Names() (names []string)

Names returns the list of buffer names

type ListInterface added in v0.12.0

type ListInterface interface {
	Count() int
	Names() []string
	Has(name string) bool
	At(index int) *Interface
	Lookup(name string) Interface
}

ListInterface defines functions we can call on a List

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL