input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public boolean is to use order of ubffile return to use order of ubffile
|
this boolean attribute indicates that this
|
public void test get instance domain resident node probabilistic node probabilistic node pnode new probabilistic node ssbnnode node ssbnnode get instance null this resident pnode false ssbnnode node ssbnnode get instance null this resident pnode assert not null node assert equals node get resident this resident assert equals node get prob node pnode assert equals 3 node get actual values size contains true false and absurd assert equals node get parents size 0 assert equals node get probabilistic network get node pnode get name pnode
|
test method for
|
public void set to use order of ubffile boolean to use order of ubffile this to use order of ubffile to use order of ubffile
|
this boolean attribute indicates that this
|
public void set has argument property name string has argument property name this has argument property name has argument property name
|
this is the name of has argument property name
|
public void test has ovstring boolean assert true this ssbnnode has ov null true assert true this ssbnnode has ov null false assert true this ssbnnode has ov st true assert true this ssbnnode has ov t true assert true this ssbnnode has ov st4 false assert true this ssbnnode has ov t0 false assert true this ssbnnode has ov z true assert true this ssbnnode has ov s true assert true this ssbnnode has ov st2007 false assert true this ssbnnode has ov t2000 false
|
test method for
|
protected boolean load finding module knowledge base kb string name of file try kb load module new file name of file true return true catch exception e e print stack trace log manager appendln e to string return false
|
load a finding module of a plm file
|
public void test remove domain mfrag try mfrag mfrag new mfrag test remove domain mfrag mebn assert equals mebn get mfrag count 1 assert equals mebn get mfrag list get 0 mfrag assert equals mebn mfrag get multi entity bayesian network mebn remove domain mfrag mfrag assert equals mebn get mfrag count 0 assert true mebn get mfrag list contains mfrag assert true mebn get mfrag list is empty assert null mfrag get multi entity bayesian network catch exception e fail e get message
|
test method for
|
public void test get mfrag list mfrag mfrag1 new mfrag mfrag mebn mfrag mfrag3 new mfrag mfrag mebn assert true mebn get mfrag list contains mfrag1 assert equals mebn get mfrag list get mebn get mfrag list index of mfrag1 mfrag1 assert true mebn get mfrag list contains mfrag3 assert equals mebn get mfrag list get mebn get mfrag list index of mfrag3 mfrag3
|
test method for
|
public void test get domain mfrag list mfrag mfrag1 new mfrag mfrag mebn mfrag mfrag3 new mfrag mfrag mebn assert true mebn get domain mfrag list contains mfrag1 assert equals mebn get domain mfrag list get mebn get mfrag list index of mfrag1 mfrag1 assert true mebn get domain mfrag list contains mfrag3 assert equals mebn get domain mfrag list get mebn get domain mfrag list index of mfrag3 mfrag3
|
test method for
|
public void test get mfrag count mfrag mfrag1 new mfrag mfrag mebn mfrag mfrag3 new mfrag mfrag mebn assert equals mebn get mfrag count 2
|
test method for
|
public void test get current mfrag assert null mebn get current mfrag mfrag mfrag new mfrag mfrag this temp mebn mebn add domain mfrag mfrag assert equals mebn get current mfrag mfrag mebn remove domain mfrag mfrag assert null mebn get current mfrag mebn set current mfrag mfrag assert equals mebn get current mfrag mfrag
|
test method for
|
public void test get multi entity bayesian network multi entity bayesian network mebn2 new multi entity bayesian network test get multi entity bayesian network mebn mfrag mfrag2 new mfrag test get multi entity bayesian network mebn2 assert not null mfrag get multi entity bayesian network assert not null mfrag2 get multi entity bayesian network assert equals mfrag get multi entity bayesian network mebn assert equals mfrag2 get multi entity bayesian network mebn2 assert true mfrag get multi entity bayesian network equals mfrag2 get multi entity bayesian network
|
test method for
|
public void record log this finish log resource files get string path heppar iitest directory test file name
|
record the log informations
|
public void test load findings file try this controller load findings file new file plm file name catch exception e e print stack trace fail e get message
|
test method for
|
public void start probabilistic network pn int n trials this set network pn this sample size n trials this marginal map new hash map node float float marginal for node node pn get nodes marginal new float node get states size for int i 0 i marginal length i marginal i 0 0f marginal map put node marginal super start pn n trials normalize marginals n trials
|
responsible for setting the initial variables for likelihood weighting
|
public void test set node as finding this ssbnnode set node as finding this mebn get categorical states entity container create categorical entity char zaku the old un bbayes expected to have 1 actual value when set to finding but today the actual values must return every possible values assert equals 3 this ssbnnode get actual values size try assert equals this mebn get categorical states entity container get categorical state char zaku this ssbnnode get value catch categorical state does not exist exception e fail e get message
|
test method for
|
private void show graph mfrag mfrag m frag multi entity bayesian network set current mfrag m frag this get screen get graph pane reset graph mebn edition pane show title graph m frag get name m frag active m frag
|
show the graph of the mfrag and select it how active mfrag
|
private void show graph mfrag multi entity bayesian network set current mfrag null mebn edition pane hide top component mebn edition pane set empty bar active m frag active null
|
show a empty mfrag graph
|
public int get node count return node list size
|
this is equivalent to calling
|
public node get node at int index return node list get index
|
returns a node in this network given an index
|
public node get node string name int index get node index name if index 1 return null return node list get index
|
returns the node that has the given name
|
public int get node index string name integer index node indexes get name if index null return 1 return index int value
|
return the index for the node with the given name
|
public void remove edge edge edge edge get origin node remove child edge get destination node edge get destination node remove parent edge get origin node remove arc edge
|
remove the edge
|
public void add node node node node list add node set its index and add the listener to make sure it is always updated node indexes put node get name new integer node list size 1 node add node name changed listener node name changed listener
|
add the node
|
public void add edge edge edge throws invalid parent exception if this get edges contains edge avoid duplicate edges debug println this get class attempt to insert duplicate edge edge get origin node edge get destination node return edge get origin node add child edge get destination node edge get destination node add parent edge get origin node edge list add edge if edge get destination node instanceof irandom variable irandom variable v2 irandom variable edge get destination node iprobability function aux tab v2 get probability function aux tab add variable edge get origin node
|
adds an edge into the net
|
public double get cdfupper bound double probability double z probability math inverse normal probability double x math sqrt variance z mean return x
|
calculate x using the standard normal distribution from the p z z
|
public double get cdf double x double z x mean math sqrt variance double probability probability math normal cdf z return probability
|
calculate p x x using the standard normal distribution p z z
|
private void remove arc edge edge node aux no irandom variable aux tabled variable potential table aux potential table edge list remove edge aux no edge get destination node if aux no instanceof irandom variable aux tabled variable irandom variable aux no aux potential table potential table aux tabled variable get probability function aux potential table remove variable edge get origin node true
|
remove edge of the network
|
public double get probability double ini double end return get cdf end get cdf ini
|
calculate probability for an interval from cdf
|
public double get probability double x return probability math get normal pdf x this mean this variance
|
returns the probability of a given value x for this normal distribution
|
protected void clear nodes node list clear
|
clean the node list
|
protected void clear edges edge list clear
|
clean the edge list
|
public int has edge node node1 node node2 return has edge node1 node2 edge list
|
verifies existence of an edge
|
protected void create 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 continuous node list size init order queue node added list for int i 0 i node order queue size i all children of continuous nodes are also continuous node node node order queue get i add to order queue node get children node added list
|
creates the queue of the nodes that are going to be analyzed
|
public void set constant at int constant index double value int multidimensional coord ndf list get linear coord multidimensional coord set constant at constant index value
|
set the constant that multiplies the continuous parent node at index to the
|
public void set constant at int constant index double value int index ndf list index set constant at constant index value
|
set the constant that multiplies the continuous parent node at index to the
|
protected void init order queue boolean node added list for int i 0 i continuous node list size i node node continuous node list get i boolean has continuous parent false for node parent node node get parents if parent node get type node continuous node type has continuous parent true break if has continuous parent node added list i true node order queue add node
|
initializes the queue with the nodes that are root
|
public void compile throws exception todo remove double dispatch junction tree algorithm is calling this method by migrating this code to junction tree algorithm class if node list size 0 throw new exception resource get string empty net exception if create log log manager reset verify consistency moralize triangula if get junction tree builder null initialize it if not initialized yet set junction tree builder new default junction tree builder compile jt this get junction tree builder build junction tree this
|
it does all the steps to compile a network using junction tree method
|
public ijunction tree builder get junction tree builder return junction tree builder
|
this is used in
|
public void set junction tree builder ijunction tree builder junction tree builder this junction tree builder junction tree builder
|
this is used in
|
public void set mean double mean int multidimensional coord ndf list get linear coord multidimensional coord set mean mean
|
set the normal distribution mean for the given combination of discrete
|
public void update marginal this marginal
|
this method has to be overwritten in order to
|
public void set mean double mean int index ndf list index set mean mean
|
set the normal distribution mean for the given combination of discrete
|
public float get marginal at int index by young if marginal list null return marginal list index return 0 0f by young end
|
return the marginal probability associated to a specific index state
|
protected void ajust plugin button size abstract button btn add plugin node adds an horizontal gap at left and right measuring 5 px each that would need 10px extra for width btn add plugin node set preferred size new dimension 55 btn add plugin node get height btn add plugin node set size btn add plugin node get preferred size btn add plugin node set maximum size btn add plugin node get preferred size btn add plugin node set border border factory create empty border 0 0 0 10
|
this method is called at constructor in order to ajust plugin nodes
|
public void set variance double variance int multidimensional coord ndf list get linear coord multidimensional coord set variance variance
|
set the normal distribution variance for the given combination of discrete
|
public boolean has evidence return evidence 1
|
returns true if there is evidence associated to the node false otherwise
|
protected integer get index in queue node node for int i 0 i node order queue size i if node get name equals node order queue get i get name return i return null
|
retrieves the nodes index in the queue
|
public void set variance double variance int index ndf list index set variance variance
|
set the normal distribution variance for the given combination of discrete
|
public void add finding int state index this add finding state index false
|
add the state associated to the given index as the evidence
|
public void add finding int state index boolean is negative float likelihood new float get states size likelihood state index 1 set marginal probabilities likelihood evidence state index for int i 0 i get states size i if not is negative set marginal to 1 if stateindex i 0 otherwise if is negative set marginal to 0 if stateindex i 1 otherwise set marginal at i i state index is negative 0 1 is negative 1 0
|
add the state associated to the given index as the evidence
|
protected void calculate factors int size discrete parent list size if factors null factors length size factors new int size if there is no discrete parent then there is only one normal distribution if size 0 factors new int 1 factors 0 1 node node for int i 1 i size i node discrete parent list get i 1 factors i factors i 1 node get states size
|
calculate the factors necessary to transform the linear coordinate into a multidimensional
|
protected probabilistic network clone pn probabilistic network network probabilistic network clone null xmlbifio io new xmlbifio try todo rommel change this name to a default one but that will not cause concurrent problems file file new file clone xml io save file network clone probabilistic network io load file file delete catch ioexception e todo auto generated catch block e print stack trace catch class cast exception e todo handle exception e print stack trace return clone
|
as i am not sure if the clone methods are corrected
|
public void add likeli hood float likelihood this add likeli hood likelihood null
|
this is the same of
|
public int get linear coord int multidimensional coord calculate factors int coord linear 0 int size discrete parent list 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 int function size return ndf list length
|
returns the number of normal distribution functions
|
public irandom variable get associated clique return this clique associado
|
returns the clique associated to this variable
|
public void set mean double mean normal distribution set mean mean
|
set the normal distribution mean
|
public void set associated clique irandom variable clique this clique associado clique
|
associate this variable to the given clique
|
protected void update evidences if evidence 1 potential table aux tab potential table clique associado get probability function int index aux tab index of variable this the following 2 lines were migrated to potential table update evidences aux tab compute factors update recursive aux tab 0 0 index 0 aux tab update evidences marginal list index
|
it currently delegates to
|
public void set variance double variance normal distribution set variance variance
|
set the normal distribution variance
|
protected void set likelihood parents list inode likelihood parents if likelihood parents null this likelihood parents likelihood parents else this is trying to set to null if this likelihood parents null this likelihood parents clear else this likelihood parents new array list inode
|
this list is related to
|
public void set constant at int index double value constant list index value
|
set the given constant for the given value
|
public void test add context node mfrag temp new mfrag test add ordinary variable mebn context node context new context node context temp mfrag add context node context assert equals mfrag get context node count 1 assert equals mfrag get context node num 1 assert true mfrag contains context node context assert true mfrag contains node context assert equals context get mfrag mfrag
|
test method for
|
public float normalize throws exception boolean fixo new boolean nos size array list node decisoes new array list node for int i 0 i nos size i if nos get i get type node decision node type decisoes add nos get i fixo i true if decisoes size 0 return potential table normalize int index new int decisoes size for int i 0 i index length i index i nos index of decisoes get i normalize id 0 decisoes fixo index new int nos size todo retornar a constante de normalizacao correta return 0
|
normalizes a clique in a junction tree
|
public iarbitrary conditional probability extractor get conditional probability extractor return conditional probability extractor
|
this object is used in
|
public void set parent clique parent this parent parent
|
the parent of this clique
|
protected void make adjacents list for node list elements this clear adjacents for int qnos 0 qnos node list size qnos node list get qnos make adjacents
|
build the adjacent list of each node in node list then adjacent list
|
public void add child clique child children add child
|
add a child clique to this clique
|
public boolean existe estado string nome estado int tamanho states size for int tamanho estado 0 tamanho estado tamanho tamanho estado if states get tamanho estado equals nome estado return true return false
|
method indicating state existence for this node
|
public void test add generative input node mfrag temp new mfrag test add ordinary variable mebn input node node new input node node temp mfrag add input node node assert equals mfrag get generative input node count 1 assert equals mfrag get generative input node num 1 assert true mfrag contains generative input node node assert true mfrag contains node node assert equals node get mfrag mfrag
|
test method for
|
public void remove child clique c children remove c
|
remove the specified children
|
public dto aware list item action listener inode class data transfer object dto this dto dto
|
default constructor initializing the dto
|
protected void clear adjacents int size node list size for int qnos 0 qnos size qnos node list get qnos clear adjacents
|
for each node in the graph destroys the list of their adjacent nodes
|
public void test add domain resident node mfrag temp new mfrag test add ordinary variable mebn resident node node new resident node node temp mfrag add resident node node assert equals mfrag get domain resident node count 1 assert equals mfrag get domain resident node num 1 assert true mfrag contains domain resident node node assert true mfrag contains node node assert equals node get mfrag mfrag
|
test method for
|
public void copy data data copy size data pt size data copy data new float data pt size system arraycopy data pt data 0 data copy data 0 data pt size int data size data pt size data copy ensure capacity data size data copy size data size for int i 0 i data size i data copy data i data pt data i
|
creates a copy of the data from the table
|
public void verify cycles throws exception int node size node list size char visited new char node size int pi new int node size for int i 0 i node size i dfs cycle i visited pi
|
verify if this network has cycle
|
public void restore data int data size data pt size for int i 0 i data size i data pt data i data copy data i
|
restores the data from the table using its stored copy
|
protected void colete evidencia clique clique throws exception for clique aux clique clique get children if aux clique get children is empty this colete evidencia aux clique separator sep get separator clique aux clique clique absorb aux clique sep get potential table if aux clique get probability function get variables size 1 absorb clique aux clique else a clique with only 1 variable is equivalent to a bn with only 1 node there is no prob dist at all so no need to propagate total estimated prob clique normalize
|
processes the collection of evidences
|
public void test remove generative input node input node node new input node node mfrag mfrag remove input node node assert true mfrag contains generative input node node assert true mfrag contains node node assert true node get mfrag equals mfrag
|
test method for
|
public void init belief irandom variable rv if rv instanceof clique this init belief clique rv return else if rv instanceof separator this init belief separator rv return throw new illegal argument exception rv clique class get name rv separator class get name
|
initializes the probability potential of a random variable
|
public void init belief separator aux sep initialize table related to probabilistic nodes potential table aux tab pot aux sep get probability function int size dados aux tab pot table size for int c 0 c size dados c aux tab pot set value c 1 initialize table related to utility nodes potential table aux util tab aux sep get utility table size dados aux util tab table size for int i 0 i size dados i aux util tab set value i 0
|
initializes the probability potential of a separator
|
private string create path int current index int node index int pi boolean first if current index node index first return node list get current index get name return create path pi current index node index pi false node list get current index get name
|
auxiliary method for dfs cycle to construct the path of the cycle detected
|
public void verify conectivity throws exception list node visitados new array list node node list size if node list size 1 return make adjacents list for node list elements dfs connectivity node list get 0 visitados clear adjacents if visitados size node list size throw new exception resource get string disconected net exception
|
it verifies if the network is connected
|
public clique get clique containing all nodes single entity network single entity network collection inode nodes collection clique cliques this get cliques containing all nodes single entity network nodes 1 if cliques null cliques is empty return null return cliques iterator next
|
this is a wrapper for
|
private void dfs connectivity node no list node visitados visitados add no for int i 0 i no get adjacents size i node aux no get adjacents get i if visitados contains aux dfs connectivity aux visitados
|
depth first search to verify connectivity
|
public potential table get probability function return tabela pot
|
returns the probabilistic table of this variable
|
public temp table header cell get default clause if this is empty nested clauses if this is default return this else if this code is reached this object should have been returned but its not a default clause return null else search for a default clause recursively by looking only the last nested if clause obs the last nested if clause should be the default else clause return this get nested clauses get this get nested clauses size 1 get default clause
|
searches recursively for the most default clause of nested ifs
|
public node build node try return build plugin node get node catch instantiation exception e throw new runtime exception e catch illegal access exception e throw new runtime exception e
|
this method is eqivalent to
|
public class get node class return clazz
|
this is the class implementing iplugin node which
|
public void set node class class clazz if iplugin node class is assignable from clazz throw new illegal argument exception the class set by set node class class is not a iplugin node this clazz clazz
|
this is the class implementing iplugin node which
|
public void set create log boolean create log this create log create log
|
sets the create log
|
public object clone potential table aux tab new instance perform fast arraylist copy aux tab variable list new array list node variable list perform fast array copy aux tab data pt size data pt size aux tab data pt data new float data pt size system arraycopy data pt data 0 aux tab data pt data 0 data pt size int size dados data pt size for int c 0 c size dados c aux tab data pt add data pt data c return aux tab
|
returns a copy of the data from the table
|
public potential table get probability function return this util table
|
gets the tabela pot attribute of the tvu object
|
public object clone probabilistic node new node potential table aux tab new instance aux tab add variable new node for node node new node get parents aux tab add variable node int size dados data pt size for int c 0 c size dados c aux tab data pt add data pt data c return aux tab
|
returns a copy of the data from the table associated with the new
|
public int get information type return information type
|
returns the type of information of this node
|
public void set value int coord float value data pt data get linear coord coord value
|
set a value in the table using the multidimensional coordinate
|
public void set information type int information type throws exception if information type 2 information type 5 this information type information type todo rommel think of a better way of doing this if get color probabilistic node get description color information type node explanation type this set color probabilistic node get explanation color
|
modify the nodes type of information
|
public void on after propagate iinference algorithm algorithm if algorithm null debug println get class algorithm null return if algorithm get network null algorithm get network instanceof single entity network single entity network network single entity network algorithm get network if network is connected network is disconnected if network get junction tree null extract all cliques and normalize them for clique clique network get junction tree get cliques try clique normalize for node node clique get associated probabilistic nodes if node instanceof tree variable tree variable node update marginal catch exception e throw new runtime exception e
|
guarantee that each clique is normalized if the network is disconnected
|
public void set value int index float value data pt data index value
|
set a value in the table using the linear coordinate
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.