public class TransformationSystem extends NamedObject implements TransitionSystem
Modifier and Type | Method and Description |
---|---|
Rule |
addRule(Morphism corr)
Creates a new rule based on the given correspondence morphism and adds
it to this transformation system.
|
void |
addRule(Rule rule)
Adds an existing rule to this transformation system.
|
static TransformationSystem |
create(Graph initial,
java.util.Collection<Rule> rules)
Creates a new transformation system.
|
static TransformationSystem |
create(Graph initial,
Rule... rules)
Creates a new transformation system.
|
ExplicitTransitionSystem |
createExplicitTransitionSystem(int maxDepth)
Creates an ExplicitTransitionSystem which is equal to this
TransformationSystem up to a finite depth.
|
Graph |
getInitialGraph()
Returns the initial graph of this transformation system.
|
java.util.Set<Rule> |
getRules()
Returns the set of rules of this transformation system.
|
java.lang.String |
getShortString()
Returns a short string representation of this TransformationSystem.
|
java.util.Set<Label> |
getSignature()
Returns the signature of this TransformationSystem.
|
TransformationParams |
getTransformationParams()
Returns the transformation parameters for this transformation system.
|
java.util.Collection<Transition> |
getTransitions(Graph source)
Returns the outgoing transitions from a source graph.
|
java.util.Collection<Transition> |
getTransitions(Graph source,
int limit)
Returns the transitions of this transformation system from a certain
source graph, with a limit on how many transitions will be returned.
|
boolean |
isIsomorphic(TransformationSystem other)
Determines whether this transformation system is isomorphic to another
transformation system.
|
void |
setInitialGraph(Graph initial)
Sets the initial graph of this graph transformation system.
|
java.lang.String |
toString()
Returns a user-readable string representation of this transformation
system.
|
java.lang.String |
toString(java.lang.String indent)
Returns a user-readable string representation of this transformation
system with a given indentation string.
|
getName, hasName, setName
getAttribute, setAttribute
public TransformationParams getTransformationParams()
public Graph getInitialGraph()
getInitialGraph
in interface TransitionSystem
public void setInitialGraph(Graph initial)
public java.util.Collection<Transition> getTransitions(Graph source)
getTransitions
in interface TransitionSystem
source
- the source graph of the returned transitionspublic java.util.Collection<Transition> getTransitions(Graph source, int limit)
source
- source of the returned transitionslimit
- maximum number of returned transitions; if smaller than or equal
to 0 there is no maximum number of transitionssource
;
if limit > 0
, the returned collection has a size of at
most limit
.java.lang.NullPointerException
- if source
is null
public Rule addRule(Morphism corr)
corr
- the correspondence morphism of the new rule; the left-hand side of
the new rule will be corr.getDomain()
, the right-hand side
will be corr.getCodomain()
public void addRule(Rule rule)
rule
- the rule which is to be added to this transformation systempublic java.util.Set<Rule> getRules()
public java.util.Set<Label> getSignature()
public ExplicitTransitionSystem createExplicitTransitionSystem(int maxDepth)
The maxDepth
parameter controls how much transitions from the
initial graph are generated. If it is positive, only graphs and
transitions which are reachable within maxDepth
steps from
the initial graph are generated. If it is negative, no bound is imposed
and the complete transition system is generated.
Warning! Do not set maxDepth
to a negative
value when there are infinitely many graphs reachable from the initial
graph; in this case the behavior of this method is undefined (most
probably, it will take a while to eat up all memory and terminate with
an exception).
maxDepth
- the number of transitions from the initial graph which are generatedmaxDepth
transitions from the
initial graphpublic boolean isIsomorphic(TransformationSystem other)
other
- transformation system to test isomorphism withtrue
if this transformation system is isomorphic to the
given transformation system, false
otherwisepublic java.lang.String toString(java.lang.String indent)
indent
- indentation string of the string representationpublic java.lang.String getShortString()
public java.lang.String toString()
toString
in class java.lang.Object
public static TransformationSystem create(Graph initial, Rule... rules)
initial
- initial graph of the transformation systemrules
- rules of the transformation systempublic static TransformationSystem create(Graph initial, java.util.Collection<Rule> rules)
initial
- initial graph of the transformation systemrules
- rules of the transformation system