BNEngineMongo: Creates a Bayes Net Engine attached to a Mongo database.

BNEngineMongoR Documentation

Creates a Bayes Net Engine attached to a Mongo database.

Description

The BNEngineMongo is a BNEngine which is attached to a MongoDB database, which hold both the queue and the StudentRecordSet.

Usage

newBNEngineMongo(app = "default", warehouse, listenerSet = NULL, processN = Inf,
    statistics = list(),
    dburi = "mongodb://localhost", sslops = mongolite::ssl_options(),
    eadbname = "EARecords", admindbname = "Proc4", waittime = 0.25,
    profModel = character(), histNodes = character(),
    errorRestart = c("checkNoScore", "stopProcessing", "scoreAvailable"),
    srcol = "StudentRecords",
    mongoverbose = FALSE,
    srs = StudentRecordSet(app = app, warehouse = warehouse,
        db = MongoDB(srcol, eadbname, dburi, verbose = mongoverbose,
            options = sslops)),
    manifestCol = "Manifest", manifestDB = MongoDB(manifestCol,
        eadbname, dburi, verbose = mongoverbose, options = sslops),
    evidenceCol = "EvidenceSets", evidenceQueue = new("MongoQueue",
        app = app, messDB = MongoDB(evidenceCol, eadbname, dburi,
        verbose = mongoverbose, options = sslops), builder = Proc4::buildMessage),
    histcol = "histNodes", histNodesDB = MongoDB(histcol, eadbname,
        dburi, verbose = mongoverbose, options = sslops),
    statcol = "Statistics",
    statDB = MongoDB(statcol, eadbname, dburi, verbose = mongoverbose,
        options = sslops),
    admincol = "AuthorizedApps", adminDB = MongoDB(admincol,
        admindbname, dburi, verbose = mongoverbose, options = sslops),
    ...)

Arguments

app

A character scalar giving the globally unique identifier for the application.

warehouse

A PnetWarehouse which stores the default student model and evidence models. (It will also store the student models.

listenerSet

A ListenerSet which contains the listeners for clients of the engine's messages.

statistics

Object of class list containing Statistic objects to be run on every update cycle.

dburi

A character scalar giving the login information for the mongo database. See makeDBuri.

sslops

Options for SSL connections to database. See ssl_options.

eadbname

The name for the EA database.

admindbname

The name of the admin database used to check for shutdown requests.

processN

The number of records to process before stopping. The default value Inf runs the process until the active flag is cleared.

waittime

The amout of time (in seconds) to wait before checking again for new evidence sets when the evidence set queue is empty.

profModel

The name of the proficiency model (its ID in the warehouse manifest).

histNodes

A character vector giving the names of the nodes for which history will automaticall be recorded.

errorRestart

A character scalar describing how to handle errors. The default, "checkNoScore" will continue scoreing to try to find additional errors, but will not report statistics; the "scoreAvailable" option reports the scores based on the evidence sets which do not produce errors. The "stopProcessing" option immediately stops processing.

srcol

A character scalar giving the name of the database backing the student record set. Ignored if srs is specified.

mongoverbose

A flag. If true, extra debugging information from database calls is generated.

srs

A StudentRecordSet object for storing the student records.

manifestCol

The name of the column containing the manifest data, ignored if manifestDB is supplied.

manifestDB

A JSONDB the database where manifest information is cached.

evidenceCol

The name of the column containing the evidence sets, ignored if evidenceQueue is supplied.

evidenceQueue

A MessageQueue where the evidence sets exist.

histcol

The name of the column into which history data should be stored, ignored if histNodesDB is supplied.

histNodesDB

A JSONDB database where history information is stored.

statcol

The name of the column into which statistics should be stored, ignored if statDB is supplied.

statDB

A JSONDB database where statistics are stored.

admincol

The name of the column in the administrative database where engine status information is stored, ignored if adminDB is supplied.

adminDB

A JSONDB where status information about the engine is stored.

...

Extra arguments are ignored. This allows arguments for other engine versions to be set in the parameters and ignored.

Details

This creates an uninitialized BNEngine, specifically a BNEngineMongo.

The app, warehouse, and listenerSet arguments need to be supplied, for most of the rest, the default arguments work.

In particular, most of the “db” arguments are built using the default arguments. The makeDBuri function provides a useful shorthand for calculating the dburi field.

Value

An object of calls BNEngineMongo which is capable of scoring student models.

Note

Much of this information comes from the “config.json” file, with the dburi, eadbname, admindbname, and sslops arguments come from the “EA.ini” file.

Author(s)

Russell Almond

References

Almond, Mislevy, Steinberg, Yan and Williamson (2015). Bayesian Networks in Educational Assessment. Springer. Especially Chapter 13.

See Also

Classes: BNEngine, BNEngineNDB

Constituent parts: StudentRecordSet, PnetWarehouse ListenerSet

Setup Functions: loadManifest, setupDefaultSR, configStats, baselineHist,

Main Loop Functions: mainLoop, accumulateEvidence, handleEvidence, getRecordForUser, logEvidence, updateSM, updateStats, updateHist, announceStats,

Examples



## Not run: 
## Requires database setup, also PNetica
library(RNetica)  ## Must load to setup Netica DLL
app <- "ecd://epls.coe.fsu.edu/EATest"
sess <- RNetica::NeticaSession()
RNetica::startSession(sess)

config.dir <- file.path(library(help="Peanut")$path, "auxdata")
net.dir <- file.path(library(help="PNetica")$path,"testnets")

netman <- read.csv(file.path(config.dir, "Mini-PP-Nets.csv"),
                    row.names=1, stringsAsFactors=FALSE)
stattab <- read.csv(file.path(config.dir, "Mini-PP-Statistics.csv"),
                    as.is=TRUE)

Nethouse <- PNetica::BNWarehouse(netman,session=sess,
             address=net.dir)

cl <- new("CaptureListener")
listeners <- list("cl"=cl)
ls <- ListenerSet(sender= paste("EAEngine[",basename(app),"]"),
                  dbname="EARecords", dburi=makeDBuri(host="localhost"),
                  listeners=listeners,
                  colname="Messages")


eng <- newBNEngineMongo(app=app,warehouse=Nethouse,
                     listenerSet=ls,
                     dburi=makeDBuri(host="localhost"),
                     dbname="EARecords",profModel="miniPP_CM",
                     histNodes="Physics")

## Standard initialization methods.
loadManifest(eng,netman)
eng$setHistNodes("Physics")
configStats(eng,stattab)
setupDefaultSR(eng)


## End(Not run)



ralmond/EABN documentation built on Aug. 30, 2023, 12:52 p.m.