ACTRModels.ACTR
— TypeACTR <: AbstractACTR
An object representing an ACTR model.
Fields
name="model1"
: model namedeclarative
: declarative memory moduleimaginal
: imaginal memory modulevisual
: visual modulegoal
: goal modulevisual_location
: visual location modulevisicon
: a vector of VisualObjects available in the taskparms
: model parametersscheduler
: event scheduler- `rng': random number generator
ACTRModels.ACTR
— Methodfunction ACTR(;
+api · ACTRModels ACTRModels.ACTR
— TypeACTR <: AbstractACTR
An object representing an ACTR model.
Fields
name="model1"
: model namedeclarative
: declarative memory moduleimaginal
: imaginal memory modulevisual
: visual modulegoal
: goal modulevisual_location
: visual location modulevisicon
: a vector of VisualObjects available in the taskparms
: model parametersscheduler
: event scheduler- `rng': random number generator
sourceACTRModels.ACTR
— Methodfunction 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...)
sourceACTRModels.BufferState
— TypeBufferState(;busy, error, empty)
An object representing the state of the buffer.
Fields
busy=false
: busy if trueerror=false
: error if trueempty=true
: empty if true
sourceACTRModels.Chunk
— TypeChunk
An object representing a declarative memory chunk.
Fields
N=1.0
: number of usesL=1.0
: lifetime of chunktime_created=0.0
: time at which the chunk was createdk=1
: number of chunks in recent set (k=1 is sufficient)act=0.0
: total activationact_blc=0.0
: base level constant component of activationact_bll=0.0
: base level learning component of activationact_pm=0.0
: partial matching component of activationact_sa=0.0
: spreading activation component of activationact_noise=0.0
: noise component of activationslots
: chunk slot-value pairsreps=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 retrievalslags=Float64[]
: lags for recent retrievals (L - recent)bl=0.0
: baselevel constant added to chunks activation
sourceACTRModels.Chunk
— MethodChunk(dynamic::Bool;
+actr = ACTR(;declarative, parms...)
sourceACTRModels.BufferState
— TypeBufferState(;busy, error, empty)
An object representing the state of the buffer.
Fields
busy=false
: busy if trueerror=false
: error if trueempty=true
: empty if true
sourceACTRModels.Chunk
— TypeChunk
An object representing a declarative memory chunk.
Fields
N=1.0
: number of usesL=1.0
: lifetime of chunktime_created=0.0
: time at which the chunk was createdk=1
: number of chunks in recent set (k=1 is sufficient)act=0.0
: total activationact_blc=0.0
: base level constant component of activationact_bll=0.0
: base level learning component of activationact_pm=0.0
: partial matching component of activationact_sa=0.0
: spreading activation component of activationact_noise=0.0
: noise component of activationslots
: chunk slot-value pairsreps=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 retrievalslags=Float64[]
: lags for recent retrievals (L - recent)bl=0.0
: baselevel constant added to chunks activation
sourceACTRModels.Chunk
— MethodChunk(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 trueN=1.0
: number of usesL=1.0
: lifetime of chunktime_created=0.0
: time at which the chunk was createdk=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 activationact_bll=0.0
: base level learning component of activationact_pm=0.0
: partial matching component of activationact_sa=0.0
: spreading activation component of activationact_noise=0.0
: noise component of activationslots
: chunk slot-value pairsreps=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 retrievalslags=Float64[]
: lags for recent retrievals (L - recent)bl=0.0
: baselevel constant added to chunks activation
sourceACTRModels.Chunk
— MethodChunk(;
+ slots...)
A declarative memory chunk with dynamic slot-value pairs.
Fields
dynamic::Bool
: slot-value pairs are mutable if trueN=1.0
: number of usesL=1.0
: lifetime of chunktime_created=0.0
: time at which the chunk was createdk=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 activationact_bll=0.0
: base level learning component of activationact_pm=0.0
: partial matching component of activationact_sa=0.0
: spreading activation component of activationact_noise=0.0
: noise component of activationslots
: chunk slot-value pairsreps=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 retrievalslags=Float64[]
: lags for recent retrievals (L - recent)bl=0.0
: baselevel constant added to chunks activation
sourceACTRModels.Chunk
— MethodChunk(;
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 usesL=1.0
: lifetime of chunktime_created=0.0
: time at which the chunk was createdk=1
: number of chunks in recent set (k=1 is sufficient)act=0.0
: total activationact_blc=0.0
: base level constant component of activationact_bll=0.0
: base level learning component of activationact_pm=0.0
: partial matching component of activationact_sa=0.0
: spreading activation component of activationact_noise=0.0
: noise component of activationslots
: chunk slot-value pairsreps=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 retrievalslags=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)
sourceACTRModels.Declarative
— TypeDeclarative(;memory=, filtered=(:isa,:retrieved))
Declarative memory module
Fields
memory=Chunk[]
: array of chunksfiltered
: slots that must match exactly even when partial matching is on. By default, filtered=(:isa,:retrieved)
buffer
: an array containing one chunkstate
: buffer state
sourceACTRModels.Goal
— TypeGoal(;chunk=Chunk())
Goal Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer state
sourceACTRModels.Imaginal
— TypeImaginal(;buffer=Chunk[], ω=1.0, denoms=Int64[])
Imaginal Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer stateω=1.0
: fan weight. Default is 1.denoms=Int64[]
: cached value for the denominator of the fan calculation
sourceACTRModels.Motor
— TypeMotor(;chunk=Chunk())
Motor Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer statemouse_position
: x,y coordinates of mouse position on screen
sourceACTRModels.Parms
— TypeParms(; kwargs...) -> Parms
ACT-R parameters with default values. Default values are overwritten with keyword arguments.
Fields
d=0.5
: activation decayτ=0.0
: retrieval thresholds=0.2
: logistic scalar for activation noise.γ=1.6
: maximum associative strengthδ=0.0
: mismatch penaltyω=1.0
: weight for source of spreading activationblc=0.0
: base level constantter=0.0
: a constant for encoding and responding timedissim_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 chunkutil_mmp_fun
: utility mismatch penalty function applied to each conditionlf=1.0:
latency factor parameteru0=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 decrementutility_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 onmmp=false
: mismatch penalty onsa=false
: spreading activatin onnoise=false
: noise onmmp_utility=false
: mismatch penalty for procedural memoryutility_noise=false
: utility noise for procedural memorytmp=s * √(2)
: temperature for blendingmisc
: NamedTuple
of extra parametersfiltered:
a list of slots that must absolutely match with mismatch penalty. isa
and retrieval
are included by default
sourceACTRModels.Procedural
— TypeProcedural
Procedural Memory Module object.
Arguments
buffer
: an array holding up to one chunkstate
: buffer state
sourceACTRModels.Rule
— TypeRule(;utlity=0.0, conditions, action)
A production rule object.
Fields
utility=0.0
: utility of the production ruleinitial_utility=0.0
: initial utilityutility_mean
=0.0: mean utilityutility_penalty=0.0
: mismatch penalty term for utility utlity_noise=0.0
: utility noiseconditions
: a function for checking conditionsaction
: a function for performing an actionname
: name of production
sourceACTRModels.Visual
— TypeVisual(;chunk=Chunk())
Visual Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer statefocus
: coordinates of visual attention
sourceACTRModels.VisualLocation
— TypeVisualLocation
Visual Location Module.
Fields
buffer::Array{T1,1}
: an array holding up to one chunkstate::B
: buffer stateiconic_memory::Array{T1,1}
: a temporary memory store for visible objects
sourceACTRModels.VisualObject
— TypeVisualObject(;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 colorshape
: object shapetext
: object textwidth
: object width height
: object height
sourceACTRModels.add_chunk!
— Methodadd_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 objectcur_time=0.0
: current simulated time in seconds
Keywords
slots...
: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
sourceACTRModels.add_chunk!
— Methodadd_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
sourceACTRModels.add_chunk!
— Methodadd_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 objectcur_time=0.0
: current simulated time in secondsbl=0.0
: baselevel constant for new/updated chunk
Keywords
slots...
: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
sourceACTRModels.add_time!
— Methodadd_time!(actr::AbstractACTR, t)
Add time to simulation.
Arguments
actr::AbstractACTR
: an ACTR model objectt
: time in seconds
sourceACTRModels.add_time!
— Methodadd_time!(actr::AbstractACTR, t)
Add time to simulation.
Arguments
scheduler
: an event schedulert
: time in seconds
sourceACTRModels.blend_chunks
— Methodblend_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 blendedcur_time
: current simulated time
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.blend_chunks
— Methodblend_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
sourceACTRModels.blended_activation
— Methodblended_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
sourceACTRModels.compute_RT
— Methodcompute_RT(actr, chunk)
Generates a reaction time for retrieving a chunk based on the current activation levels of a chunk.
Arguments
actr
: ACTR objectchunk
: a chunk
sourceACTRModels.compute_RT
— Methodcompute_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 objectchunk
: a vector that is empty or contains one chunk
sourceACTRModels.compute_RT
— Methodcompute_RT(blended_act)
Computes retrieval time for a given blended activation value.
Arguments
blended_act
: a blended activation value
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr, chunk::Chunk, cur_time; request...)
Computes the activation of a chunk
Arguments
actr
: actr objectchunk::Chunk
: a chunk.cur_time
: current simulated time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr, chunk::Chunk; request...)
Computes the activation of a chunk. By default, current time is computed with get_time
.
Arguments
actr
: actr objectchunk::Chunk
: a chunk.
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr::AbstractACTR, cur_time::Float64; request...)
Computes the activation of all chunks in declarative memory
Arguments
actr::AbstractACTR
: an ACTR
objectcur_time
: current simulated time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr::AbstractACTR, chunks::Vector{<:Chunk}, cur_time::Float64; request...)
Computes the activation of a vector of chunks
Arguments
actr::AbstractACTR
: an ACTR
objectchunks::Vector{<:Chunk}
: a vector of chunks.cur_time::Float64
: current simulated time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_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
objectchunks::Vector{<:Chunk}
: a vector of chunks.
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_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
sourceACTRModels.find_index
— Methodfind_index(actr::ACTR, funs...; check_value=true, criteria...)
Returns the index of first chunk that matches a set of criteria
Arguments
actr
: ACTR objectfuns
: 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)
sourceACTRModels.find_index
— Methodfind_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 chunksfuns
: a set of functionscriteria
: 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)
sourceACTRModels.find_index
— Methodfind_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)
sourceACTRModels.find_indices
— Methodfind_indices(actr::ACTR, funs...; check_value=true, criteria...)
Returns the index of first chunk that matches a set of criteria
Arguments
actr
: an ACTR objectfuns
: 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)
sourceACTRModels.find_indices
— Methodfind_indices(actr::ACTR; check_value = true, criteria...)
Returns the index of first chunk that matches a set of criteria
Arguments
actr
: an ACTR objectcriteria
: 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)
sourceACTRModels.find_indices
— Methodfind_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 chunksfuns
: 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)
sourceACTRModels.find_indices
— Methodfind_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)
sourceACTRModels.first_chunk
— Methodfirst_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
sourceACTRModels.first_chunk
— Methodfirst_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
sourceACTRModels.first_chunk
— Methodfirst_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
sourceACTRModels.get_buffer
— Methodget_buffer(actr, m)
Returns posterior predictive distribution and optionally applies function to samples on each replication
Arguments
actr
: an ACTR objectm
: name of module as a symbol
Example
get_buffer(actr, :imaginal)
sourceACTRModels.get_chunks
— Methodget_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 objectfuns...
: a list of functions
Keywords
check_value=true
: check slot value
criteria...
: optional keyword arguments corresponding to critiria for matching chunk
sourceACTRModels.get_chunks
— Methodget_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
sourceACTRModels.get_chunks
— Methodget_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 objectfuns...
: a list of functions
Keywords
check_value=true
: check slot value
criteria...
: optional keyword arguments corresponding to critiria for matching chunk
sourceACTRModels.get_chunks
— Methodget_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
sourceACTRModels.get_chunks
— Methodget_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 objectsfuns...
: a list of functions
Keywords
check_value=true
: check slot value
criteria...
: optional keyword arguments corresponding to critiria for matching chunk
sourceACTRModels.get_chunks
— Methodget_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
sourceACTRModels.get_iconic_memory
— Methodget_iconic_memory(actr)
Returns array of chunks or visual objects representing iconic memory
Arguments
actr
: an ACTR object
sourceACTRModels.get_mean_activations
— Methodget_mean_activations(actr::AbstractACTR)
Returns a vector of mean activations i.e. activation without noise
Arguments
actr::AbstractACTR
: an ACTR object
sourceACTRModels.get_mean_activations
— Methodget_mean_activations(declarative::Declarative)
Returns a vector of mean activations i.e. activation without noise
Arguments
declarative::Declarative
: an Declarative memory object
sourceACTRModels.get_mean_activations
— Methodget_mean_activations(chunks::Vector{<:Chunk})
Returns a vector of mean activations i.e. activation without noise
Arguments
chunks::Vector{<:Chunk}
: an array of chunks
sourceACTRModels.get_name
— Methodget_name(actr::AbstractACTR)
Returns the name of an ACT-R model object.
Arguments
actr::AbstractACTR
: an ACTR model object
sourceACTRModels.get_parm
— Methodget_parm(actr, p)
Returns the value of a parameter
Arguments
actr
: ACTR objectp
: parameter name
sourceACTRModels.get_time
— Methodget_time(actr::AbstractACTR)
Get the current time of the simulation.
Arguments
actr::AbstractACTR
: an ACTR model object
sourceACTRModels.get_time
— Methodget_time(scheduler)
Get the current time of the simulation.
Arguments
scheduler
: an event scheduler
sourceACTRModels.get_visicon
— Methodget_iconic_memory(actr)
Returns array of chunks or visual objects representing all visual objects within the simulation
Arguments
actr
: an ACTR object
sourceACTRModels.modify!
— Methodmodify!(c; args...)
Modifies fields of an object
Arguments
c
: an object
Keywords
args...
: optional keywords for field and values
sourceACTRModels.modify!
— Methodmodify!(c::NamedTuple; args...)
Modifies fields of NamedTuple
Arguments
c
: a NamedTuple
Keywords
args...
: optional keywords for field and values
sourceACTRModels.posterior_predictive
— Functionposterior_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 objectn_samples
: the number of samples f
: a function that is applied to each sample from posterior predictive distribution
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objectchunk::Chunk
: a chunkcur_time
: current simulated time in seconds
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objectchunk::Chunk
: a chunk
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objecttarget::Array{<:Chunk,1}
: a vector chunks in the numerator of the softmax functioncur_time
: current time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objecttarget::Array{<:Chunk,1}
: a vector chunks in the numerator of the softmax function
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_probs
— Methodretrieval_probs(actr::AbstractACTR, cur_time; request...)
Computes the retrieval probability for each chunk matching the retrieval request.
Arguments
actr::AbstractACTR
: an actr objectcur_time
: current simulated time in seconds
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_request
— Methodretrieval_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
sourceACTRModels.retrieve
— Methodretrieve(actr::AbstractACTR, cur_time; request...)
Retrieves a chunk given a retrieval request
Arguments
actr
: an ACT-R objectcur_time
: current simulated time in seconds
Keywords
request...
: optional keyword arguments representing a retrieval request, e.g. person=:bob
sourceACTRModels.retrieve
— Methodretrieve(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)
sourceACTRModels.Declarative
— TypeDeclarative(;memory=, filtered=(:isa,:retrieved))
Declarative memory module
Fields
memory=Chunk[]
: array of chunksfiltered
: slots that must match exactly even when partial matching is on. By default, filtered=(:isa,:retrieved)
buffer
: an array containing one chunkstate
: buffer state
sourceACTRModels.Goal
— TypeGoal(;chunk=Chunk())
Goal Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer state
sourceACTRModels.Imaginal
— TypeImaginal(;buffer=Chunk[], ω=1.0, denoms=Int64[])
Imaginal Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer stateω=1.0
: fan weight. Default is 1.denoms=Int64[]
: cached value for the denominator of the fan calculation
sourceACTRModels.Motor
— TypeMotor(;chunk=Chunk())
Motor Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer statemouse_position
: x,y coordinates of mouse position on screen
sourceACTRModels.Parms
— TypeParms(; kwargs...) -> Parms
ACT-R parameters with default values. Default values are overwritten with keyword arguments.
Fields
d=0.5
: activation decayτ=0.0
: retrieval thresholds=0.2
: logistic scalar for activation noise.γ=1.6
: maximum associative strengthδ=0.0
: mismatch penaltyω=1.0
: weight for source of spreading activationblc=0.0
: base level constantter=0.0
: a constant for encoding and responding timedissim_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 chunkutil_mmp_fun
: utility mismatch penalty function applied to each conditionlf=1.0:
latency factor parameteru0=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 decrementutility_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 onmmp=false
: mismatch penalty onsa=false
: spreading activatin onnoise=false
: noise onmmp_utility=false
: mismatch penalty for procedural memoryutility_noise=false
: utility noise for procedural memorytmp=s * √(2)
: temperature for blendingmisc
: NamedTuple
of extra parametersfiltered:
a list of slots that must absolutely match with mismatch penalty. isa
and retrieval
are included by default
sourceACTRModels.Procedural
— TypeProcedural
Procedural Memory Module object.
Arguments
buffer
: an array holding up to one chunkstate
: buffer state
sourceACTRModels.Rule
— TypeRule(;utlity=0.0, conditions, action)
A production rule object.
Fields
utility=0.0
: utility of the production ruleinitial_utility=0.0
: initial utilityutility_mean
=0.0: mean utilityutility_penalty=0.0
: mismatch penalty term for utility utlity_noise=0.0
: utility noiseconditions
: a function for checking conditionsaction
: a function for performing an actionname
: name of production
sourceACTRModels.Visual
— TypeVisual(;chunk=Chunk())
Visual Module.
Fields
buffer
: an array holding up to one chunkstate
: buffer statefocus
: coordinates of visual attention
sourceACTRModels.VisualLocation
— TypeVisualLocation
Visual Location Module.
Fields
buffer::Array{T1,1}
: an array holding up to one chunkstate::B
: buffer stateiconic_memory::Array{T1,1}
: a temporary memory store for visible objects
sourceACTRModels.VisualObject
— TypeVisualObject(;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 colorshape
: object shapetext
: object textwidth
: object width height
: object height
sourceACTRModels.add_chunk!
— Methodadd_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 objectcur_time=0.0
: current simulated time in seconds
Keywords
slots...
: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
sourceACTRModels.add_chunk!
— Methodadd_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
sourceACTRModels.add_chunk!
— Methodadd_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 objectcur_time=0.0
: current simulated time in secondsbl=0.0
: baselevel constant for new/updated chunk
Keywords
slots...
: optional keyword arguments corresponding to slot-value pairs, e.g. name=:Bob
sourceACTRModels.add_time!
— Methodadd_time!(actr::AbstractACTR, t)
Add time to simulation.
Arguments
actr::AbstractACTR
: an ACTR model objectt
: time in seconds
sourceACTRModels.add_time!
— Methodadd_time!(actr::AbstractACTR, t)
Add time to simulation.
Arguments
scheduler
: an event schedulert
: time in seconds
sourceACTRModels.blend_chunks
— Methodblend_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 blendedcur_time
: current simulated time
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.blend_chunks
— Methodblend_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
sourceACTRModels.blended_activation
— Methodblended_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
sourceACTRModels.compute_RT
— Methodcompute_RT(actr, chunk)
Generates a reaction time for retrieving a chunk based on the current activation levels of a chunk.
Arguments
actr
: ACTR objectchunk
: a chunk
sourceACTRModels.compute_RT
— Methodcompute_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 objectchunk
: a vector that is empty or contains one chunk
sourceACTRModels.compute_RT
— Methodcompute_RT(blended_act)
Computes retrieval time for a given blended activation value.
Arguments
blended_act
: a blended activation value
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr, chunk::Chunk, cur_time; request...)
Computes the activation of a chunk
Arguments
actr
: actr objectchunk::Chunk
: a chunk.cur_time
: current simulated time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr, chunk::Chunk; request...)
Computes the activation of a chunk. By default, current time is computed with get_time
.
Arguments
actr
: actr objectchunk::Chunk
: a chunk.
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr::AbstractACTR, cur_time::Float64; request...)
Computes the activation of all chunks in declarative memory
Arguments
actr::AbstractACTR
: an ACTR
objectcur_time
: current simulated time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_activation!(actr::AbstractACTR, chunks::Vector{<:Chunk}, cur_time::Float64; request...)
Computes the activation of a vector of chunks
Arguments
actr::AbstractACTR
: an ACTR
objectchunks::Vector{<:Chunk}
: a vector of chunks.cur_time::Float64
: current simulated time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_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
objectchunks::Vector{<:Chunk}
: a vector of chunks.
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.compute_activation!
— Methodcompute_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
sourceACTRModels.find_index
— Methodfind_index(actr::ACTR, funs...; check_value=true, criteria...)
Returns the index of first chunk that matches a set of criteria
Arguments
actr
: ACTR objectfuns
: 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)
sourceACTRModels.find_index
— Methodfind_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 chunksfuns
: a set of functionscriteria
: 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)
sourceACTRModels.find_index
— Methodfind_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)
sourceACTRModels.find_indices
— Methodfind_indices(actr::ACTR, funs...; check_value=true, criteria...)
Returns the index of first chunk that matches a set of criteria
Arguments
actr
: an ACTR objectfuns
: 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)
sourceACTRModels.find_indices
— Methodfind_indices(actr::ACTR; check_value = true, criteria...)
Returns the index of first chunk that matches a set of criteria
Arguments
actr
: an ACTR objectcriteria
: 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)
sourceACTRModels.find_indices
— Methodfind_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 chunksfuns
: 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)
sourceACTRModels.find_indices
— Methodfind_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)
sourceACTRModels.first_chunk
— Methodfirst_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
sourceACTRModels.first_chunk
— Methodfirst_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
sourceACTRModels.first_chunk
— Methodfirst_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
sourceACTRModels.get_buffer
— Methodget_buffer(actr, m)
Returns posterior predictive distribution and optionally applies function to samples on each replication
Arguments
actr
: an ACTR objectm
: name of module as a symbol
Example
get_buffer(actr, :imaginal)
sourceACTRModels.get_chunks
— Methodget_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 objectfuns...
: a list of functions
Keywords
check_value=true
: check slot value
criteria...
: optional keyword arguments corresponding to critiria for matching chunk
sourceACTRModels.get_chunks
— Methodget_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
sourceACTRModels.get_chunks
— Methodget_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 objectfuns...
: a list of functions
Keywords
check_value=true
: check slot value
criteria...
: optional keyword arguments corresponding to critiria for matching chunk
sourceACTRModels.get_chunks
— Methodget_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
sourceACTRModels.get_chunks
— Methodget_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 objectsfuns...
: a list of functions
Keywords
check_value=true
: check slot value
criteria...
: optional keyword arguments corresponding to critiria for matching chunk
sourceACTRModels.get_chunks
— Methodget_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
sourceACTRModels.get_iconic_memory
— Methodget_iconic_memory(actr)
Returns array of chunks or visual objects representing iconic memory
Arguments
actr
: an ACTR object
sourceACTRModels.get_mean_activations
— Methodget_mean_activations(actr::AbstractACTR)
Returns a vector of mean activations i.e. activation without noise
Arguments
actr::AbstractACTR
: an ACTR object
sourceACTRModels.get_mean_activations
— Methodget_mean_activations(declarative::Declarative)
Returns a vector of mean activations i.e. activation without noise
Arguments
declarative::Declarative
: an Declarative memory object
sourceACTRModels.get_mean_activations
— Methodget_mean_activations(chunks::Vector{<:Chunk})
Returns a vector of mean activations i.e. activation without noise
Arguments
chunks::Vector{<:Chunk}
: an array of chunks
sourceACTRModels.get_name
— Methodget_name(actr::AbstractACTR)
Returns the name of an ACT-R model object.
Arguments
actr::AbstractACTR
: an ACTR model object
sourceACTRModels.get_parm
— Methodget_parm(actr, p)
Returns the value of a parameter
Arguments
actr
: ACTR objectp
: parameter name
sourceACTRModels.get_time
— Methodget_time(actr::AbstractACTR)
Get the current time of the simulation.
Arguments
actr::AbstractACTR
: an ACTR model object
sourceACTRModels.get_time
— Methodget_time(scheduler)
Get the current time of the simulation.
Arguments
scheduler
: an event scheduler
sourceACTRModels.get_visicon
— Methodget_iconic_memory(actr)
Returns array of chunks or visual objects representing all visual objects within the simulation
Arguments
actr
: an ACTR object
sourceACTRModels.modify!
— Methodmodify!(c; args...)
Modifies fields of an object
Arguments
c
: an object
Keywords
args...
: optional keywords for field and values
sourceACTRModels.modify!
— Methodmodify!(c::NamedTuple; args...)
Modifies fields of NamedTuple
Arguments
c
: a NamedTuple
Keywords
args...
: optional keywords for field and values
sourceACTRModels.posterior_predictive
— Functionposterior_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 objectn_samples
: the number of samples f
: a function that is applied to each sample from posterior predictive distribution
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objectchunk::Chunk
: a chunkcur_time
: current simulated time in seconds
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objectchunk::Chunk
: a chunk
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objecttarget::Array{<:Chunk,1}
: a vector chunks in the numerator of the softmax functioncur_time
: current time in seconds
Keywords
request...
: optional keywords for the retrieval request
sourceACTRModels.retrieval_prob
— Methodretrieval_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 objecttarget::Array{<:Chunk,1}
: a vector chunks in the numerator of the softmax function
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_probs
— Methodretrieval_probs(actr::AbstractACTR, cur_time; request...)
Computes the retrieval probability for each chunk matching the retrieval request.
Arguments
actr::AbstractACTR
: an actr objectcur_time
: current simulated time in seconds
Keywords
request...
: optional keyword pairs representing a retrieval request
sourceACTRModels.retrieval_request
— Methodretrieval_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
sourceACTRModels.retrieve
— Methodretrieve(actr::AbstractACTR, cur_time; request...)
Retrieves a chunk given a retrieval request
Arguments
actr
: an ACT-R objectcur_time
: current simulated time in seconds
Keywords
request...
: optional keyword arguments representing a retrieval request, e.g. person=:bob
sourceACTRModels.retrieve
— Methodretrieve(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)
sourceACTRModels.set_buffer!
— Methodget_buffer(actr, m)
Returns posterior predictive distribution and optionally applies function to samples on each replication
Arguments
actr
: an ACTR objectm
: name of module as a symbolv
: new value
Example
set_buffer!(actr, :imaginal, [chunk])
sourceACTRModels.update_chunk!
— Methodupdate_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
sourceACTRModels.update_lags!
— Methodupdate_lags!(chunk::Chunk, cur_time)
Compute lags for each use of a chunk.
Arguments
chunk::Chunks
: a chunkcur_time
: current simulated time in seconds.
sourceACTRModels.update_lags!
— Methodupdate_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 objectcur_time
: current simulated time in seconds
sourceACTRModels.update_lags!
— Methodupdate_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 objectcur_time
: current simulated time in seconds
sourceACTRModels.update_recent!
— Methodupdate_recent!(chunk, cur_time)
Adds a new timestamp to chunk and removes oldest timestamp if length equals k.
Arguments
chunk
: memory chunk objectcur_time
: current simulated time in seconds
sourceACTRModels.update_recent!
— Methodupdate_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
sourceBase.match
— Methodmatch(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 objectfuns...
: a list of functions such as !=, ==
request...
: a NamedTuple of slot value pairs
sourceBase.match
— Methodmatch(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
sourceSettings
This document was generated with Documenter.jl version 1.2.1 on Tuesday 5 December 2023. Using Julia version 1.9.4.
+retrieve(actr; country=:Germany)
ACTRModels.set_buffer!
— Methodget_buffer(actr, m)
Returns posterior predictive distribution and optionally applies function to samples on each replication
Arguments
actr
: an ACTR objectm
: name of module as a symbolv
: new value
Example
set_buffer!(actr, :imaginal, [chunk])
ACTRModels.update_chunk!
— Methodupdate_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
ACTRModels.update_lags!
— Methodupdate_lags!(chunk::Chunk, cur_time)
Compute lags for each use of a chunk.
Arguments
chunk::Chunks
: a chunkcur_time
: current simulated time in seconds.
ACTRModels.update_lags!
— Methodupdate_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 objectcur_time
: current simulated time in seconds
ACTRModels.update_lags!
— Methodupdate_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 objectcur_time
: current simulated time in seconds
ACTRModels.update_recent!
— Methodupdate_recent!(chunk, cur_time)
Adds a new timestamp to chunk and removes oldest timestamp if length equals k.
Arguments
chunk
: memory chunk objectcur_time
: current simulated time in seconds
ACTRModels.update_recent!
— Methodupdate_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 objectchunk
: memory chunk object
Base.match
— Methodmatch(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 objectfuns...
: a list of functions such as!=, ==
request...
: a NamedTuple of slot value pairs
Base.match
— Methodmatch(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