Using your CAT
Now you've created your cat according to Creating a CAT, there are a number of ways you can use it. This section covers a few. See also the Examples.
When you've set up your CAT using CatRules, you can wrap it in a CatLoop and run it with run_cat.
ComputerAdaptiveTesting.Sim.CatLoop — Typestruct CatLoop
CatLoop(; rules=..., get_response=..., new_response_callback=...)rules::Any: An object which implements the CAT engine. Implementations exist for:
get_response::Any: The function(index, label) -> Int8` which obtains the testee's response for a given question, e.g. by prompting or simulation from data.
new_response_callback::Any: A callback called each time there is a new responses. If provided, it is passed(responses::TrackedResponses, terminating).
Configuration for a simulatable CAT.
ComputerAdaptiveTesting.Sim.run_cat — Functionrun_cat(cat_config::CatLoop, item_bank::AbstractItemBank; ib_labels=nothing)Run a given CatLoop cat_config on the given item_bank. If ib_labels is not given, default labels of the form <<item #$index>> are passed to the callback.
Run a given CatLoop with a MaterializedDecisionTree
Simulating CATs
You might like to use a response memory or simulated responses to simulate your CAT using auto_responder:
ComputerAdaptiveTesting.Sim.auto_responder — Functionauto_responder(
    responses
) -> ComputerAdaptiveTesting.Sim.var"#11#12"
This function constructs a next item function which automatically responds according to responses.
In case your data is different you might like to modify the implementation:
function auto_responder(responses)
    function (index, label_)
        responses[index]
    end
endauto_responder (generic function with 1 method)Integrating into a user-facing applications
A simple interactive implementation of get_response(...) is prompt_response:
ComputerAdaptiveTesting.Sim.prompt_response — Functionprompt_response(index_, label) -> Int8
This response callback simply prompts the user for the response using the console
For other types of interactivity you can modify the implementation:
function prompt_response(index_, label)
    println("Response for $label > ")
    parse(Int8, readline())
endprompt_response (generic function with 1 method)