ACTRSimulators.ACTRSchedulerType
ACTRScheduler <: AbstractScheduler

An ACT-R event scheduler object.

Fields

  • events: a priority queue of events
  • time: current time of the system
  • running: simulation can run if true
  • model_trace: will print out model events if true
  • task_trace: will print out task events if true
  • store: will store a vector of completed events if true
  • complete_events: an optional vector of completed events
ACTRSimulators.ACTRSchedulerMethod
ACTRScheduler(;event=Event, time=0.0, running=true, model_trace=false, task_trace=false, store=false)

Constructor for Scheduler with default keyword values:

Keywords

  • event: a function that is executed at the specified time
  • time: the time at which the event will be execute
  • running: whether the model is running
  • model_trace: prints model trace if true
  • task_trace: prints task trace if true
  • store: stores the executed events for replay if set to true
ACTRSimulators.AbstractTaskType

AbstractTask

An abstract type for a task. A task requires the following fields:

  • visible: shows GUI if true
  • realtime: executes model in realtime if true
  • speed: speed of realtime model execution
  • scheduler: a reference to the event scheduler

A task may optionally contain the following fields:

  • screen: a vector of visual objects on the screen
  • canvas: a GUI object component
  • window: a window for the GUI

Example

The following is an example of the task object for the PVT.

mutable struct PVT{T,W,C,F1,F2} <: AbstractTask 
    n_trials::Int
    trial::Int 
    lb::Float64
    ub::Float64 
    width::Float64
    hight::Float64
    scheduler::T
    screen::Vector{VisualObject}
    canvas::C
    window::W
    visible::Bool
    realtime::Bool
    speed::Float64
end    

The constructor for PVT is

function PVT(;
    n_trials=10, 
    trial=1, 
    lb=2.0, 
    ub=10.0, 
    width=600.0, 
    height=600.0, 
    scheduler=nothing, 
    screen=Vector{VisualObject}(), 
    window=nothing, 
    canvas=nothing, 
    visible=false, 
    realtime=false,
    speed=1.0,
    )
    visible ? ((canvas,window) = setup_window(width)) : nothing
    visible ? Gtk.showall(window) : nothing
    return PVT(n_trials, trial, lb, ub, width, height, scheduler, screen, canvas, window, visible,
        realtime, speed)
end

function setup_window(width)
	canvas = @GtkCanvas()
    window = GtkWindow(canvas, "PVT", width, width)
    Gtk.visible(window, true)
    @guarded draw(canvas) do widget
        ctx = getgc(canvas)
        rectangle(ctx, 0.0, 0.0, width, width)
        set_source_rgb(ctx, .8, .8, .8)
        fill(ctx)
    end
	return canvas,window
end
ACTRSimulators.add_to_visicon!Method
add_to_visicon!(actr, vo; stuff=false)

Adds a visual object to the visicon. If stuff is set to true, the visual object is added to the visual location buffer.

Arguments

  • actr: an ACT-R model object
  • vo: visual object
  • stuff: buffer stuffing if true
ACTRSimulators.all_matchMethod
all_match(actr, conditions)

Checks whether all conditions of a production rule are satisfied.

Arguments

  • actr: an ACT-R model object
  • conditions: a tuple of functions representing production rule conditions.
ACTRSimulators.attend!Method
attend!(actr, chunk, args...; kwargs...)

Completes an attention shift by adding a chunk to the visual buffer and setting states to busy = false and empty = false.

Arguments

  • actr: an ACT-R model object
  • chunk: a memory chunk
ACTRSimulators.attending!Method
attending!(actr, chunk, args...; kwargs...)

Sets visual module as busy and registers a new event to attend to a chunk created by a visual object

Arguments

  • actr: an ACT-R model object
  • chunk: a memory chunk
ACTRSimulators.clear_buffer!Method
clear_buffer!(mod::Mod)

Removes chunk from buffer and sets buffer state to

  • empty: true
  • busy: false
  • error: false

Arguments

  • mod::Mod: a module
ACTRSimulators.encode!Method
encode!(actr, chunk, args...; kwargs...)

Completes the creation of a chunk and adds resulting chunk to the imaginal buffer. The buffer states are set to busy = false and empty = false.

Arguments

  • actr: an ACT-R model object
  • chunk: a memory chunk
ACTRSimulators.encoding!Method
encoding!(actr, chunk, args...; kwargs...)

Sets imaginal module as busy and registers a new event to create a new chunk

Arguments

  • actr: an ACT-R model object
  • chunk: a memory chunk
ACTRSimulators.fire!Method
fire!(actr)

Selects a production rule and registers conflict resolution and new events for selected production rule

Arguments

  • actr: an ACT-R model object
ACTRSimulators.next_event!Method
next_event!(s, actr, task)

Dequeue and process a single event.

Arguments

  • s: an event scheduler
  • actr: an ACT-R model object
  • task: a task that is a subtype of AbstractTask
ACTRSimulators.pauseMethod
pause(task, event)

Pauses simulation for specified speed if realtime in task is true.

Arguments

  • task: a task that is a subtype of AbstractTask
  • event: a task event or an internal event of the model
ACTRSimulators.respond!Method
respond!(actr, task, key, args...; kwargs...)

Executes a motor response with user defined press_key! function and sets module state to busy = false.

Arguments

  • actr: an ACT-R model object
  • task: a task that is a subtype of AbstractTask
  • key: a string representing a response key
ACTRSimulators.responding!Method
responding!(actr, task, key, args...; kwargs...)

Sets the declarative motor module as busy and registers a new event for executing a key stroke

Arguments

  • actr: an ACT-R model object
  • task: a task that is a subtype of AbstractTask
  • key: a string representing a response key
ACTRSimulators.retrieve!Method
retrieve!(actr, chunk, args...; kwargs...)

Completes a memory retrieval by adding chunk to declarative memory buffer and setting busy = false and empty = false. Error is set to true if retrieval failure occurs.

Arguments

  • actr: an ACT-R model object
  • request...: a variable list of slot-value pairs
ACTRSimulators.retrieving!Method
retrieving!(actr, chunk, args...; kwargs...)

Sets the declarative memory module as busy and Submits a request for a chunk and registers a new event for the retrieval

Arguments

  • actr: an ACT-R model object
  • request...: a variable list of slot-value pairs
ACTRSimulators.start!Method
start!(actr)

A function that initializes the simulation for the model.

Arguments

  • task: a task that is a subtype of AbstractTask
  • actr: an ACT-R model object
ACTRSimulators.vo_to_chunkFunction
vo_to_chunk(vo=VisualObject())

Arguments

Converts visible object to a chunk with color and text slots.

ACTRSimulators.vo_to_chunkMethod
vo_to_chunk(actr, vo)

Converts visible object to a chunk with color and text slots, and sets time created to current time.

Arguments

  • actr: an ACT-R model object
  • vo: visual object
ACTRSimulators.why_notMethod
why_not(actr, rule)

Prints each condition of a production rule and whether it matches the state of the architecture.

Arguments

  • actr: an ACT-R model object
  • rule: a production rule object
ACTRSimulators.why_notMethod
why_not(actr)

Prints each condition of all production rules and whether the condition matche the state of the architecture.

Arguments

  • actr: an ACT-R model object
DiscreteEventsLite.run!Function
run!(actr, task::AbstractTask, until=Inf)

Simulate an ACT-R model

Arguments

  • models: a dictionary of ACT-R model objects
  • task: a task that is a subtype of AbstractTask
  • until=Inf: a specified termination time unless terminated sooner manually