Stateful interface

ComputerAdaptiveTesting.StatefulModule

This module defines the interface for a stateful CAT as well as an implementation in terms of CatRules. The interface is meant to enable polymorphic use of different CAT implementations.

source

Interface

ComputerAdaptiveTesting.Stateful.next_itemFunction
next_item(config::StatefulCat) -> IndexT

Returns the index of the best next item according to the CAT.

Ideally IndexT will be an integer and the return type a 1-based index, however it should at least be the same type as accepted by add_response!.

source
ComputerAdaptiveTesting.Stateful.item_criteriaFunction
item_criteria(config::StatefulCat) -> AbstractVector{CriteriaT}

Returns a vector of criteria values for each item in the item bank.

The criteria can vary, but should attempt to interoperate with ComputerAdaptiveTesting.jl.

source
ComputerAdaptiveTesting.Stateful.add_response!Function

julia add_response!(config::StatefulCat, index::IndexT, response::ResponseT)`

The exact response type ResponseT depends on the item bank. It should be chosen to interoperate with any equivalent item bank according to the implementation in ComputerAdaptiveTesting.jl.

source
ComputerAdaptiveTesting.Stateful.set_item_bank!Function
set_item_bank!(config::StatefulCat, item_bank::AbstractItemBank)

Set the current item bank of the CAT. This will also reset the CAT to its initial state, removing all responses.

Some CAT implementations may not support this operation in which case they will throw an error.

source
ComputerAdaptiveTesting.Stateful.get_abilityFunction
get_ability(config::StatefulCat) -> AbilityT

Return the current ability estimate according to the CAT. The type of the ability estimate AbilityT depends on the CAT implementation but should attempt to interoperate with ComputerAdaptiveTesting.jl.

source

CatRules implementation

There is an implementation in terms of CatRules:

ComputerAdaptiveTesting.Stateful.StatefulCatConfigType
struct StatefulCatConfig{TrackedResponsesT<:ComputerAdaptiveTesting.Aggregators.TrackedResponses} <: ComputerAdaptiveTesting.Stateful.StatefulCat

This is a the StatefulCat implementation in terms of CatRules. It is also the de-facto standard for the behavior of the interface.

source

Usage

Just as CatLoopConfig can wrap CatRules, you can also use it with any implementor of Stateful.StatefulCat, and run using Sim.run_cat.