agg.termination
Class TerminationLGTSTypedByTypeGraph

java.lang.Object
  extended by agg.termination.TerminationLGTSTypedByTypeGraph
All Implemented Interfaces:
TerminationLGTSInterface

public class TerminationLGTSTypedByTypeGraph
extends java.lang.Object
implements TerminationLGTSInterface

This class implements termination conditions of Layered Graph Grammar which is typed by a type graph.


Constructor Summary
TerminationLGTSTypedByTypeGraph()
           
 
Method Summary
 boolean checkTermination()
          Checks layer conditions .
 void dispose()
           
 java.util.Vector<java.lang.Object> getCreatedTypesOnDeletionLayer(java.lang.Integer layer)
           
 java.util.Hashtable<java.lang.Object,java.lang.Integer> getCreationLayer()
          Returns the creation layer of the layer function.
 int getCreationLayer(GraphObject t)
           
 int getCreationLayer(Type t)
           
 java.util.Hashtable<java.lang.Object,java.lang.Integer> getDeletionLayer()
          Returns the deletion layer of the layer function.
 int getDeletionLayer(GraphObject t)
           
 int getDeletionLayer(Type t)
           
 java.util.Hashtable<java.lang.Integer,java.util.Vector<Type>> getDeletionType()
           
 java.util.Hashtable<java.lang.Integer,java.util.Vector<GraphObject>> getDeletionTypeObject()
           
 java.lang.String getErrorMessage()
          Returns an error message if the layer function is not valid.
 GraGra getGrammar()
           
 java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> getInvertedRuleLayer()
           
 java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> getInvertedTypeCreationLayer()
           
 java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> getInvertedTypeDeletionLayer()
           
 java.util.List<Rule> getListOfEnabledRules()
           
 java.util.List<Rule> getListOfRules()
           
 java.util.Vector<java.lang.Integer> getOrderedRuleLayer()
           
 java.util.Hashtable<java.lang.Integer,Pair<java.lang.Boolean,java.util.Vector<Rule>>> getResultDeletion()
           
 java.util.Hashtable<java.lang.Integer,Pair<java.lang.Boolean,java.util.Vector<Rule>>> getResultNondeletion()
           
 java.util.Hashtable<java.lang.Integer,Pair<java.lang.Boolean,java.util.Vector<Rule>>> getResultTypeDeletion()
           
 java.util.Hashtable<Rule,java.lang.Integer> getRuleLayer()
          Returns the rule layer of the layer function.
 int getRuleLayer(Rule r)
           
 java.lang.Integer getStartLayer()
          Returns the smallest layer of the rule layer.
 boolean hasGrammarChanged()
           
 void initAll(boolean generate)
           
 void initRuleLayer(java.util.Hashtable<?,java.lang.Integer> init)
           
 java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> invertLayer(java.util.Hashtable<Rule,java.lang.Integer> layer)
          Inverts a layer function so that the layer is the key and the value is a set.
 boolean isValid()
          A fast check on validity.
 void resetGrammar()
           
 void resetLayer()
           
 void saveRuleLayer()
           
 void setGenerateRuleLayer(boolean b)
           
 void setGrammar(GraGra gra)
          Initialize a termination layers of the grammar.
 void showLayer()
           
 java.lang.String toString()
          Returns the layer function in a human readable way.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TerminationLGTSTypedByTypeGraph

public TerminationLGTSTypedByTypeGraph()
Method Detail

dispose

public void dispose()

setGrammar

public void setGrammar(GraGra gra)
Initialize a termination layers of the grammar. Initially the termination conditions are invalid.

Specified by:
setGrammar in interface TerminationLGTSInterface
Parameters:
gra - The graph grammar.

resetGrammar

public void resetGrammar()
Specified by:
resetGrammar in interface TerminationLGTSInterface

getGrammar

public GraGra getGrammar()
Specified by:
getGrammar in interface TerminationLGTSInterface

getListOfEnabledRules

public java.util.List<Rule> getListOfEnabledRules()
Specified by:
getListOfEnabledRules in interface TerminationLGTSInterface

hasGrammarChanged

public boolean hasGrammarChanged()
Specified by:
hasGrammarChanged in interface TerminationLGTSInterface

getListOfRules

public java.util.List<Rule> getListOfRules()
Specified by:
getListOfRules in interface TerminationLGTSInterface

getInvertedRuleLayer

public java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> getInvertedRuleLayer()
Specified by:
getInvertedRuleLayer in interface TerminationLGTSInterface

getOrderedRuleLayer

public java.util.Vector<java.lang.Integer> getOrderedRuleLayer()
Specified by:
getOrderedRuleLayer in interface TerminationLGTSInterface

getInvertedTypeDeletionLayer

public java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> getInvertedTypeDeletionLayer()
Specified by:
getInvertedTypeDeletionLayer in interface TerminationLGTSInterface

getInvertedTypeCreationLayer

public java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> getInvertedTypeCreationLayer()
Specified by:
getInvertedTypeCreationLayer in interface TerminationLGTSInterface

getDeletionType

public java.util.Hashtable<java.lang.Integer,java.util.Vector<Type>> getDeletionType()
Specified by:
getDeletionType in interface TerminationLGTSInterface

getDeletionTypeObject

public java.util.Hashtable<java.lang.Integer,java.util.Vector<GraphObject>> getDeletionTypeObject()
Specified by:
getDeletionTypeObject in interface TerminationLGTSInterface

getResultTypeDeletion

public java.util.Hashtable<java.lang.Integer,Pair<java.lang.Boolean,java.util.Vector<Rule>>> getResultTypeDeletion()
Specified by:
getResultTypeDeletion in interface TerminationLGTSInterface

getResultDeletion

public java.util.Hashtable<java.lang.Integer,Pair<java.lang.Boolean,java.util.Vector<Rule>>> getResultDeletion()
Specified by:
getResultDeletion in interface TerminationLGTSInterface

getResultNondeletion

public java.util.Hashtable<java.lang.Integer,Pair<java.lang.Boolean,java.util.Vector<Rule>>> getResultNondeletion()
Specified by:
getResultNondeletion in interface TerminationLGTSInterface

resetLayer

public void resetLayer()
Specified by:
resetLayer in interface TerminationLGTSInterface

initRuleLayer

public void initRuleLayer(java.util.Hashtable<?,java.lang.Integer> init)
Specified by:
initRuleLayer in interface TerminationLGTSInterface

initAll

public void initAll(boolean generate)
Specified by:
initAll in interface TerminationLGTSInterface

getCreatedTypesOnDeletionLayer

public java.util.Vector<java.lang.Object> getCreatedTypesOnDeletionLayer(java.lang.Integer layer)
Specified by:
getCreatedTypesOnDeletionLayer in interface TerminationLGTSInterface

checkTermination

public boolean checkTermination()
Checks layer conditions .

Specified by:
checkTermination in interface TerminationLGTSInterface
Returns:
true if conditions are valid.

isValid

public boolean isValid()
A fast check on validity.

Specified by:
isValid in interface TerminationLGTSInterface
Returns:
true if the layer function is valid.

getErrorMessage

public java.lang.String getErrorMessage()
Returns an error message if the layer function is not valid.

Specified by:
getErrorMessage in interface TerminationLGTSInterface
Returns:
The error message.

getRuleLayer

public java.util.Hashtable<Rule,java.lang.Integer> getRuleLayer()
Returns the rule layer of the layer function.

Specified by:
getRuleLayer in interface TerminationLGTSInterface
Returns:
The rule layer.

getRuleLayer

public int getRuleLayer(Rule r)
Specified by:
getRuleLayer in interface TerminationLGTSInterface

getCreationLayer

public java.util.Hashtable<java.lang.Object,java.lang.Integer> getCreationLayer()
Returns the creation layer of the layer function.

Specified by:
getCreationLayer in interface TerminationLGTSInterface
Returns:
The creation layer.

getCreationLayer

public int getCreationLayer(GraphObject t)
Specified by:
getCreationLayer in interface TerminationLGTSInterface

getDeletionLayer

public java.util.Hashtable<java.lang.Object,java.lang.Integer> getDeletionLayer()
Returns the deletion layer of the layer function.

Specified by:
getDeletionLayer in interface TerminationLGTSInterface
Returns:
The deletion layer.

getDeletionLayer

public int getDeletionLayer(GraphObject t)
Specified by:
getDeletionLayer in interface TerminationLGTSInterface

getStartLayer

public java.lang.Integer getStartLayer()
Returns the smallest layer of the rule layer.

Specified by:
getStartLayer in interface TerminationLGTSInterface
Returns:
The smallest layer.

invertLayer

public java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> invertLayer(java.util.Hashtable<Rule,java.lang.Integer> layer)
Inverts a layer function so that the layer is the key and the value is a set.

Specified by:
invertLayer in interface TerminationLGTSInterface
Parameters:
layer - The layer function will be inverted.
Returns:
The inverted layer function.

saveRuleLayer

public void saveRuleLayer()
Specified by:
saveRuleLayer in interface TerminationLGTSInterface

setGenerateRuleLayer

public void setGenerateRuleLayer(boolean b)
Specified by:
setGenerateRuleLayer in interface TerminationLGTSInterface

showLayer

public void showLayer()
Specified by:
showLayer in interface TerminationLGTSInterface

toString

public java.lang.String toString()
Returns the layer function in a human readable way.

Specified by:
toString in interface TerminationLGTSInterface
Overrides:
toString in class java.lang.Object
Returns:
The text.

getCreationLayer

public int getCreationLayer(Type t)
Specified by:
getCreationLayer in interface TerminationLGTSInterface

getDeletionLayer

public int getDeletionLayer(Type t)
Specified by:
getDeletionLayer in interface TerminationLGTSInterface