diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 4cbf9d6..546f2b1 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-05T17:41:54","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-01-22T12:25:47","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index a4af030..ee4ff89 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,5 +1,5 @@ -api · ACTRModels
ACTRModels.ACTRType
ACTR <: AbstractACTR

An object representing an ACTR model.

Fields

  • name="model1": model name
  • declarative: declarative memory module
  • imaginal: imaginal memory module
  • visual: visual module
  • goal: goal module
  • visual_location: visual location module
  • visicon: a vector of VisualObjects available in the task
  • parms: model parameters
  • scheduler: event scheduler
  • `rng': random number generator
source
ACTRModels.ACTRMethod
function ACTR(;
+api · ACTRModels
ACTRModels.ACTRType
ACTR <: AbstractACTR

An object representing an ACTR model.

Fields

  • name="model1": model name
  • declarative: declarative memory module
  • imaginal: imaginal memory module
  • visual: visual module
  • goal: goal module
  • visual_location: visual location module
  • visicon: a vector of VisualObjects available in the task
  • parms: model parameters
  • scheduler: event scheduler
  • `rng': random number generator
source
ACTRModels.ACTRMethod
function ACTR(;
     name="model1", 
     declarative=Declarative(), 
     imaginal=Imaginal(), 
@@ -16,7 +16,7 @@
 parms = (noise=true, τ=-1.0)
 chunks = [Chunk(;animal=:dog,name=:Sigma), Chunk(;animal=:rat,name=:Bonkers)]
 declarative = Declarative(;memory=chunks)
-actr = ACTR(;declarative, parms...)
source
ACTRModels.BufferStateType
BufferState(;busy, error, empty)

An object representing the state of the buffer.

Fields

  • busy=false: busy if true
  • error=false: error if true
  • empty=true: empty if true
source
ACTRModels.ChunkType
Chunk

An object representing a declarative memory chunk.

Fields

  • N=1.0: number of uses
  • L=1.0: lifetime of chunk
  • time_created=0.0: time at which the chunk was created
  • k=1: number of chunks in recent set (k=1 is sufficient)
  • act=0.0: total activation
  • act_blc=0.0: base level constant component of activation
  • act_bll=0.0: base level learning component of activation
  • act_pm=0.0: partial matching component of activation
  • act_sa=0.0: spreading activation component of activation
  • act_noise=0.0: noise component of activation
  • slots: chunk slot-value pairs
  • reps=0: number of identical chunks. This can be used in simple cases to speed up the code.
  • recent=[0.0]: time stamps for k recent retrievals
  • lags=Float64[]: lags for recent retrievals (L - recent)
  • bl=0.0: baselevel constant added to chunks activation
source
ACTRModels.BufferStateType
BufferState(;busy, error, empty)

An object representing the state of the buffer.

Fields

  • busy=false: busy if true
  • error=false: error if true
  • empty=true: empty if true
source
ACTRModels.ChunkType
Chunk

An object representing a declarative memory chunk.

Fields

  • N=1.0: number of uses
  • L=1.0: lifetime of chunk
  • time_created=0.0: time at which the chunk was created
  • k=1: number of chunks in recent set (k=1 is sufficient)
  • act=0.0: total activation
  • act_blc=0.0: base level constant component of activation
  • act_bll=0.0: base level learning component of activation
  • act_pm=0.0: partial matching component of activation
  • act_sa=0.0: spreading activation component of activation
  • act_noise=0.0: noise component of activation
  • slots: chunk slot-value pairs
  • reps=0: number of identical chunks. This can be used in simple cases to speed up the code.
  • recent=[0.0]: time stamps for k recent retrievals
  • lags=Float64[]: lags for recent retrievals (L - recent)
  • bl=0.0: baselevel constant added to chunks activation
source
ACTRModels.ChunkMethod
Chunk(dynamic::Bool; 
     N = 1,
     L = 1.0,
     time_created = 0.0,
@@ -26,7 +26,7 @@
     reps = 0, 
     lags = Float64[], 
     bl = zero(typeof(act)),
-    slots...)

A declarative memory chunk with dynamic slot-value pairs.

Fields

  • dynamic::Bool: slot-value pairs are mutable if true
  • N=1.0: number of uses
  • L=1.0: lifetime of chunk
  • time_created=0.0: time at which the chunk was created
  • k=1: number of chunks in recent set (k=1 is sufficient)
  • act_mean: mean activation computed as act - act_noise
  • act=0.0: total activation computed as act_mean + act_noise
  • act_blc=0.0: base level constant component of activation
  • act_bll=0.0: base level learning component of activation
  • act_pm=0.0: partial matching component of activation
  • act_sa=0.0: spreading activation component of activation
  • act_noise=0.0: noise component of activation
  • slots: chunk slot-value pairs
  • reps=0: number of identical chunks. This can be used in simple cases to speed up the code.
  • recent=[0.0]: time stamps for k recent retrievals
  • lags=Float64[]: lags for recent retrievals (L - recent)
  • bl=0.0: baselevel constant added to chunks activation
source
ACTRModels.ChunkMethod
Chunk(;
+    slots...)

A declarative memory chunk with dynamic slot-value pairs.

Fields

  • dynamic::Bool: slot-value pairs are mutable if true
  • N=1.0: number of uses
  • L=1.0: lifetime of chunk
  • time_created=0.0: time at which the chunk was created
  • k=1: number of chunks in recent set (k=1 is sufficient)
  • act_mean: mean activation computed as act - act_noise
  • act=0.0: total activation computed as act_mean + act_noise
  • act_blc=0.0: base level constant component of activation
  • act_bll=0.0: base level learning component of activation
  • act_pm=0.0: partial matching component of activation
  • act_sa=0.0: spreading activation component of activation
  • act_noise=0.0: noise component of activation
  • slots: chunk slot-value pairs
  • reps=0: number of identical chunks. This can be used in simple cases to speed up the code.
  • recent=[0.0]: time stamps for k recent retrievals
  • lags=Float64[]: lags for recent retrievals (L - recent)
  • bl=0.0: baselevel constant added to chunks activation
source
ACTRModels.ChunkMethod
Chunk(;
     N = 1,
     L = 1.0,
     time_created = 0.0,
@@ -38,17 +38,17 @@
     bl = zero(typeof(act)),
     slots...)

An object representing a declarative memory chunk.

Keywords

  • N=1.0: number of uses
  • L=1.0: lifetime of chunk
  • time_created=0.0: time at which the chunk was created
  • k=1: number of chunks in recent set (k=1 is sufficient)
  • act=0.0: total activation
  • act_blc=0.0: base level constant component of activation
  • act_bll=0.0: base level learning component of activation
  • act_pm=0.0: partial matching component of activation
  • act_sa=0.0: spreading activation component of activation
  • act_noise=0.0: noise component of activation
  • slots: chunk slot-value pairs
  • reps=0: number of identical chunks. This can be used in simple cases to speed up the code.
  • recent=[0.0]: time stamps for k recent retrievals
  • lags=Float64[]: lags for recent retrievals (L - recent)
  • bl=0.0: baselevel constant added to chunks activation

Example

using ACTRModels
 
-chunk = Chunk(; name = :Bonkers, animal = :rat)
source
ACTRModels.DeclarativeType
Declarative(;memory=, filtered=(:isa,:retrieved))

Declarative memory module

Fields

  • memory=Chunk[]: array of chunks
  • filtered: slots that must match exactly even when partial matching is on. By default, filtered=(:isa,:retrieved)
  • buffer: an array containing one chunk
  • state: buffer state
source
ACTRModels.GoalType
Goal(;chunk=Chunk())

Goal Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
source
ACTRModels.ImaginalType
Imaginal(;buffer=Chunk[], ω=1.0, denoms=Int64[])

Imaginal Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
  • ω=1.0: fan weight. Default is 1.
  • denoms=Int64[]: cached value for the denominator of the fan calculation
source
ACTRModels.MotorType
Motor(;chunk=Chunk())

Motor Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
  • mouse_position: x,y coordinates of mouse position on screen
source
ACTRModels.ParmsType
Parms(; kwargs...) -> Parms

ACT-R parameters with default values. Default values are overwritten with keyword arguments.

Fields

  • d=0.5: activation decay
  • τ=0.0: retrieval threshold
  • s=0.2: logistic scalar for activation noise.
  • γ=1.6: maximum associative strength
  • δ=0.0: mismatch penalty
  • ω=1.0: weight for source of spreading activation
  • blc=0.0: base level constant
  • ter=0.0: a constant for encoding and responding time
  • dissim_func: computes dissimilarity between two slot values. Output ranges from 0 (maximally similar) to 1 (maximially dissimilar)
  • sa_fun: a function for spreading activation which requires arguments for actr and chunk
  • util_mmp_fun: utility mismatch penalty function applied to each condition
  • lf=1.0: latency factor parameter
  • u0=0.0: initial utility value
  • σu=.2: standard deviation of utility noise
  • δu=1.0: mismatch penalty parameter for utility
  • τu0 = -100: initial value of utility threshold
  • `τu = τu0': utility threshold
  • u0Δ = 1.0: utility decrement
  • τuΔ = 1.0: utility threshold decrement
  • utility_decrement=1.0: the utility decrement scalar. After each microlapse, utility_decrement is multiplied by u0Δ
  • threshold_decrement=1.0: the threshold decrement scalar. After each microlapse, threshold_decrement is multiplied by τuΔ
  • bll=false: base level learning on
  • mmp=false: mismatch penalty on
  • sa=false: spreading activatin on
  • noise=false: noise on
  • mmp_utility=false: mismatch penalty for procedural memory
  • utility_noise=false: utility noise for procedural memory
  • tmp=s * √(2): temperature for blending
  • misc: NamedTuple of extra parameters
  • filtered: a list of slots that must absolutely match with mismatch penalty. isa and retrieval are included by default
source
ACTRModels.ProceduralType
Procedural

Procedural Memory Module object.

Arguments

  • buffer: an array holding up to one chunk
  • state: buffer state
source
ACTRModels.RuleType
Rule(;utlity=0.0, conditions, action)

A production rule object.

Fields

  • utility=0.0: utility of the production rule
  • initial_utility=0.0: initial utility
  • utility_mean=0.0: mean utility
  • utility_penalty=0.0: mismatch penalty term for utility
  • utlity_noise=0.0: utility noise
  • conditions: a function for checking conditions
  • action: a function for performing an action
  • name: name of production
source
ACTRModels.VisualType
Visual(;chunk=Chunk())

Visual Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
  • focus: coordinates of visual attention
source
ACTRModels.VisualLocationType
VisualLocation

Visual Location Module.

Fields

  • buffer::Array{T1,1}: an array holding up to one chunk
  • state::B: buffer state
  • iconic_memory::Array{T1,1}: a temporary memory store for visible objects
source
ACTRModels.VisualObjectType
VisualObject(;x=300.0, y=300.0, color=:black, text="", shape=:_, width=30.0, height=30.0)

A visible object in a task.

Fields

  • x: x coordinate of visual object. Default 0.
  • y: y coordinate of visual object. Default 0.
  • color: object color
  • shape: object shape
  • text: object text
  • width: object width
  • height: object height
source
ACTRModels.add_chunk!Method
add_chunk!(actr::AbstractACTR, cur_time=0.0; slots...)

Adds new chunk to declarative memory or updates existing chunk with new use

Arguments

  • actr::AbstractACTR: an ACT-R model object
  • cur_time=0.0: current simulated time in seconds

Keywords

  • slots...: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
source
ACTRModels.add_chunk!Method
add_chunk!(actr::AbstractACTR; slots...)

Adds new chunk to declarative memory or updates existing chunk with new use. The default time is computed from get_time.

Arguments

  • actr::AbstractACTR: an ACT-R model object

Keywords

  • slots...: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
source
ACTRModels.add_chunk!Method
add_chunk!(memory::Declarative, cur_time=0.0; act=0.0, slots...)

Adds new chunk to declarative memory or updates existing chunk with new use

Arguments

  • memory::Declarative: declarative memory object
  • cur_time=0.0: current simulated time in seconds
  • bl=0.0: baselevel constant for new/updated chunk

Keywords

  • slots...: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
source
ACTRModels.add_time!Method
add_time!(actr::AbstractACTR, t)

Add time to simulation.

Arguments

  • actr::AbstractACTR: an ACTR model object
  • t: time in seconds
source
ACTRModels.add_time!Method
add_time!(actr::AbstractACTR, t)

Add time to simulation.

Arguments

  • scheduler: an event scheduler
  • t: time in seconds
source
ACTRModels.blend_chunksMethod
blend_chunks(actr, blended_slots, cur_time; request...)

Computes blended value over chunks given a retrieval request. Values are blended over the slots specified in blended_slots. Currently, blended is only supported for numeric slot-values.

Arguments

  • actr: an ACTR model object
  • blended_slots: a set of slots over which slot-values are blended
  • cur_time: current simulated time

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.blend_chunksMethod
blend_chunks(actr::AbstractACTR, blended_slots; request...)

Computes blended value over chunks given a retrieval request. By default, values are blended over the set of slots formed by the set difference between all slots of a chunk and the slots specified in the retrieval request. The default time used in activation calculations is taken from get_time(actr). Currently, blended is only supported for numeric slot-values.

Arguments

  • actr::AbstractACTR: an ACTR model object
  • blended_slots: a set of slots over which slot-values are blended

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.blended_activationMethod
blended_activation(chunks)

Computes a blended activation value by exponentiating, summing and taking the log of activations across a set of chunks.

Arguments

  • chunks: a set of chunks over which slot-values are blended
source
ACTRModels.compute_RTMethod
compute_RT(actr, chunk)

Generates a reaction time for retrieving a chunk based on the current activation levels of a chunk.

Arguments

  • actr: ACTR object
  • chunk: a chunk
source
ACTRModels.compute_RTMethod
compute_RT(actr, chunk)

Generates a reaction time for retrieving a chunk based on the current activation levels of a chunk. If the vector is empty, time for a retrieval failure is returned.

Arguments

  • actr: ACTR object
  • chunk: a vector that is empty or contains one chunk
source
ACTRModels.compute_RTMethod
compute_RT(blended_act)

Computes retrieval time for a given blended activation value.

Arguments

  • blended_act: a blended activation value
source
ACTRModels.compute_activation!Method
compute_activation!(actr, chunk::Chunk, cur_time; request...)

Computes the activation of a chunk

Arguments

  • actr: actr object
  • chunk::Chunk: a chunk.
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr, chunk::Chunk; request...)

Computes the activation of a chunk. By default, current time is computed with get_time.

Arguments

  • actr: actr object
  • chunk::Chunk: a chunk.

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR, cur_time::Float64; request...)

Computes the activation of all chunks in declarative memory

Arguments

  • actr::AbstractACTR: an ACTR object
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR, chunks::Vector{<:Chunk}, cur_time::Float64; request...)

Computes the activation of a vector of chunks

Arguments

  • actr::AbstractACTR: an ACTR object
  • chunks::Vector{<:Chunk}: a vector of chunks.
  • cur_time::Float64: current simulated time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR, chunks::Vector{<:Chunk}; request...)

Computes the activation of a vector of chunks. By default, current time is computed with get_time.

Arguments

  • actr::AbstractACTR: an ACTR object
  • chunks::Vector{<:Chunk}: a vector of chunks.

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR; request...)

Computes the activation of all chunks in declarative memory. By default, current time is computed with get_time.

Arguments

  • actr::AbstractACTR: an ACTR object

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.find_indexMethod
find_index(actr::ACTR, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • actr: ACTR object
  • funs: a set of functions

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=cat)]
-find_index(chunks; animal=:dog)
source
ACTRModels.find_indexMethod
find_index(chunks::Array{<:Chunk,1}, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • chunks: an array of chunks
  • funs: a set of functions
  • criteria: a set of keyword arguments for slot-value pairs

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs
chunks = [Chunk(animal=:dog), Chunk(animal=cat)]
-find_index(chunks; animal=:dog)
source
ACTRModels.find_indexMethod
find_index(chunks::Array{<:Chunk,1}; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • chunks: an array of chunks

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=cat)]
-find_index(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(actr::ACTR, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • actr: an ACTR object
  • funs: a set of functions

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
-find_indices(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(actr::ACTR; check_value = true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • actr: an ACTR object
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
-find_indices(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(chunks::Array{<:Chunk,1}, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria.

Arguments

  • chunks: an array of chunks
  • funs: a set of functions

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
-find_indices(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(chunks::Array{<:Chunk,1}; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • chunks: an array of chunks

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
-find_indices(chunks; animal=:dog)
source
ACTRModels.first_chunkMethod
first_chunk(actr::AbstractACTR; check_value=true, criteria...)

Returns the first chunk in memory that matches a set of criteria

Arguments

  • actr::AbstractACTR: an ACT-R model object

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.first_chunkMethod
first_chunk(d::Declarative; criteria...)

Returns the first chunk in memory that matches a set of criteria

Arguments

  • d::Declarative: a declarative memory object

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.first_chunkMethod
first_chunk(memory::Vector{<:Chunk}; check_value=true, criteria...)

Returns the first chunk in memory that matches a set of criteria

Arguments

  • memory::Vector{<:Chunk}: a vector of chunks

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_bufferMethod
get_buffer(actr, m)

Returns posterior predictive distribution and optionally applies function to samples on each replication

Arguments

  • actr: an ACTR object
  • m: name of module as a symbol

Example

get_buffer(actr, :imaginal)
source
ACTRModels.get_chunksMethod
get_chunks(actr::AbstractACTR, funs...; check_value=true, criteria...)

Returns all chunks that matches a set criteria using funs... as matching functions.

Arguments

  • actr::AbstractACTR: an ACT-R model object
  • funs...: a list of functions

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(actr::AbstractACTR; check_value=true, criteria...)

Returns all chunks that matches a set criteria

Arguments

  • actr::AbstractACTR: an ACTR Object

#Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(d::Declarative, funs...; check_value=true, criteria...)

Returns all chunks that matches a set criteria using funs... as matching functions

Arguments

  • d::Declarative: declarative memory object
  • funs...: a list of functions

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(d::Declarative; check_value=true, criteria...)

Returns all chunks that matches a set criteria.

Arguments

  • d::Declarative: declarative memory object

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(memory::Vector{<:Chunk}, funs...; check_value=true, criteria...)

Returns all chunks that matches a set criteria which are evaluted according to the list of functions in funs.

Arguments

  • memory::Vector{<:Chunk}: vector of chunk objects
  • funs...: a list of functions

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(memory::Vector{<:Chunk}; check_value=true, criteria...)

Returns all chunks that matches a set criteria.

Arguments

  • memory::Vector{<:Chunk}: vector of chunk objects

Keywords

  • check_value=true: check slot value

-criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_mean_activationsMethod
get_mean_activations(actr::AbstractACTR)

Returns a vector of mean activations i.e. activation without noise

Arguments

  • actr::AbstractACTR: an ACTR object
source
ACTRModels.get_mean_activationsMethod
get_mean_activations(declarative::Declarative)

Returns a vector of mean activations i.e. activation without noise

Arguments

  • declarative::Declarative: an Declarative memory object
source
ACTRModels.get_mean_activationsMethod
get_mean_activations(chunks::Vector{<:Chunk})

Returns a vector of mean activations i.e. activation without noise

Arguments

  • chunks::Vector{<:Chunk}: an array of chunks
source
ACTRModels.get_nameMethod
get_name(actr::AbstractACTR)

Returns the name of an ACT-R model object.

Arguments

  • actr::AbstractACTR: an ACTR model object
source
ACTRModels.get_parmMethod
get_parm(actr, p)

Returns the value of a parameter

Arguments

  • actr: ACTR object
  • p: parameter name
source
ACTRModels.get_timeMethod
get_time(actr::AbstractACTR)

Get the current time of the simulation.

Arguments

  • actr::AbstractACTR: an ACTR model object
source
ACTRModels.get_timeMethod
get_time(scheduler)

Get the current time of the simulation.

Arguments

  • scheduler: an event scheduler
source
ACTRModels.get_visiconMethod
get_iconic_memory(actr)

Returns array of chunks or visual objects representing all visual objects within the simulation

Arguments

  • actr: an ACTR object
source
ACTRModels.modify!Method
modify!(c; args...)

Modifies fields of an object

Arguments

  • c: an object

Keywords

  • args...: optional keywords for field and values
source
ACTRModels.modify!Method
modify!(c::NamedTuple; args...)

Modifies fields of NamedTuple

Arguments

  • c: a NamedTuple

Keywords

  • args...: optional keywords for field and values
source
ACTRModels.posterior_predictiveFunction
posterior_predictive(model, chain, n_samples::Int, f=x -> x)

Returns posterior predictive distribution and optionally applies function to samples on each replication

  • model: the data generating function of a model
  • chain: an MCMCChains chain object
  • n_samples: the number of samples
  • f: a function that is applied to each sample from posterior predictive distribution
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, chunk::Chunk, cur_time=0.0; request...)

Uses the softmax approximation to compute the retrieval probability of retrieving a chunk.

Arguments

  • actr::AbstractACTR: an ACT-R object
  • chunk::Chunk: a chunk
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, chunk::Chunk; request...)

Uses the softmax approximation to compute the retrieval probability of retrieving a chunk. By default, current time is computed from get_time.

Arguments

  • actr::AbstractACTR: an ACT-R object
  • chunk::Chunk: a chunk

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, target::Array{<:Chunk,1}, cur_time; request...)

Computes the retrieval probability of one chunk from a set of chunks defined in target. Retrieval probability is computed with the softmax approximation.

Arguments

  • actr::AbstractACTR: an actr object
  • target::Array{<:Chunk,1}: a vector chunks in the numerator of the softmax function
  • cur_time: current time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, target::Array{<:Chunk,1}; request...)

Uses the softmax approximation to compute the retrieval probability of retrieving a chunk. By default, current time is computed from get_time.

Arguments

  • actr::AbstractACTR: an ACT-R object
  • target::Array{<:Chunk,1}: a vector chunks in the numerator of the softmax function

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_probsMethod
retrieval_probs(actr::AbstractACTR, cur_time; request...)

Computes the retrieval probability for each chunk matching the retrieval request.

Arguments

  • actr::AbstractACTR: an actr object
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_requestMethod
retrieval_request(actr::AbstractACTR; request...)

Returns chunks matching a retrieval request.

Arguments

  • memory: declarative memory object

Keywords

  • request...: optional keyword arguments corresponding to retrieval request e.g. dog = :fiddo
source
ACTRModels.retrieveMethod
retrieve(actr::AbstractACTR, cur_time; request...)

Retrieves a chunk given a retrieval request

Arguments

  • actr: an ACT-R object
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keyword arguments representing a retrieval request, e.g. person=:bob
source
ACTRModels.retrieveMethod
retrieve(actr::AbstractACTR; request...)

Retrieves a chunk given a retrieval request. By default, current time is computed with get_time.

Arguments

  • actr: an ACT-R object

Keywords

  • request...: optional keyword arguments representing a retrieval request, e.g. person=:bob

Example

using ACTRModels 
+chunk = Chunk(; name = :Bonkers, animal = :rat)
source
ACTRModels.DeclarativeType
Declarative(;memory=, filtered=(:isa,:retrieved))

Declarative memory module

Fields

  • memory=Chunk[]: array of chunks
  • filtered: slots that must match exactly even when partial matching is on. By default, filtered=(:isa,:retrieved)
  • buffer: an array containing one chunk
  • state: buffer state
source
ACTRModels.GoalType
Goal(;chunk=Chunk())

Goal Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
source
ACTRModels.ImaginalType
Imaginal(;buffer=Chunk[], ω=1.0, denoms=Int64[])

Imaginal Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
  • ω=1.0: fan weight. Default is 1.
  • denoms=Int64[]: cached value for the denominator of the fan calculation
source
ACTRModels.MotorType
Motor(;chunk=Chunk())

Motor Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
  • mouse_position: x,y coordinates of mouse position on screen
source
ACTRModels.ParmsType
Parms(; kwargs...) -> Parms

ACT-R parameters with default values. Default values are overwritten with keyword arguments.

Fields

  • d=0.5: activation decay
  • τ=0.0: retrieval threshold
  • s=0.2: logistic scalar for activation noise.
  • γ=1.6: maximum associative strength
  • δ=0.0: mismatch penalty
  • ω=1.0: weight for source of spreading activation
  • blc=0.0: base level constant
  • ter=0.0: a constant for encoding and responding time
  • dissim_func: computes dissimilarity between two slot values. Output ranges from 0 (maximally similar) to 1 (maximially dissimilar)
  • sa_fun: a function for spreading activation which requires arguments for actr and chunk
  • util_mmp_fun: utility mismatch penalty function applied to each condition
  • lf=1.0: latency factor parameter
  • u0=0.0: initial utility value
  • σu=.2: standard deviation of utility noise
  • δu=1.0: mismatch penalty parameter for utility
  • τu0 = -100: initial value of utility threshold
  • `τu = τu0': utility threshold
  • u0Δ = 1.0: utility decrement
  • τuΔ = 1.0: utility threshold decrement
  • utility_decrement=1.0: the utility decrement scalar. After each microlapse, utility_decrement is multiplied by u0Δ
  • threshold_decrement=1.0: the threshold decrement scalar. After each microlapse, threshold_decrement is multiplied by τuΔ
  • bll=false: base level learning on
  • mmp=false: mismatch penalty on
  • sa=false: spreading activatin on
  • noise=false: noise on
  • mmp_utility=false: mismatch penalty for procedural memory
  • utility_noise=false: utility noise for procedural memory
  • tmp=s * √(2): temperature for blending
  • misc: NamedTuple of extra parameters
  • filtered: a list of slots that must absolutely match with mismatch penalty. isa and retrieval are included by default
source
ACTRModels.ProceduralType
Procedural

Procedural Memory Module object.

Arguments

  • buffer: an array holding up to one chunk
  • state: buffer state
source
ACTRModels.RuleType
Rule(;utlity=0.0, conditions, action)

A production rule object.

Fields

  • utility=0.0: utility of the production rule
  • initial_utility=0.0: initial utility
  • utility_mean=0.0: mean utility
  • utility_penalty=0.0: mismatch penalty term for utility
  • utlity_noise=0.0: utility noise
  • conditions: a function for checking conditions
  • action: a function for performing an action
  • name: name of production
source
ACTRModels.VisualType
Visual(;chunk=Chunk())

Visual Module.

Fields

  • buffer: an array holding up to one chunk
  • state: buffer state
  • focus: coordinates of visual attention
source
ACTRModels.VisualLocationType
VisualLocation

Visual Location Module.

Fields

  • buffer::Array{T1,1}: an array holding up to one chunk
  • state::B: buffer state
  • iconic_memory::Array{T1,1}: a temporary memory store for visible objects
source
ACTRModels.VisualObjectType
VisualObject(;x=300.0, y=300.0, color=:black, text="", shape=:_, width=30.0, height=30.0)

A visible object in a task.

Fields

  • x: x coordinate of visual object. Default 0.
  • y: y coordinate of visual object. Default 0.
  • color: object color
  • shape: object shape
  • text: object text
  • width: object width
  • height: object height
source
ACTRModels.add_chunk!Method
add_chunk!(actr::AbstractACTR, cur_time=0.0; slots...)

Adds new chunk to declarative memory or updates existing chunk with new use

Arguments

  • actr::AbstractACTR: an ACT-R model object
  • cur_time=0.0: current simulated time in seconds

Keywords

  • slots...: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
source
ACTRModels.add_chunk!Method
add_chunk!(actr::AbstractACTR; slots...)

Adds new chunk to declarative memory or updates existing chunk with new use. The default time is computed from get_time.

Arguments

  • actr::AbstractACTR: an ACT-R model object

Keywords

  • slots...: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
source
ACTRModels.add_chunk!Method
add_chunk!(memory::Declarative, cur_time=0.0; act=0.0, slots...)

Adds new chunk to declarative memory or updates existing chunk with new use

Arguments

  • memory::Declarative: declarative memory object
  • cur_time=0.0: current simulated time in seconds
  • bl=0.0: baselevel constant for new/updated chunk

Keywords

  • slots...: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
source
ACTRModels.add_time!Method
add_time!(actr::AbstractACTR, t)

Add time to simulation.

Arguments

  • actr::AbstractACTR: an ACTR model object
  • t: time in seconds
source
ACTRModels.add_time!Method
add_time!(actr::AbstractACTR, t)

Add time to simulation.

Arguments

  • scheduler: an event scheduler
  • t: time in seconds
source
ACTRModels.blend_chunksMethod
blend_chunks(actr, blended_slots, cur_time; request...)

Computes blended value over chunks given a retrieval request. Values are blended over the slots specified in blended_slots. Currently, blended is only supported for numeric slot-values.

Arguments

  • actr: an ACTR model object
  • blended_slots: a set of slots over which slot-values are blended
  • cur_time: current simulated time

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.blend_chunksMethod
blend_chunks(actr::AbstractACTR, blended_slots; request...)

Computes blended value over chunks given a retrieval request. By default, values are blended over the set of slots formed by the set difference between all slots of a chunk and the slots specified in the retrieval request. The default time used in activation calculations is taken from get_time(actr). Currently, blended is only supported for numeric slot-values.

Arguments

  • actr::AbstractACTR: an ACTR model object
  • blended_slots: a set of slots over which slot-values are blended

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.blended_activationMethod
blended_activation(chunks)

Computes a blended activation value by exponentiating, summing and taking the log of activations across a set of chunks.

Arguments

  • chunks: a set of chunks over which slot-values are blended
source
ACTRModels.compute_RTMethod
compute_RT(actr, chunk)

Generates a reaction time for retrieving a chunk based on the current activation levels of a chunk.

Arguments

  • actr: ACTR object
  • chunk: a chunk
source
ACTRModels.compute_RTMethod
compute_RT(actr, chunk)

Generates a reaction time for retrieving a chunk based on the current activation levels of a chunk. If the vector is empty, time for a retrieval failure is returned.

Arguments

  • actr: ACTR object
  • chunk: a vector that is empty or contains one chunk
source
ACTRModels.compute_RTMethod
compute_RT(blended_act)

Computes retrieval time for a given blended activation value.

Arguments

  • blended_act: a blended activation value
source
ACTRModels.compute_activation!Method
compute_activation!(actr, chunk::Chunk, cur_time; request...)

Computes the activation of a chunk

Arguments

  • actr: actr object
  • chunk::Chunk: a chunk.
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr, chunk::Chunk; request...)

Computes the activation of a chunk. By default, current time is computed with get_time.

Arguments

  • actr: actr object
  • chunk::Chunk: a chunk.

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR, cur_time::Float64; request...)

Computes the activation of all chunks in declarative memory

Arguments

  • actr::AbstractACTR: an ACTR object
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR, chunks::Vector{<:Chunk}, cur_time::Float64; request...)

Computes the activation of a vector of chunks

Arguments

  • actr::AbstractACTR: an ACTR object
  • chunks::Vector{<:Chunk}: a vector of chunks.
  • cur_time::Float64: current simulated time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR, chunks::Vector{<:Chunk}; request...)

Computes the activation of a vector of chunks. By default, current time is computed with get_time.

Arguments

  • actr::AbstractACTR: an ACTR object
  • chunks::Vector{<:Chunk}: a vector of chunks.

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.compute_activation!Method
compute_activation!(actr::AbstractACTR; request...)

Computes the activation of all chunks in declarative memory. By default, current time is computed with get_time.

Arguments

  • actr::AbstractACTR: an ACTR object

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.find_indexMethod
find_index(actr::ACTR, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • actr: ACTR object
  • funs: a set of functions

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=cat)]
+find_index(chunks; animal=:dog)
source
ACTRModels.find_indexMethod
find_index(chunks::Array{<:Chunk,1}, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • chunks: an array of chunks
  • funs: a set of functions
  • criteria: a set of keyword arguments for slot-value pairs

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs
chunks = [Chunk(animal=:dog), Chunk(animal=cat)]
+find_index(chunks; animal=:dog)
source
ACTRModels.find_indexMethod
find_index(chunks::Array{<:Chunk,1}; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • chunks: an array of chunks

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=cat)]
+find_index(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(actr::ACTR, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • actr: an ACTR object
  • funs: a set of functions

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
+find_indices(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(actr::ACTR; check_value = true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • actr: an ACTR object
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
+find_indices(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(chunks::Array{<:Chunk,1}, funs...; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria.

Arguments

  • chunks: an array of chunks
  • funs: a set of functions

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
+find_indices(chunks; animal=:dog)
source
ACTRModels.find_indicesMethod
find_indices(chunks::Array{<:Chunk,1}; check_value=true, criteria...)

Returns the index of first chunk that matches a set of criteria

Arguments

  • chunks: an array of chunks

Keywords

  • check_value=true:
  • criteria: a set of keyword arguments for slot-value pairs

Example

chunks = [Chunk(animal=:dog), Chunk(animal=:dog), Chunk(animal=cat)]
+find_indices(chunks; animal=:dog)
source
ACTRModels.first_chunkMethod
first_chunk(actr::AbstractACTR; check_value=true, criteria...)

Returns the first chunk in memory that matches a set of criteria

Arguments

  • actr::AbstractACTR: an ACT-R model object

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.first_chunkMethod
first_chunk(d::Declarative; criteria...)

Returns the first chunk in memory that matches a set of criteria

Arguments

  • d::Declarative: a declarative memory object

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.first_chunkMethod
first_chunk(memory::Vector{<:Chunk}; check_value=true, criteria...)

Returns the first chunk in memory that matches a set of criteria

Arguments

  • memory::Vector{<:Chunk}: a vector of chunks

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_bufferMethod
get_buffer(actr, m)

Returns posterior predictive distribution and optionally applies function to samples on each replication

Arguments

  • actr: an ACTR object
  • m: name of module as a symbol

Example

get_buffer(actr, :imaginal)
source
ACTRModels.get_chunksMethod
get_chunks(actr::AbstractACTR, funs...; check_value=true, criteria...)

Returns all chunks that matches a set criteria using funs... as matching functions.

Arguments

  • actr::AbstractACTR: an ACT-R model object
  • funs...: a list of functions

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(actr::AbstractACTR; check_value=true, criteria...)

Returns all chunks that matches a set criteria

Arguments

  • actr::AbstractACTR: an ACTR Object

#Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(d::Declarative, funs...; check_value=true, criteria...)

Returns all chunks that matches a set criteria using funs... as matching functions

Arguments

  • d::Declarative: declarative memory object
  • funs...: a list of functions

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(d::Declarative; check_value=true, criteria...)

Returns all chunks that matches a set criteria.

Arguments

  • d::Declarative: declarative memory object

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(memory::Vector{<:Chunk}, funs...; check_value=true, criteria...)

Returns all chunks that matches a set criteria which are evaluted according to the list of functions in funs.

Arguments

  • memory::Vector{<:Chunk}: vector of chunk objects
  • funs...: a list of functions

Keywords

  • check_value=true: check slot value

  • criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_chunksMethod
get_chunks(memory::Vector{<:Chunk}; check_value=true, criteria...)

Returns all chunks that matches a set criteria.

Arguments

  • memory::Vector{<:Chunk}: vector of chunk objects

Keywords

  • check_value=true: check slot value

-criteria...: optional keyword arguments corresponding to critiria for matching chunk

source
ACTRModels.get_mean_activationsMethod
get_mean_activations(actr::AbstractACTR)

Returns a vector of mean activations i.e. activation without noise

Arguments

  • actr::AbstractACTR: an ACTR object
source
ACTRModels.get_mean_activationsMethod
get_mean_activations(declarative::Declarative)

Returns a vector of mean activations i.e. activation without noise

Arguments

  • declarative::Declarative: an Declarative memory object
source
ACTRModels.get_mean_activationsMethod
get_mean_activations(chunks::Vector{<:Chunk})

Returns a vector of mean activations i.e. activation without noise

Arguments

  • chunks::Vector{<:Chunk}: an array of chunks
source
ACTRModels.get_nameMethod
get_name(actr::AbstractACTR)

Returns the name of an ACT-R model object.

Arguments

  • actr::AbstractACTR: an ACTR model object
source
ACTRModels.get_parmMethod
get_parm(actr, p)

Returns the value of a parameter

Arguments

  • actr: ACTR object
  • p: parameter name
source
ACTRModels.get_timeMethod
get_time(actr::AbstractACTR)

Get the current time of the simulation.

Arguments

  • actr::AbstractACTR: an ACTR model object
source
ACTRModels.get_timeMethod
get_time(scheduler)

Get the current time of the simulation.

Arguments

  • scheduler: an event scheduler
source
ACTRModels.get_visiconMethod
get_iconic_memory(actr)

Returns array of chunks or visual objects representing all visual objects within the simulation

Arguments

  • actr: an ACTR object
source
ACTRModels.modify!Method
modify!(c; args...)

Modifies fields of an object

Arguments

  • c: an object

Keywords

  • args...: optional keywords for field and values
source
ACTRModels.modify!Method
modify!(c::NamedTuple; args...)

Modifies fields of NamedTuple

Arguments

  • c: a NamedTuple

Keywords

  • args...: optional keywords for field and values
source
ACTRModels.posterior_predictiveFunction
posterior_predictive(model, chain, n_samples::Int, f=x -> x)

Returns posterior predictive distribution and optionally applies function to samples on each replication

  • model: the data generating function of a model
  • chain: an MCMCChains chain object
  • n_samples: the number of samples
  • f: a function that is applied to each sample from posterior predictive distribution
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, chunk::Chunk, cur_time=0.0; request...)

Uses the softmax approximation to compute the retrieval probability of retrieving a chunk.

Arguments

  • actr::AbstractACTR: an ACT-R object
  • chunk::Chunk: a chunk
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, chunk::Chunk; request...)

Uses the softmax approximation to compute the retrieval probability of retrieving a chunk. By default, current time is computed from get_time.

Arguments

  • actr::AbstractACTR: an ACT-R object
  • chunk::Chunk: a chunk

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, target::Array{<:Chunk,1}, cur_time; request...)

Computes the retrieval probability of one chunk from a set of chunks defined in target. Retrieval probability is computed with the softmax approximation.

Arguments

  • actr::AbstractACTR: an actr object
  • target::Array{<:Chunk,1}: a vector chunks in the numerator of the softmax function
  • cur_time: current time in seconds

Keywords

  • request...: optional keywords for the retrieval request
source
ACTRModels.retrieval_probMethod
retrieval_prob(actr::AbstractACTR, target::Array{<:Chunk,1}; request...)

Uses the softmax approximation to compute the retrieval probability of retrieving a chunk. By default, current time is computed from get_time.

Arguments

  • actr::AbstractACTR: an ACT-R object
  • target::Array{<:Chunk,1}: a vector chunks in the numerator of the softmax function

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_probsMethod
retrieval_probs(actr::AbstractACTR, cur_time; request...)

Computes the retrieval probability for each chunk matching the retrieval request.

Arguments

  • actr::AbstractACTR: an actr object
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keyword pairs representing a retrieval request
source
ACTRModels.retrieval_requestMethod
retrieval_request(actr::AbstractACTR; request...)

Returns chunks matching a retrieval request.

Arguments

  • memory: declarative memory object

Keywords

  • request...: optional keyword arguments corresponding to retrieval request e.g. dog = :fiddo
source
ACTRModels.retrieveMethod
retrieve(actr::AbstractACTR, cur_time; request...)

Retrieves a chunk given a retrieval request

Arguments

  • actr: an ACT-R object
  • cur_time: current simulated time in seconds

Keywords

  • request...: optional keyword arguments representing a retrieval request, e.g. person=:bob
source
ACTRModels.retrieveMethod
retrieve(actr::AbstractACTR; request...)

Retrieves a chunk given a retrieval request. By default, current time is computed with get_time.

Arguments

  • actr: an ACT-R object

Keywords

  • request...: optional keyword arguments representing a retrieval request, e.g. person=:bob

Example

using ACTRModels 
 chunks = [Chunk(country=:Germany, capitol=:Berlin),
         Chunk(country=:Australia, capitol=:Canberra)]
 declarative = Declarative(memory=chunks)
 parms = (noise=true, s=0.20)
 actr = ACTR(;declarative, parms...)
-retrieve(actr; country=:Germany)
source
ACTRModels.set_buffer!Method
get_buffer(actr, m)

Returns posterior predictive distribution and optionally applies function to samples on each replication

Arguments

  • actr: an ACTR object
  • m: name of module as a symbol
  • v: new value

Example

set_buffer!(actr, :imaginal, [chunk])
source
ACTRModels.update_chunk!Method
update_chunk!(chunk, cur_time)

Increments number of uses and adds cur_time as the most recent time of use.

Arguments

  • chunk: a chunk object
  • `cur_time': current simulated time in seconds
source
ACTRModels.update_lags!Method
update_lags!(chunk::Chunk, cur_time)

Compute lags for each use of a chunk.

Arguments

  • chunk::Chunks: a chunk
  • cur_time: current simulated time in seconds.
source
ACTRModels.update_lags!Method
update_lags!(actr::AbstractACTR, cur_time)

Compute lags for each use of a chunk. Applies to all chunks in declarative memory.

Arguments

  • actr::AbstractACTR: an ACTR object
  • cur_time: current simulated time in seconds
source
ACTRModels.update_lags!Method
update_lags!(memory::Declarative, cur_time)

Compute lags for each use of a chunk. Applies to all chunks in declarative memory.

Arguments

  • memory::Declarative: a declarative memory object object
  • cur_time: current simulated time in seconds
source
ACTRModels.update_recent!Method
update_recent!(chunk, cur_time)

Adds a new timestamp to chunk and removes oldest timestamp if length equals k.

Arguments

  • chunk: memory chunk object
  • cur_time: current simulated time in seconds
source
ACTRModels.update_recent!Method
update_recent!(actr, chunk)

Adds a new timestamp to chunk and removes oldest timestamp if length equals k. By default, current time is computed with get_time.

Arguments

  • actr: an ACT-R model object
  • chunk: memory chunk object
source
Base.matchMethod
match(chunk::Chunk, funs...; request...)

Returns a boolean indicating whether a request matches a chunk. False is returned if the slot does not exist in the chunk or the value of the slot does not match the request value.

  • chunk: chunk object
  • funs...: a list of functions such as !=, ==
  • request...: a NamedTuple of slot value pairs
source
Base.matchMethod
match(chunk::Chunk; request...)

Returns a boolean indicating whether a request matches a chunk. False is returned if the slot does not exist in the chunk or the value of the slot does not match the request value.

Arguments

  • chunk::Chunk: a chunk object

Keywords

  • request...: optional keyword arguments corresponding to critiria for matching chunk
source
+retrieve(actr; country=:Germany)
source
ACTRModels.set_buffer!Method
get_buffer(actr, m)

Returns posterior predictive distribution and optionally applies function to samples on each replication

Arguments

  • actr: an ACTR object
  • m: name of module as a symbol
  • v: new value

Example

set_buffer!(actr, :imaginal, [chunk])
source
ACTRModels.update_chunk!Method
update_chunk!(chunk, cur_time)

Increments number of uses and adds cur_time as the most recent time of use.

Arguments

  • chunk: a chunk object
  • `cur_time': current simulated time in seconds
source
ACTRModels.update_lags!Method
update_lags!(chunk::Chunk, cur_time)

Compute lags for each use of a chunk.

Arguments

  • chunk::Chunks: a chunk
  • cur_time: current simulated time in seconds.
source
ACTRModels.update_lags!Method
update_lags!(actr::AbstractACTR, cur_time)

Compute lags for each use of a chunk. Applies to all chunks in declarative memory.

Arguments

  • actr::AbstractACTR: an ACTR object
  • cur_time: current simulated time in seconds
source
ACTRModels.update_lags!Method
update_lags!(memory::Declarative, cur_time)

Compute lags for each use of a chunk. Applies to all chunks in declarative memory.

Arguments

  • memory::Declarative: a declarative memory object object
  • cur_time: current simulated time in seconds
source
ACTRModels.update_recent!Method
update_recent!(chunk, cur_time)

Adds a new timestamp to chunk and removes oldest timestamp if length equals k.

Arguments

  • chunk: memory chunk object
  • cur_time: current simulated time in seconds
source
ACTRModels.update_recent!Method
update_recent!(actr, chunk)

Adds a new timestamp to chunk and removes oldest timestamp if length equals k. By default, current time is computed with get_time.

Arguments

  • actr: an ACT-R model object
  • chunk: memory chunk object
source
Base.matchMethod
match(chunk::Chunk, funs...; request...)

Returns a boolean indicating whether a request matches a chunk. False is returned if the slot does not exist in the chunk or the value of the slot does not match the request value.

  • chunk: chunk object
  • funs...: a list of functions such as !=, ==
  • request...: a NamedTuple of slot value pairs
source
Base.matchMethod
match(chunk::Chunk; request...)

Returns a boolean indicating whether a request matches a chunk. False is returned if the slot does not exist in the chunk or the value of the slot does not match the request value.

Arguments

  • chunk::Chunk: a chunk object

Keywords

  • request...: optional keyword arguments corresponding to critiria for matching chunk
source
diff --git a/dev/example1/index.html b/dev/example1/index.html index 7c13333..12c3357 100644 --- a/dev/example1/index.html +++ b/dev/example1/index.html @@ -29,4 +29,4 @@ │ (name = :Alice, department = :HR) │ 1.00 │ 1.00 │ 0.00 │ [0.0] │ ⋯ └───────────────────────────────────┴───────┴───────┴──────────────┴────────┴─── 7 columns omitted -

Compute Retrieval Time

Retrieval time is computed by passing the ACT-R model object and the retried vector to the function compute_RT. If the vector chunk is empty, the retrieval failure time will be based on the retrieval threshold, τ.

rt = compute_RT(actr, chunk)
1.4156841175710067

References

Anderson, J. R., Bothell, D., Byrne, M. D., Douglass, S., Lebiere, C., & Qin, Y. (2004). An integrated theory of the mind. Psychological review, 111(4), 1036.

+

Compute Retrieval Time

Retrieval time is computed by passing the ACT-R model object and the retried vector to the function compute_RT. If the vector chunk is empty, the retrieval failure time will be based on the retrieval threshold, τ.

rt = compute_RT(actr, chunk)
1.4156841175710067

References

Anderson, J. R., Bothell, D., Byrne, M. D., Douglass, S., Lebiere, C., & Qin, Y. (2004). An integrated theory of the mind. Psychological review, 111(4), 1036.

diff --git a/dev/example2/44487238.svg b/dev/example2/779a57c0.svg similarity index 65% rename from dev/example2/44487238.svg rename to dev/example2/779a57c0.svg index 66437e5..bc1e0a1 100644 --- a/dev/example2/44487238.svg +++ b/dev/example2/779a57c0.svg @@ -1,187 +1,136 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/example2/index.html b/dev/example2/index.html index f6c2f79..c28bfbc 100644 --- a/dev/example2/index.html +++ b/dev/example2/index.html @@ -40,4 +40,4 @@ └───────────┴──────────────────────────────────────────┘

Compute Log Likelihood

Finally, we can use logpdf to compute the log likelihood of the retrieved chunk:

# log pdf of retrieval time
 logpdf(dist, chunk_idx, rt)
0.12250738399636082

PDF Overlay

One way to verify the likelihood function works is to overlay the PDF on a histogram of simulated data (both based on the same parameters). As expected, the orange line, which represents the PDF, fits the grey histogram well.

histogram(dist; xlims=(0,2.5))
-plot!(dist; t_range=range(0, 2.5, length=100))
Example block output

References

Fisher, C. R., Houpt, J. W., & Gunzelmann, G. (2022). Fundamental tools for developing likelihood functions within ACT-R. Journal of Mathematical Psychology, 107, 102636.

Rouder, J. N., Province, J. M., Morey, R. D., Gomez, P., & Heathcote, A. (2015). The lognormal race: A cognitive-process model of choice and latency with desirable psychometric properties. Psychometrika, 80, 491-513.

+plot!(dist; t_range=range(0, 2.5, length=100))Example block output

References

Fisher, C. R., Houpt, J. W., & Gunzelmann, G. (2022). Fundamental tools for developing likelihood functions within ACT-R. Journal of Mathematical Psychology, 107, 102636.

Rouder, J. N., Province, J. M., Morey, R. D., Gomez, P., & Heathcote, A. (2015). The lognormal race: A cognitive-process model of choice and latency with desirable psychometric properties. Psychometrika, 80, 491-513.

diff --git a/dev/example3/a97d8824.svg b/dev/example3/9199ff9b.svg similarity index 72% rename from dev/example3/a97d8824.svg rename to dev/example3/9199ff9b.svg index 1d0733a..ef6ae68 100644 --- a/dev/example3/a97d8824.svg +++ b/dev/example3/9199ff9b.svg @@ -1,495 +1,495 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/example3/index.html b/dev/example3/index.html index ab15189..f5dcc66 100644 --- a/dev/example3/index.html +++ b/dev/example3/index.html @@ -43,4 +43,4 @@ 3.0423003313083212 3.0068536237380363

Plot Results

The distribution of blended values for each option is plotted below.

histogram(blended_values1, norm=true, xlabel="Blended Values", ylabel="Density", label="Option 1", alpha=.75)
 histogram!(blended_values2, norm=true, xlabel="Blended Values", ylabel="Density", label="Option 2", alpha=.75)
-histogram!(blended_values3, norm=true, xlabel="Blended Values", ylabel="Density", label="Option 3", alpha=.75)
Example block output +histogram!(blended_values3, norm=true, xlabel="Blended Values", ylabel="Density", label="Option 3", alpha=.75)Example block output diff --git a/dev/index.html b/dev/index.html index 05063f6..b98dd83 100644 --- a/dev/index.html +++ b/dev/index.html @@ -39,4 +39,4 @@ │ (name = :Bonkers, animal = :rat) │ 1.00 │ 1.00 │ 0.00 │ [0.0] │ ⋯ └──────────────────────────────────┴───────┴───────┴──────────────┴────────┴──── 7 columns omitted -

References

Anderson, J. R., Bothell, D., Byrne, M. D., Douglass, S., Lebiere, C., & Qin, Y. (2004). An integrated theory of the mind. Psychological review, 111(4), 1036.

+

References

Anderson, J. R., Bothell, D., Byrne, M. D., Douglass, S., Lebiere, C., & Qin, Y. (2004). An integrated theory of the mind. Psychological review, 111(4), 1036.