|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnenok.lc.JoinTree
public abstract class JoinTree
This is the head class for the various join tree implementations. Each join tree class is equivalent to an architecture of local computation.
Nested Class Summary | |
---|---|
class |
JoinTree.Construction
Inner class wrapping all necessary data for the join tree construction process. |
Field Summary | |
---|---|
protected Adapter |
adapter
|
protected Node |
root
|
Constructor Summary | |
---|---|
protected |
JoinTree(Knowledgebase kb,
Collection<Domain> queries,
Algorithm algo)
Constructor: |
Method Summary | |
---|---|
Valuation |
answer(Domain query)
Method to answer a given query represented by a domain. |
void |
collect()
Executes the collect propagation. |
boolean |
containsRemoteData()
|
int |
countNodes()
|
abstract Node |
createNode()
|
void |
distribute(boolean... args)
Executes the distribute propagation. |
Adapter |
getAdapter()
|
Allocator |
getAllocator()
|
abstract String |
getArchitecture()
|
double |
getCollectTime()
|
Algorithm |
getConstructionAlgorithm()
|
JoinTree.Construction |
getConstructionData()
|
double |
getDistributeTime()
|
Domain |
getLargestDomain()
|
Set<Uuid> |
getProcessorSet()
|
double |
getPropagationTime()
|
Collection<Domain> |
getQueries()
|
Node |
getRoot()
|
Domain |
getTreeDomain()
|
boolean |
isBinary()
|
boolean |
isCollected()
|
boolean |
isDistributed()
|
Iterator<Node> |
iterator()
Join trees can iterate over their nodes. |
void |
makeBinary()
Transforms this join tree to a binary join tree. |
void |
propagate(boolean... args)
Executes collect & distribute propagation. |
abstract void |
scale()
Performs the scaling operations for this architecture. |
void |
setRoot(Node node,
boolean redirect)
Changes the root node of this jointree. |
String |
toASCII(boolean content)
Prints the jointree as ASCII string. |
String |
toString()
|
abstract boolean |
verify(Class type)
Verifies that the given knowledgebase can indeed be used with this architecture. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Node root
protected Adapter adapter
Constructor Detail |
---|
protected JoinTree(Knowledgebase kb, Collection<Domain> queries, Algorithm algo) throws ConstrException
kb
- The knowledgebase to build a jointree.queries
- The set of queries that must be covered by this join tree.algo
- The construction algorithm to build the tree.
ConstrException
Method Detail |
---|
public abstract void scale() throws LCException
Scalability
.
LCException
- Exception thrown while executing the scaling operation.public abstract String getArchitecture()
public abstract boolean verify(Class type)
type
- The type of the locators that are contained in the knowledgebase.
true
, if the knowledgebase satifies the mathematical restrictions for this architecture.public abstract Node createNode()
public Collection<Domain> getQueries()
public void propagate(boolean... args) throws LCException
args
- args[0] = false
averts scaling if the
valuation algebra instance is of type Scalability
.
LCException
- Exception thrown during join tree propagation.public void collect() throws LCException
LCException
- Exception thrown during join tree propagation.public void distribute(boolean... args) throws LCException
args
- args[0] = false
averts scaling if the
valuation algebra instance is of type Scalability
.
LCException
- Exception thrown when trying to execute distribute before collect has been terminated.public Valuation answer(Domain query) throws LCException
query
- The query to answer.
LCException
- Exception caused from communication problems when dealing with remote valuations.public double getCollectTime()
-1
, if collect has not yet been executed.public double getDistributeTime()
-1
, if distribute has not yet been executed.public double getPropagationTime()
-1
, if the propagation has not yet been executed.public Adapter getAdapter()
public Allocator getAllocator()
null
if either propagation has not yet been executed or join tree has been
constructed from a local knowledgebase.public Algorithm getConstructionAlgorithm()
public JoinTree.Construction getConstructionData()
Algorithm
, because
those object must obviously be created beforehand.public Node getRoot()
public void setRoot(Node node, boolean redirect) throws ConstrException
node
- The new root node.redirect
- Flag that indicates NENOK if the jointree needs to be redirected.
true
, NENOK redirects the jointree edges to the new root node according to (Kohlas 2003).false
, the root node is changed but no redirection is performed.ConstrException
- Exception thrown when new root is inappropriate.
Attention: if the flag is set to false
, the user needs to take the responsibility for the
jointree's correctness. This functionality is provided for updating reasons (Schneuwly & Kohlas 2006).public Iterator<Node> iterator()
iterator
in interface Iterable<Node>
Iterable.iterator()
public Domain getLargestDomain()
public Domain getTreeDomain()
public int countNodes()
public Set<Uuid> getProcessorSet()
public String toString()
toString
in class Object
Object.toString()
public String toASCII(boolean content)
content
- true
to print the content of each node.
public boolean isCollected()
true
, if the collect algorithm has been executed.public boolean isDistributed()
true
, if the distribute algorithm has been executed.public boolean isBinary()
true
, if this join tree is binary.public boolean containsRemoteData()
true
, if this join tree has been created from a remote knowledgebase.public void makeBinary()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |