diff --git a/README.md b/README.md index b2d2ebe..b564112 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,25 @@ [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://itsdfish.github.io/ACTRModels.jl/dev/) The goal of ACTRModels.jl is to provide basic types and functions for developing models based on the [ACT-R](https://en.wikipedia.org/wiki/ACT-R) cognitive architecture. Please see the documentation for installation instructions, working examples, and related pacakges. + + +# Simple Example + +```julia +using ACTRModels + +# create chunks of declarative knowledge +chunks = [Chunk(; name = :Bob, department = :accounting), + Chunk(; name = :Alice, department = :HR)] +# initialize declarative memory +declarative = Declarative(memory = chunks) + +# specify model parameters: partial matching, noise, mismatch penalty, activation noise +Θ = (mmp = true, noise = true, δ = 1.0, s = 0.20) + +# create an ACT-R object with activation noise and partial matching +actr = ACTR(; declarative, Θ...) + +# retrieve a chunk +chunk = retrieve(actr; department = :accounting) +``` diff --git a/test/benchmarks.jl b/test/benchmarks.jl deleted file mode 100644 index 863e17d..0000000 --- a/test/benchmarks.jl +++ /dev/null @@ -1,72 +0,0 @@ -using ACTRModels, BenchmarkTools -n = 10 -parms = (sa = false, mmp = true, γ = 1.3, δ = 1.0) -chunks = [Chunk(; s1 = j, s2 = j) for j = 1:n for k = 1:n] -memory = Declarative(; memory = chunks) -actr = ACTR(; declarative = memory, parms...) -println("Partial Activation n $n") -@btime compute_activation!($actr; s1 = 1, s2 = 1); - -parms = (sa = true, mmp = true, γ = 1.3, δ = 1.0) -memory = Declarative(; memory = chunks) -imaginal = Imaginal(; buffer = Chunk(; s1 = 2, s2 = 1)) -actr = ACTR(; declarative = memory, imaginal = imaginal, parms...) -println("Spreading Activation n $n") -@btime compute_activation!($actr; s1 = 1, s2 = 1); - -parms = (noise = true,) -memory = Declarative(; memory = chunks) -actr = ACTR(; declarative = memory, parms...) -println("Activation Noise n $n") -@btime compute_activation!($actr); - -n = 100 -parms = (sa = false, mmp = true, γ = 1.3, δ = 1.0) -chunks = [Chunk(; s1 = j, s2 = j) for j = 1:n for k = 1:n] -memory = Declarative(; memory = chunks) -actr = ACTR(; declarative = memory, parms...) -println("Partial Activation n $n") -@btime compute_activation!($actr; s1 = 1, s2 = 1); - -parms = (sa = true, mmp = true, γ = 1.3, δ = 1.0) -memory = Declarative(; memory = chunks) -imaginal = Imaginal(; buffer = Chunk(; s1 = 2, s2 = 1)) -actr = ACTR(; declarative = memory, imaginal = imaginal, parms...) -println("Spreading Activation n $n") -@btime compute_activation!($actr; s1 = 1, s2 = 1); - -parms = (noise = true,) -memory = Declarative(; memory = chunks) -actr = ACTR(; declarative = memory, parms...) -println("Activation Noise n $n") -@btime compute_activation!($actr); - -n = 10 -parms = (sa = false, mmp = true, γ = 1.3, δ = 1.0) -chunks = [Chunk(; s1 = j, s2 = j) for j = 1:n for k = 1:n] -memory = Declarative(; memory = chunks) -actr = ACTR(; declarative = memory, parms...) -println("Partial Activation n $n") -@btime retrieval_probs($actr; s1 = 1, s2 = 1); - -parms = (sa = true, mmp = true, γ = 1.3, δ = 1.0) -memory = Declarative(; memory = chunks) -imaginal = Imaginal(; buffer = Chunk(; s1 = 2, s2 = 1)) -actr = ACTR(; declarative = memory, imaginal = imaginal, parms...) -println("Spreading Activation n $n") -@btime retrieval_probs($actr; s1 = 1, s2 = 1); - -n = 100 -parms = (sa = false, mmp = true, γ = 1.3, δ = 1.0) -chunks = [Chunk(; s1 = j, s2 = j) for j = 1:n for k = 1:n] -memory = Declarative(; memory = chunks) -actr = ACTR(; declarative = memory, parms...) -println("Partial Activation n $n") -@btime retrieval_probs($actr; s1 = 1, s2 = 1); - -parms = (sa = true, mmp = true, γ = 1.3, δ = 1.0) -memory = Declarative(; memory = chunks) -imaginal = Imaginal(; buffer = Chunk(; s1 = 2, s2 = 1)) -actr = ACTR(; declarative = memory, imaginal = imaginal, parms...) -println("Spreading Activation n $n") -@btime retrieval_probs($actr; s1 = 1, s2 = 1);