Man Page for bnc, pn, and rq -- RISO programs

Here are some notes on RISO programs.

The compiled RISO class files can live either on a remote host or on the local host. If on a local host, the RISO classes are loaded by the Java runtime from the directory or archive specified in the $CLASSPATH environment variable. If on a remote host, a stub program (RemoteApp) is executed from a local class file, and RISO classes are loaded from a codebase, that is, from an http server.


bnc -- Create RISO belief network context

Local class files:
bnc is an alias for jre riso.belief_nets.BeliefNetworkContext
Remote class files:
bnc is an alias for jre RemoteApp -c riso.belief_nets.BeliefNetworkContext -a

This program takes these command line arguments. The program processes the arguments, then continues to run, waiting for pn to request that one or more belief networks be loaded. bnc prints very verbose debugging messages to stderr; one can redirect these messages to a file or to /dev/null as need be.

    -c contextname     Specify the name of the context.
    -po port     Specify the port number of the RMI registry in which the context name will be advertised. The default port is 1099, the standard RMI registry port.
    -pa directory:directory:directory...     Specify directories in which to search for .riso files. The directories are separated by colon, not by space. Directories are searched in the order specified. The current working directory is always prepended to the list.

Example:

 $ bnc -c my-context -po 1077 -pa $HOME/belief-nets:$HOME/more-nets > my.log 2>&1 &

This creates a context named my-context, which can be accessed through port 1077, and which loads belief networks from the current working directory, and /home/dodier/belief-nets, and /home/dodier/more-nets, in that order. This assumes that there is an RMI registry running on port 1077, i.e. you have already executed `rmiregistry 1077'. Debugging messages are printed to stderr, which is redirected into the my.log file in this example.


pn -- Publish RISO belief network

Local class files:
pn is an alias for jre riso.apps.PublishNetwork
Remote class files:
pn is an alias for jre RemoteApp -c riso.apps.PublishNetwork -a

This program takes the following command line arguments. The program processes the arguments, then exits.

    -c hostname/contextname     The belief network will be published in the specified context on the specified host.
    -b beliefnetworkname     Bind the name of the belief network. This makes the belief network visible to within the context by -c. The name cannot already be bound in that context. The belief network is found in a file called beliefnetworkname.riso, somewhere on the list of paths known to the context; directories are searched in the order they were specified by the -pa arguments.
    -r beliefnetworkname     Rebind the name of the belief network. If the name is already bound, the previous binding is destroyed and the new binding becomes active.
    -u beliefnetworkname     Unbind the name of the belief network. If the name is already bound, the previous binding is destroyed. The belief network is marked "stale", which means that every operation on the belief network will fail. However, its context remains alive and usable.

Continuing the bnc example:

  pn -c spruce/my-context -b monitor3
pn -c spruce/my-context -r monitor3 -b monitor1
pn -c spruce/my-context -b combine
pn -c spruce/my-context -u monitor1

The first example loads the belief network from the file monitor3.riso and binds it to the globally visible name monitor3. The second example reloads and rebinds monitor3. The third example loads and bins combine. Since that belief network refers to other belief networks, those others are loaded and bound as needed. monitor1 and monitor3 are already loaded and bound, but monitor2 is not, so it is loaded and bound. The fourth example unbinds monitor1 and marks it stale; then all operations on monitor1 will fail.

The files monitor1.riso, monitor2.riso, monitor3.riso, and combine.riso, must exist in one of the directories named in the search path  (`-pa' option) when the belief network context was launched by bnc.


rq -- Remote query on RISO belief networks

Local class files:
rq is an alias for jre riso.apps.RemoteQuery
Remote class files:
rq is an alias for jre RemoteApp -c riso.apps.RemoteQuery -a

This program doesn't take any command line arguments. After the program starts, you can enter these commands:

    > hostname/beliefnetworkname     Obtain a reference to a belief network.
    ?     Prints a description of the belief network.
    variablename ?     Request the posterior for a variable and print the posterior. This forces the computation to occur, if it hasn't already; otherwise it simply returns the already-computed result.
    variablename = number     Set a variable equal to the given integer or floating-point number.
    variablename -     Erase the assignment of a number to the variable.
    variablename all-     Erase the assignment, and erase pi and lambda messages belonging to this variable, too.
    get distribution variablename     Get the conditional distribution of the variable. Every variable should have one of these.
    get prior variablename     Get the prior distribution, if it is already computed; otherwise return null -- do not force the computation.
    get posterior variablename     Get the posterior distribution, if it is already computed; otherwise return null -- do not force the computation.
    get pi variablename     Get the predictive distribution, if it is already computed; otherwise return null -- do not force the computation.
    get lambda variablename     Get the likelihood function, if it is already computed; otherwise return null -- do not force the computation.
    get pi-messages variablename     Get any pi messages received by the variable. Some may be null, meaning that the corresponding parent has not sent a pi message.
    get lambda-messages variablename     Get any lambda messages received by the variable. Some may be null, meaning that the corresponding child has not sent a lambda message.
    get parents-priors variablename     Get the prior distributions of the parents of the variable, if they are already computed.
    get parents-bns variablename     Get the names of the belief networks which contain the parents of the variable.
    ctrl-d     Exit the program.

Here is an example session with rq, using the belief networks published in the examples above.

$ rq
> spruce/monitor1
?


Last update sometime before $Date: 2003/10/06 03:07:25 $.