ls
Class Clique

java.lang.Object
  |
  +--ls.Clique

public class Clique
extends java.lang.Object

This class represents a Clique. It is one of the structures that is used in the L-S algorithm.


Field Summary
protected  java.util.Vector children
           
protected  java.util.Vector clq
           
protected  int number
           
protected  Clique parent
           
protected  Potential potential
           
protected  java.util.Vector r
           
protected  java.util.Vector s
           
protected  java.util.Vector sets
           
 
Constructor Summary
Clique()
          Creates an empty clique.
 
Method Summary
 void addChild(java.lang.Object child)
           
 void addCliqueSet(CliqueSet cs)
          Adds a new CliqueSet
 void addCliqueSet(java.util.Vector o, double fi, double probability)
          Adds a new CliqueSet to the list of set.
 Clique getChild(int index)
          Returns a specific child of this clique.
 java.util.Vector getChildren()
          This returns all of the children that are associated with a particular clique.
 java.util.Vector getCliqueSet()
          Returns all of the CliqueSets.
 CliqueSet getCliqueSet(int index)
          Returns an individual clique set.
 java.util.Vector getClq()
          Returns all of the Vertexs that make up this clique.
 java.lang.Object getClq(int index)
           
 int getClqSize()
           
 int getNumber()
          Returns the clique number.
 Clique getParent()
          Returns the parent of this clique.
 Potential getPotential()
          Returns the formula for the calculation of the potential for this clique.
 java.util.Vector getR()
          Returns all of the relative vertexs of the clique.
 java.lang.Object getR(int index)
          Returns the specificed relative vertex.
 java.util.Vector getS()
          Returns all of the non realative vertices for this clique.
 java.lang.Object getS(int index)
          Returns a particlular non relative vertex of the clique.
 int numChildren()
          Returns the number of children that this clique has.
 void removeEvidenceNodes(NodeManager manager)
           
 void setChild(Clique child)
          Adds a new child to this clique.
 void setChildren(java.util.Vector v)
           
 void setCliqueSet(java.util.Vector v)
           
 void setClq(java.lang.Object o)
          Sets an individual vertex in this clique
 void setClq(java.util.Vector clq)
           
 void setClqVector(java.util.Vector clq)
          Sets all of the Vertices that are included in one clique.
 void setNumber(int number)
          Sets the Clique Number.
 void setParent(Clique parent)
          Sets the parent of the clique.
 void setPotential(Potential potential)
          Sets the cpt calculations that make up the potential for this clique.
 void setR(java.lang.Object o)
          Adds the relative vertex to the list.
 void setRVector(java.util.Vector newR)
           
 void setS(java.lang.Object o)
          Adds a vertex to the cliques non realtive vertices list.
 void setSVector(java.util.Vector newS)
           
 int sizeCliqueSet()
          Returns the number of items in the clique set.
 int sizeR()
          Returns the number of relative vertices in this clique.
 int sizeS()
          Returns the number of non relative vertices in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

number

protected int number

parent

protected Clique parent

children

protected java.util.Vector children

clq

protected java.util.Vector clq

r

protected java.util.Vector r

s

protected java.util.Vector s

potential

protected Potential potential

sets

protected java.util.Vector sets
Constructor Detail

Clique

public Clique()
Creates an empty clique.
Method Detail

setNumber

public void setNumber(int number)
Sets the Clique Number.
Parameters:
number - the number of this clique

getNumber

public int getNumber()
Returns the clique number.
Returns:
number - the number of this clique

setParent

public void setParent(Clique parent)
Sets the parent of the clique. The clique that is the root of the clique tree will have a parent that is null. This is a pointer to the parent.
Parameters:
parent - the parent of this clique

getParent

public Clique getParent()
Returns the parent of this clique.
Returns:
parent - this cliques parent

setChild

public void setChild(Clique child)
Adds a new child to this clique. A clique can have multiple children. This will add the child to the end of the child list.
Parameters:
child - the child to be added to this clique

addChild

public void addChild(java.lang.Object child)

setChildren

public void setChildren(java.util.Vector v)

getChildren

public java.util.Vector getChildren()
This returns all of the children that are associated with a particular clique.
Returns:
children - all of this cliques childern

getChild

public Clique getChild(int index)
Returns a specific child of this clique.
Parameters:
index - the specific child to return
Returns:
child - the child at the index

numChildren

public int numChildren()
Returns the number of children that this clique has.
Returns:
num - how many children a clique has

setClqVector

public void setClqVector(java.util.Vector clq)
Sets all of the Vertices that are included in one clique.
Parameters:
clq - all of the vertices in this clique

setClq

public void setClq(java.util.Vector clq)

setClq

public void setClq(java.lang.Object o)
Sets an individual vertex in this clique
Parameters:
clq - a vertex of this clique

getClq

public java.util.Vector getClq()
Returns all of the Vertexs that make up this clique.
Returns:
clq - all of the vertices in this clique

getClq

public java.lang.Object getClq(int index)
                        throws IllegalCliqueIndexException

getClqSize

public int getClqSize()

setR

public void setR(java.lang.Object o)
Adds the relative vertex to the list.
Parameters:
o - the vertex to be added

getR

public java.util.Vector getR()
Returns all of the relative vertexs of the clique.
Returns:
r all of the relative vertices

getR

public java.lang.Object getR(int index)
Returns the specificed relative vertex. Null is returned if the vertex doesn't exist.
Parameters:
index - the location of the vertex
Returns:
r - the vertex at the location

sizeR

public int sizeR()
Returns the number of relative vertices in this clique.
Returns:
size the number of relative vertices

setS

public void setS(java.lang.Object o)
Adds a vertex to the cliques non realtive vertices list.
Parameters:
o - the vertex to be added

getS

public java.util.Vector getS()
Returns all of the non realative vertices for this clique.
Returns:
s - all of the non relative vertices

getS

public java.lang.Object getS(int index)
Returns a particlular non relative vertex of the clique. If the location doesn't exist null will be returned.
Parameters:
index - the location of the vertex
Returns:
- the vertex

sizeS

public int sizeS()
Returns the number of non relative vertices in the list.
Returns:
size - the number of non relative vertices.

setPotential

public void setPotential(Potential potential)
Sets the cpt calculations that make up the potential for this clique. This is just a formula that represents what would be done to calculate the potential.
Parameters:
potential - the potential for this clique

getPotential

public Potential getPotential()
Returns the formula for the calculation of the potential for this clique.
Returns:
potential - the structure that stores all of the cpt's that make up this potential

addCliqueSet

public void addCliqueSet(java.util.Vector o,
                         double fi,
                         double probability)
Adds a new CliqueSet to the list of set.
Parameters:
o - the configuration of the set
fi - the fi value
probability - the probability

setSVector

public void setSVector(java.util.Vector newS)

setRVector

public void setRVector(java.util.Vector newR)

removeEvidenceNodes

public void removeEvidenceNodes(NodeManager manager)

setCliqueSet

public void setCliqueSet(java.util.Vector v)

addCliqueSet

public void addCliqueSet(CliqueSet cs)
Adds a new CliqueSet
Parameters:
cs - the CliqueSet to be added.

getCliqueSet

public java.util.Vector getCliqueSet()
Returns all of the CliqueSets.
Returns:
sets all of the clique sets

getCliqueSet

public CliqueSet getCliqueSet(int index)
Returns an individual clique set. If one doesn't exist at the specified location null is returned.
Parameters:
index - the location of the CliqueSet
Returns:
cliqueset - the CliqueSet to be returned

sizeCliqueSet

public int sizeCliqueSet()
Returns the number of items in the clique set.
Returns:
size - the size of the set