input
stringlengths
10
828
output
stringlengths
5
107
protected void set plugin node manager core plugin node manager plugin node manager this plugin node manager plugin node manager
this object manages plugin loaded nodes
public entity and arguments get current entity and arguments if this evaluation list null return null return this evaluation list get this current evaluation index
obtains a compact representation of the current value of
public void set likelihood extractor ilikelihood extractor likelihood extractor this likelihood extractor likelihood extractor
this object is used in
public string get plugin directory return plugin directory
the directory where this class will search for plugins
public ilikelihood extractor get likelihood extractor return likelihood extractor
this object is used in
public string get plugin core id return plugin core id
the id of the core plugin
public class get plugin ushape class return plugin ushape class
this is the class in which
public void set plugin ushape class class plugin ushape class if iplugin ushape class is assignable from plugin ushape class throw new illegal argument exception this get plugin ushape class must return an instance of unbbayes draw extension iplugin ushape this plugin ushape class plugin ushape class
this is the class in which
public void set plugin core id string plugin core id this plugin core id plugin core id
the id of the core plugin
public string get algorithm extension point return algorithm extension point
this is the extension point id for inference algorithm
public void set algorithm extension point string algorithm extension point this algorithm extension point algorithm extension point
this is the extension point id for inference algorithm
public void create basic popup menu popup remove all todo use resource file for localization jmenu item item new jmenu item resize to fit text item add action listener new action listener public void action performed action event ae get canvas on resize to fit text jmenu item item1 new jmenu item color change item1 add action listener new action listener public void action performed action event ae create color chooser popup add item popup add item1
resets the menu and fills it with the resize and color change menu
public ushape get node ushape node n int size this get component count for int i 0 i size i ushape shape result null ushape shape ushape this get component i shape result get node ushape shape n if shape result null return shape result if shape get node null shape get node n shape get node equals n return shape return null
does a linear search for a ushape instance containing a node n
public void set default class loader class loader default class loader this default class loader default class loader
the default class loader to be used in order to load the resources
public resource bundle get bundle string base name return resource bundle get bundle base name this get default locale this get default class loader
obtains a resource bundle using current configuration of locale and classloader
public string get extension point id return extension point id
id of the extension point used by plugin loader to load resources plugins
public void set extension point id string extension point id this extension point id extension point id
id of the extension point used by plugin loader to load resources plugins
public un bbayes frame get unbbayes frame return unbbayes frame
this is the top frame of un bbayes where all inner frames resides
public void set unbbayes frame un bbayes frame unbbayes frame this unbbayes frame unbbayes frame
this is the top frame of un bbayes where all inner frames resides
public void set plugin core id string new plugin core id plugin core id new plugin core id
the id of the core plugin
public void notify reload object origin iterate on a copy of on reload listeners so that we can avoid concurrent modification for on reload action listener listener new array list un bbayes plugin context holder on reload action listener this get on reload listeners try listener on reload new event object origin catch throwable t t print stack trace
triggers every listeners at
public void load plugin throws ioexception this reload plugin
this is equivalent to
public void add listener on reload action listener listener this get on reload listeners add listener
adds a new
protected void set main extension point id string main extension point id this main extension point id main extension point id
id of the plugin where we can find panel declarations
public string get main extension point id return main extension point id
id of the plugin where we can find panel declarations
public void register node class class node class inode class data transfer object dto this get node class to dto map put node class dto
associates a plugin nodes class to its set of aditional information
public inode class data transfer object get plugin node information class node class inode class data transfer object ret this get node class to dto map get node class if ret null retry reloading plugins try this reload plugin catch exception e debug println this get class error reloading plugin at get plugin node information e ret this get node class to dto map get node class return ret
obtains a plugin node information registered by
public inetwork mediator get mediator return this mediator
obtains the main controller mediator of bn module
public void set mediator inetwork mediator mediator this mediator mediator
the main controller mediator of bn module
public string get main extension point id return plugin node extension point id
gets the static value of plugin node extension point id which is
public void set main extension point id string plugin node id this plugin node extension point id plugin node id
sets the static value of plugin node extension point id which is
protected void init graph level matrix add root nodes list node node list new array list node for int i 0 i network get node count i node node network get node at i node index map put node i if node get parents size 0 node added list i true node level list i 0 node list add network get node at i graph level matrix add node list
initializes the queue with the nodes that are root
private boolean contains at least one of collection container collection contents for object content contents if container contains content return true return false
checks if container contains at least one element in contents
public void set ignored arguments collection string ignored arguments this ignored arguments ignored arguments
arguments with these names will be ignored in
public string get identification number string identification number if father null identification number father get identification number separator identification number number return identification number
identification of this nivel in the format
public split toggle button get btn add plugin button return btn add plugin button
this button is a split button which responsible for
public void set btn add plugin button split toggle button btn add plugin button this btn add plugin button btn add plugin button
this button is a split button which responsible for
protected void create plugin tool bars if plugin tool bar null top panel remove plugin tool bar plugin tool bar new jtool bar plugin tool bar set size plugin tool bar get width jtb file get height plugin tool bar set tool tip text resource get string plugin menu instantiate new split button this set plugin split button new split toggle button plugin tool bar add this get plugin split button this get plugin split button set tool tip text resource get string plugin menu top panel add plugin tool bar
this method is used whithin
public jcomponent get cpf pane return cpf pane
this is a pane to edit conditional probability functions
public void set cpf pane jcomponent cpf pane this cpf pane cpf pane
this is a pane to edit conditional probability functions
protected void reload plugins reset components this create menu reset menu this remove plugin buttons from other components this get map of components to be removed at plugin reload remove buttons from other jtbs this set module category to components map this build module category to components map fills up the module category to jmenu map this load plugins reload plugins this update plugin menu visibility show menus if it is not empty again reloads every plugin managed by un bbayes plugin context holder by notifying it this get unbbayes plugin context holder notify reload this this repaint
this method is called when we press the reload plugin menu
public cptframe get cptdialog resident node resident node jframe frame this get cptedition frame resident node if frame instanceof cptframe return cptframe frame return null
returns a cptframe to edit cpt
public entity and arguments entity entity list ovinstance arguments this entity entity this arguments arguments
creates an alternative compact way to represent a particular state of
private void load generative mebninto kb knowledge base knowledge base get knowledge base for object entity entity multi entity bayesian network get object entity container get list entity knowledge base create entity definition entity for mfrag mfrag multi entity bayesian network get domain mfrag list for resident node resident mfrag get resident node list knowledge base create random variable definition resident if save debug files this save generative mtheory new file mebncontroller name generative file
insert the mebn generative into kb
public void clear cache if this get name to parent prob values cache null this get name to parent prob values cache clear system gc
this method clears all pre cached compiled values of this compiler
private void load findings into kb knowledge base knowledge base get knowledge base for object entity instance instance multi entity bayesian network get object entity container get list entity instances knowledge base insert entity instance instance todo use a map instead of cubic search for mfrag mfrag multi entity bayesian network get domain mfrag list for iresident node resident node mfrag get resident node list for random variable finding finding resident node get random variable finding list knowledge base insert random variable finding finding if save debug files this save default temporary findings file
insert the findings into kb
public void assign action listeners new net add action listener al new bn new msbn add action listener al new msbn new mebn add action listener al new mebn new oobn add action listener al new oobn open net add action listener al open save net add action listener al save metal add action listener al metal motif add action listener al motif home system add action listener al home system learn add action listener al learn tile add action listener al tile cascade add action listener al cascade help add action listener al help
method responsible for assigning action listeners to all buttons
public void window closing window event e try controller save configurations catch ioexception e1 invisible for the user e1 print stack trace
invoked when the user attempts to close the window
public void reload plugins this set delegators new array list base io this get delegators add all this load ioas plugins
reloads the plugins
public string get extension point class param return extension point class param
the default name of the class parameter of pnio extension point
public void set extension point class param string extension point class param this extension point class param extension point class param
the default name of the class parameter of pnio extension point
public void reset clear append resource get string log header
initializes the logfile of network compilation
public string get plugin module extension point return plugin module extension point
the main extension point of the core plugin module
protected void read till eol stream tokenizer tokenizer throws ioexception while tokenizer next token stream tokenizer tt eol tokenizer push back
reads and skips all tokens before next end of line token
public void start probabilistic network pn int n trials this probability evidence given parent list new float n trials init all values as 1 because we are going to multiply these numbers for p e par e product of p ei par ei for all evidences findings for int i 0 i this probability evidence given parent list length i probability evidence given parent list i 1 super start pn n trials
responsible for setting the initial variables for likelihood weighting
public void set plugin module extension point string plugin module extension point this plugin module extension point plugin module extension point
the main extension point of the core plugin module
protected void set up stream tokenizer stream tokenizer st throws ioexception st reset syntax st word chars a z st word chars a
configures valid invalid character ranges of stream tokenizer
protected void create sampling order queue keeps track of the nodes that have already been added to the queue node added list node index true boolean node added list new boolean pn get node count init sampling order queue node added list for int i 0 i sampling node order queue size i node node sampling node order queue get i add to sampling order queue node get children node added list
creates the queue of the nodes that are going to be analyzed
protected void init sampling order queue boolean node added list for int i 0 i pn get node count i if pn get node at i get parents size 0 node added list i true sampling node order queue add pn get node at i
initializes the queue with the nodes that are root
protected integer get index in queue node node for int i 0 i sampling node order queue size i if node get name equals sampling node order queue get i get name return i return null
retrieves the nodes index in the queue
protected void compute factors int size sampling node order queue size if factors null factors length size factors new int size factors 0 1 node node for int i 1 i size i node sampling node order queue get i 1 factors i factors i 1 node get states size
calculate the factors necessary to transform the linear coordinate into a multidimensional
public int get linear coord int multidimensional coord compute factors int coord linear 0 int size sampling node order queue size for int v 0 v size v coord linear multidimensional coord v factors v return coord linear
get the linear coordinate from the multidimensional one
public void start probabilistic network pn int n trials this pn pn this n trials n trials set max value allowed for the progress this max progress n trials sampling node order queue new array list node create sampling order queue sampled states matrix new byte n trials pn get node count for int i 0 i n trials i update the current value of the progress update progress i simulate i
generates the mc sample with the given size for the given probabilistic network
protected void simulate int n trial list integer parents indexes new array list integer double pmf int sampled states new int sampling node order queue size for int i 0 i sampling node order queue size i probabilistic node node probabilistic node sampling node order queue get i parents indexes get parents indexes in queue node pmf get probability mass function sampled states parents indexes node sampled states i get state pmf sampled states matrix n trial i byte sampled states i
responsible for simulating mc for sampling
public void start probabilistic network pn int n trials this pn pn this n trials n trials sampled states map new hash map integer integer sampling node order queue new array list node create sampling order queue int sampled states null for int i 0 i n trials i sampled states simulate int key get linear coord sampled states integer value sampled states map get key if value null sampled states map put key value else sampled states map put key 1
generates the mc sample with the given size for the given probabilistic network
public void set plugin list map string class plugin map this plugin map plugin map
connected loaded and activated extensions
protected void set up hierarchic tree single entity network net hierarchic tree tree net get hierarchic tree if tree null tree set probabilistic network net hierarchic tree description type
sets up the hierarchic tree after the network is completely loaded
protected void save net header body print stream stream single entity network net stream println node size int net get radius 2 int net get radius 2 stream println name net get name stream println un bbayes color probabilistic description probabilistic node get description color get rgb stream println un bbayes color probabilistic explanation probabilistic node get explanation color get rgb stream println un bbayes color utility utility node get static color get rgb stream println un bbayes color decision decision node get static color get rgb
stores the content of net content header to a stream
protected void save potential declaration print stream stream node node single entity network net array list node aux parent list node get parents stream print potential node get name int size va aux parent list size if size va 0 stream print for int c2 0 c2 size va c2 node aux no2 node aux parent list get c2 stream print aux no2 get name stream println stream println this save potential declaration body stream node net stream println stream println
stores to print stream the potential declaration
public boolean turn to mtheory mode if multi entity bayesian network null show ssbngraph true this get mebn edition pane get network window change to mtheory pane this get mebn edition pane get network window get graph pane set graph dimension dimension ssbngraph this get mebn edition pane get network window get graph pane update return true else return false
changes to mtheory view
public split toggle button get plugin split button return plugin split button
this is the split button containing buttons to start plugin based modules
public void set plugin split button split toggle button plugin split button this plugin split button plugin split button
this is the split button containing buttons to start plugin based modules
public split button menu action listener split toggle button split button jbutton main button this main button main button this split button split button
constructor setting the button to be set as main button at
public void insert state node node if node instanceof probabilistic node node append state resource get string state probabilistic name node get states size todo rommel the node class should have a listener to its change the code below is just temporary implement node change listener for node child node get children if child get type node continuous node type continuous node child get cn normal distribution refresh parents else if node instanceof decision node node append state resource get string state decision name node get states size screen set table make table node node
inserts a new state for a selected node
public void remove state node node node remove last state todo rommel the node class should have a listener to its change the code below is just temporary implement node change listener for node child node get children if child get type node continuous node type continuous node child get cn normal distribution refresh parents screen set table make table node node
deletes the last state of a selected node
public void load configurations throws ioexception configurations controller config controller configurations controller get instance configurations io configurations io new configurations ioinput stream try configurations configurations configurations io load new file config controller get file configurations path config controller set configurations configurations config controller set file opened sucessfull true catch ioexception e config controller set file opened sucessfull false throw e
load the configuration file and setting the configurations object in the
public void initialize try this get inference algorithm reset by young2 true update false complie screen get evidence tree update tree true catch exception e e print stack trace
reset the beliefs for the prior probabilities
private void eagle loader splash screen splash screen new splash screen splash screen pack splash screen set visible true initialize load configurations debug println init loader protege do not eager load mebn content which is plugin content load protege if pre load protege protege owl create jena owlmodel debug println init loader powerloom load powerloom if pre load powerloom pli initialize debug println finish loader splash screen dispose
pre loading of apis for a better performance
private void initialize load configurations pre load powerloom true pre load protege true
initialize the load configurations of the plugins used by the un bayes
public void new pn named window builder builder new network window builder if builder null builder set name resource get string new pnname if screen null un bbayes module module builder build un bbayes module screen add window module
this method is responsible for creating a new probabilistic network
public void remove evidence node node try if node null if node instanceof tree variable tree variable n tree variable node n reset likelihood n reset evidence propagate screen get evidence tree update tree true else joption pane show message dialog screen resource get string no node selected error resource get string status error joption pane error message catch exception e e print stack trace
reset the belief of the selected node
public boolean save net file file base io io to use graph graph to save throws ioexception try if io to use supports file false throw new ioexception this resource get string cannot handle file format io to use save file graph to save catch null pointer exception e throw new ubioexception this resource get string cannot handle file format e return true
saves the probabilistic network using the given io class
public jmenu get tools menu return tools menu
this is a menu where tools e
protected string get log content if single entity network null return single entity network get log return
this method is called inside
public jmenu get sampling menu return sampling menu
this is a sub menu where sampling modules resides
public node insert continuous node double x double y continuous node node new continuous node node set position x y node set name resource get string probabilistic node name single entity network get node count node set description node get name single entity network add node node return node
inserts the desired node inside the network creating default state symbol and description
public node insert probabilistic node double x double y probabilistic node node new probabilistic node node set position x y node append state resource get string first state probabilistic name node set name resource get string probabilistic node name get counter for node name node set description node get name potential table aux tab prob potential table node get probability function aux tab prob add variable node aux tab prob set value 0 1 single entity network add node node this set counter for node name get counter for node name 1 return node
inserts the desired node inside the network creating default state symbol and description
public void delete selected item object selected screen get graph pane get selected if selected null delete selected selected by young screen get graph pane update
delete the selected item of the graph a node or a edge
public float get error return 0
as this is an exact evaluation there is no error
public separator get plugin menu separator return plugin menu separator
this separator separates the reload plugin option from other plugins
protected void compute factors int size target node list length evidence node list length if factors null factors length size factors new int size create one list of all nodes tree variable nodes new tree variable size int node index 0 for int i 0 i target node list length i nodes node index target node list i for int i 0 i evidence node list length i nodes node index evidence node list i factors 0 1 node node for int i 1 i size i node nodes i 1 factors i factors i 1 node get states size
calculate the factors necessary to transform the linear coordinate into a multidimensional
protected int get linear coord int multidimensional coord compute factors int coord linear 0 int size target node list length evidence node list length for int v 0 v size v coord linear multidimensional coord v factors v return coord linear
get the linear coordinate from the multidimensional one
protected int get evidence linear coord int multidimensional coord compute factors int coord linear 0 int size target node list length evidence node list length for int v 1 v size v coord linear multidimensional coord v factors v factors 1 return coord linear
get the evidence linear coordinate from the multidimensional one
public void set plugin menu separator separator plugin menu separator this plugin menu separator plugin menu separator
this separator separates the reload plugin option from other plugins
protected void print log final jtext area text area thread t new thread new runnable public void run print text it new print text text area new page format print monitor pm new print monitor it try pm perform print true catch printer exception pe joption pane show message dialog screen resource get string print exception pe get message t start
print the log contained in the given code jtext area code
protected void update progress int progress string progress status current progress progress current progress status progress status avoid updating too much just update if the delta is greater than step current progress last progress updated step or every third of one percent current progress step 0 int step int max progress 0 01 3 boolean update progress last progress updated step current progress step 0 if update get percentage done 9800 last progress updated current progress long task progress changed event event new long task progress changed event get current progress status get percentage done notity observers event
as this progress is an approximation it is going to be updated
public int get counter for node name return counter for node name
this counter is used by
protected void set up throws exception super set up load network from file base io io new net io net probabilistic network io load new file this get class get class loader get resource test cases testmodel defg net to uri start up algorithm for compiling net algorithm new junction tree algorithm probabilistic network net compile net algorithm run extractor in clique conditional probability extractor in clique conditional probability extractor new instance object under test jeffrey rule likelihood extractor new instance
load network and compile it using junction tree algorithm
protected void set up throws exception super set up load network from file base io io new net io net probabilistic network io load new file this get class get class loader get resource test cases testmodel defg net to uri start up algorithm for compiling net algorithm new junction tree algorithm probabilistic network net compile net algorithm run cond prob extractor in clique conditional probability extractor in clique conditional probability extractor new instance
load network and compile it using junction tree algorithm
public void set counter for node name int counter for node name this counter for node name counter for node name
this counter is used by