Pnet.NeticaBN: Class '"NeticaBN"' as a '"Pnet"'

Pnet.NeticaBNR Documentation

Class "NeticaBN" as a "Pnet"

Description

The PNetica package supplies the needed methods so that the RNetica::NeticaBN object is an instance of the Peanut::Pnet object.

Extends

See NeticaBN for a description of the Netica class.

With these methods, NeticaBN now extends Pnet.

All reference classes extend and inherit methods from "envRefClass".

Methods

PnetCompile

signature(net = "NeticaBN"): Compiles the network.

PnetName

signature(net = NeticaBN): Gets the name of the network.

PnetName<-

signature(net = NeticaBN): Sets the name of the network.

PnetTitle

signature(net = NeticaBN): Gets the title of the network.

PnetTitle<-

signature(net = NeticaBN): Sets the title of the network.

PnetDescription

signature(net = NeticaBN): Gets the description of the network.

PnetDescription<-

(signature(net = NeticaBN): Sets the description of the network.

PnetPathname

signature(net = NeticaBN): Gets the pathname where the network is stored.

PnetPathname<-

signature(net = NeticaBN): Sets the pathname where the network is stored.

PnetHub

signature(net = NeticaBN): Returns the name of the hub (competency/proficiency model) associated with an spoke (evidence model) network.

PnetHub<-

signature(net = NeticaBN): Sets the name of the hub.

PnetPriorWeight

signature(net = NeticaNode): Returns the default prior weight associated with nodes in this network.

PnetPriorWeight<-

signature(net = NeticaNode): Sets the default prior weight associated with nodes in this network.

as.Pnet

signature(x = NeticaBN): Forces x to be a Pnet.

is.Pnet

signature(x = NeticaBN): Returns true.

Author(s)

Russell Almond

See Also

Base class: NeticaBN.

Mixin class: Pnet.

Methods (from Peanut package.):

PnetCompile, PnetHub, PnetName, PnetTitle, PnetDescription, PnetPathname, as.Pnet, is.Pnet.

Examples

sess <- NeticaSession()
startSession(sess)
curd <- setwd(system.file("testnets",package="PNetica"))

## PnetHub
PM <- ReadNetworks("miniPP-CM.dne", session=sess)
stopifnot(PnetHub(PM)=="")

EM1 <- ReadNetworks("PPcompEM.dne", session=sess)
stopifnot(PnetHub(EM1)=="miniPP_CM")

foo <- CreateNetwork("foo",sess)
stopifnot(is.na(PnetHub(foo)))
PnetHub(foo) <- PnetName(PM)
stopifnot(PnetHub(foo)=="miniPP_CM")

## PnetCompile
PnetCompile(PM)
marginPhysics <- Statistic("PnodeMargin","Physics","Pr(Physics)")
calcStat(marginPhysics,PM)

net <- CreateNetwork("funNet",sess)
stopifnot(PnetName(net)=="funNet")

PnetName(net)<-"SomethingElse"
stopifnot(PnetName(net)=="SomethingElse")

## PnetPathname
stopifnot(PnetPathname(PM)=="miniPP-CM.dne")
PnetPathname(PM) <- "StudentModel1.dne"
stopifnot(PnetPathname(PM)=="StudentModel1.dne")

##PnetTitle and PnetDescirption
firstNet <- CreateNetwork("firstNet",sess)

PnetTitle(firstNet) <- "My First Bayesian Network"
stopifnot(PnetTitle(firstNet)=="My First Bayesian Network")

now <- date()
PnetDescription(firstNet)<-c("Network created on",now)
## Print here escapes the newline, so is harder to read
cat(PnetDescription(firstNet),"\n")
stopifnot(PnetDescription(firstNet) ==
  paste(c("Network created on",now),collapse="\n"))



DeleteNetwork(list(PM,EM1,foo,net,firstNet))
stopSession(sess)
setwd(curd)


ralmond/PNetica documentation built on Sept. 19, 2023, 8:27 a.m.