diff --git a/actr/modules/declarative_memory.go b/actr/modules/declarative_memory.go index bc6a669..1d4bda4 100644 --- a/actr/modules/declarative_memory.go +++ b/actr/modules/declarative_memory.go @@ -96,10 +96,23 @@ type DeclarativeMemory struct { func NewDeclarativeMemory() *DeclarativeMemory { return &DeclarativeMemory{ Module: Module{ - Name: "memory", + Name: "memory", + Version: BuiltIn, + Description: "declarative memory which stores chunks from the buffers for retrieval", BufferList: buffer.List{ {Name: "retrieval", MultipleInit: true}, }, + Params: []ParamInfo{ + {"decay", "the 'base-level learning' decay parameter"}, + {"finst_size", "how many chunks are retained in memory"}, + {"finst_time", "how long the finst lasts in memory"}, + {"instantaneous_noise", "turns on the activation noise calculation & sets instantaneous noise"}, + {"latency_exponent", "latency exponent (f)"}, + {"latency_factor", "latency factor (F)"}, + {"max_spread_strength", "turns on the spreading activation calculation & sets the maximum associative strength"}, + {"mismatch_penalty", "turns on partial matching and sets the penalty in the activation equation"}, + {"retrieval_threshold", "retrieval threshold (τ)"}, + }, }, } } diff --git a/actr/modules/extra_buffers.go b/actr/modules/extra_buffers.go index 4d806be..4660f66 100644 --- a/actr/modules/extra_buffers.go +++ b/actr/modules/extra_buffers.go @@ -13,7 +13,9 @@ type ExtraBuffers struct { func NewExtraBuffers() *ExtraBuffers { return &ExtraBuffers{ Module: Module{ - Name: "extra_buffers", + Name: "extra_buffers", + Version: BuiltIn, + Description: "allows declaration of one or more extra goal-style buffers in the model", }, } } diff --git a/actr/modules/goal.go b/actr/modules/goal.go index 4fdfd0c..bb506f8 100644 --- a/actr/modules/goal.go +++ b/actr/modules/goal.go @@ -11,18 +11,23 @@ type Goal struct { // "spreading_activation": see "Spreading Activation" in "ACT-R 7.26 Reference Manual" pg. 290 // ccm (DMSpreading.weight): 1.0 - // pyactr (buffer_spreading_activation): 1.0 - // vanilla (:ga): 1.0 + // pyactr (buffer_spreading_activation): no default + // vanilla (:ga): 0.0 SpreadingActivation *float64 } func NewGoal() *Goal { return &Goal{ Module: Module{ - Name: "goal", + Name: "goal", + Version: BuiltIn, + Description: "provides a goal buffer for the model", BufferList: buffer.List{ {Name: "goal", MultipleInit: false}, }, + Params: []ParamInfo{ + {"spreading_activation", "spreading activation weight"}, + }, }, } } diff --git a/actr/modules/imaginal.go b/actr/modules/imaginal.go index 3f5b5f3..64ad1bb 100644 --- a/actr/modules/imaginal.go +++ b/actr/modules/imaginal.go @@ -19,10 +19,15 @@ type Imaginal struct { func NewImaginal() *Imaginal { return &Imaginal{ Module: Module{ - Name: "imaginal", + Name: "imaginal", + Version: BuiltIn, + Description: "provides a goal style buffer with a delay and an action buffer for manipulating the imaginal chunk", BufferList: buffer.List{ {Name: "imaginal", MultipleInit: false}, }, + Params: []ParamInfo{ + {"delay", "time it takes a request to the buffer to complete (seconds)"}, + }, }, } } diff --git a/actr/modules/modules.go b/actr/modules/modules.go index b0e450d..44351a9 100644 --- a/actr/modules/modules.go +++ b/actr/modules/modules.go @@ -6,18 +6,29 @@ import ( "github.com/asmaloney/gactar/actr/params" ) +const BuiltIn = "built-in" + // Module is an ACT-R module type Module struct { - Name string + Name string + Version string + Description string + BufferList buffer.List + + Params []ParamInfo } // ModuleInterface provides an interface for the ACT-R concept of a "module". type ModuleInterface interface { ModuleName() string + ModuleVersion() string + ModuleDescription() string Buffers() buffer.List + HasParameters() bool + ParameterNames() []string SetParam(param *params.Param) (err error) } @@ -25,6 +36,37 @@ func (m Module) ModuleName() string { return m.Name } +func (m Module) ModuleVersion() string { + return m.Version +} + +func (m Module) ModuleDescription() string { + return m.Description +} + func (m Module) Buffers() buffer.List { return m.BufferList } + +func (m Module) HasParameters() bool { + return len(m.Params) > 0 +} + +func (m Module) ParameterNames() (names []string) { + for _, param := range m.Params { + names = append(names, param.Name) + } + + return names +} + +// BuiltInModules returns a slice of all the built-in modules +func BuiltInModules() (modules []ModuleInterface) { + modules = append(modules, NewExtraBuffers()) + modules = append(modules, NewGoal()) + modules = append(modules, NewImaginal()) + modules = append(modules, NewDeclarativeMemory()) + modules = append(modules, NewProcedural()) + + return +} diff --git a/actr/modules/params.go b/actr/modules/params.go new file mode 100644 index 0000000..b881a03 --- /dev/null +++ b/actr/modules/params.go @@ -0,0 +1,6 @@ +package modules + +type ParamInfo struct { + Name string + Description string +} diff --git a/actr/modules/procedural.go b/actr/modules/procedural.go index 44f6536..093d390 100644 --- a/actr/modules/procedural.go +++ b/actr/modules/procedural.go @@ -16,7 +16,14 @@ type Procedural struct { func NewProcedural() *Procedural { return &Procedural{ - Module: Module{Name: "procedural"}, + Module: Module{ + Name: "procedural", + Version: BuiltIn, + Description: "handles production definition and execution", + Params: []ParamInfo{ + {"default_action_time", "time that it takes to fire a production (seconds)"}, + }, + }, } }