public class SyntacticGraph extends CompositeEntity
CompositeEntity.ContainedObjectsIterator_levelCrossingLinks_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS| Constructor and Description |
|---|
SyntacticGraph()
Create new instance of SyntacticGraph with no container.
|
SyntacticGraph(CompositeEntity container,
java.lang.String name)
Construct an instance of SyntacticGraph in a given container.
|
SyntacticGraph(Workspace workspace)
Create new instance of SyntacticGraph in a given workspace.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addExteriorNode(SyntacticNode node)
Add node that represents an exterior port.
|
protected void |
_addRepresentativeNode(SyntacticNode node)
Add representative SyntacticNode to graph and associated maps.
|
protected void |
_clearMarked()
Clear all the visited flags in the nodes.
|
protected void |
_clearVisited()
Clear all the visited flags in the nodes.
|
protected java.lang.Integer |
_getInputChannel(Port oport,
int ochan,
Port iport)
Get the input channel connected to in a given port from a given output port and channel.
|
protected java.util.LinkedList<SyntacticNode> |
_getInputs()
Get list of input ports for model.
|
protected java.lang.Integer |
_getOutputChannel(Port oport,
Port iport,
int ichan)
Get the output channel connected to in a given port from a given input port and channel.
|
protected java.util.LinkedList<SyntacticNode> |
_getOutputs()
Get list of output ports for model.
|
protected java.util.Collection<SyntacticNode> |
_getRootSet()
Get the set of initial nodes as a Collection.
|
protected void |
_makeConnection(SyntacticPort out,
SyntacticPort in)
Make connection between SyntacticPorts in Syntactic Nodes.
|
protected void |
_removeConnection(SyntacticPort port)
Remove connection from SyntacticPorts in Syntactic Nodes.
|
java.lang.String |
addLabelFromNode(SyntacticNode node)
Add a unique label to given node or return its current label.
|
void |
addNode(Entity entity)
Add entity to the syntactic graph wrapping with syntactic node.
|
void |
addNode(SyntacticNode node)
Add a SyntacticNode to the Graph.
|
void |
addNode2(Entity entity)
Add entity to the syntactic graph wrapping with syntactic node.
|
boolean |
build(CompositeEntity model)
Build the syntactic graph from the given model.
|
java.lang.String |
description(java.lang.String prefix,
java.lang.String suffix)
Print description of Syntactic Graph.
|
java.lang.String |
generateCode()
Generate code for model represented by graph.
|
java.lang.String |
getLabelFromNode(SyntacticNode node)
Get the label associated with a give node.
|
SyntacticNode |
getNodeFromLabel(java.lang.String label)
Get the node associated with a given label or null.
|
void |
insertPermutations()
Insert permutation objects between columns.
|
boolean |
isBijective()
Determine whether the graph has been made completely bijective.
|
boolean |
isFeedbackRemoved()
Determine whether feedback has been removed.
|
void |
layoutGraph()
Layout graph for display in columns.
|
void |
makeBijective()
Make SyntacticGraph bijective by adding pure nodes.
|
void |
removeFeedback()
Remove feedback from graph and draw connections out to periphery.
|
static java.lang.String |
stringJoin(java.util.List<java.lang.String> stringList,
java.lang.String infix)
Join a list of strings with a given infix.
|
void |
structure()
Structure the graph into columns.
|
_addEntity, _addRelation, _adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _finishedAddEntity, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, clone, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, isOpaque, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, newRelation, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, setContainer, statistics, uniqueName_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, newPort, propagateExistence, setName_addPort, _removePort, connectedPortList, connectedPorts, connectionsChanged, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDerivedLevel, getDerivedList, propagateValuedescription, getDisplayName, getFullName, getName, getNamepublic SyntacticGraph()
public SyntacticGraph(Workspace workspace)
workspace - Workspace in which to create the syntactic graph.public SyntacticGraph(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container - The container entity.name - The name of the entity.IllegalActionException - If the entity cannot be contained
by the proposed container.NameDuplicationException - If the name coincides with
an entity already in the container.public boolean build(CompositeEntity model) throws IllegalActionException, NameDuplicationException
-- add entities to graph,
-- make graph bijective,
-- remove feedback loops,
-- order graph topologically,
-- insert permutation operators,
-- add layout information to display
generated graph.
model - Model to represent with graph.IllegalActionException - If thrown while adding a node, making Bijective, removing feedback, setting the structure, inserting permutations or laying out the graphNameDuplicationException - If thrown while adding a node, making Bijective, removing feedback, setting the structure, inserting permutations or laying out the graphpublic void addNode2(Entity entity) throws IllegalActionException, NameDuplicationException
entity - Entity to add to the graph.IllegalActionException - If thrown while creating a new SyntacticNode or adding an entity.NameDuplicationException - If thrown while creating a new SyntacticNode or adding an entity.public void addNode(Entity entity) throws IllegalActionException, NameDuplicationException
entity - Entity to add to the graph.IllegalActionException - If thrown while creating a new SyntacticNode or adding an entity.NameDuplicationException - If thrown while creating a new SyntacticNode or adding an entity.public void addNode(SyntacticNode node) throws IllegalActionException, NameDuplicationException
node - Node to add to the Graph.IllegalActionException - on attempts to add nodes
after certain transformations are done to the graph.NameDuplicationException - if duplicate names are used.public void makeBijective()
throws IllegalActionException,
NameDuplicationException
IllegalActionException - If thrown while creating a
SyntacticNode, setting a Mediator, removing a connection or
adding a connection.NameDuplicationException - If thrown while creating a
SyntacticNode, setting a Mediator, removing a connection or
adding a connection.public void removeFeedback()
throws IllegalActionException,
NameDuplicationException
IllegalActionException - If thrown while creating
a new node or setting the feedback.NameDuplicationException - If thrown while creating
a new node or setting the feedback.public void structure()
throws IllegalActionException,
NameDuplicationException
IllegalActionException - If thrown while setting the
identity or removing or making the connection.NameDuplicationException - If thrown while setting the
identity or removing or making the connection.public void insertPermutations()
throws IllegalActionException,
NameDuplicationException
IllegalActionException - If thrown while creating
a node, setting the permutation, or removing or making
connections.NameDuplicationException - If thrown while creating
a node.public void layoutGraph()
throws IllegalActionException,
NameDuplicationException
IllegalActionException - If thrown while
setting the location.NameDuplicationException - If thrown while
setting the location.public java.lang.String generateCode()
public boolean isFeedbackRemoved()
public boolean isBijective()
public java.lang.String description(java.lang.String prefix,
java.lang.String suffix)
prefix - Line prefix for embedding descriptionsuffix - Line suffix for embedding descriptionpublic SyntacticNode getNodeFromLabel(java.lang.String label)
label - The label given for a node.public java.lang.String getLabelFromNode(SyntacticNode node)
node - The node give for a label.public java.lang.String addLabelFromNode(SyntacticNode node)
node - The node to give a label to.public static java.lang.String stringJoin(java.util.List<java.lang.String> stringList,
java.lang.String infix)
stringList - List of strings.infix - Infix to join strings with.protected void _addRepresentativeNode(SyntacticNode node)
node - The representative node to add.protected void _addExteriorNode(SyntacticNode node)
node - The representative node to add.protected void _makeConnection(SyntacticPort out, SyntacticPort in) throws IllegalActionException
out - The output port to connect.in - The input port to connect.IllegalActionException - If thrown while connecting.protected void _removeConnection(SyntacticPort port) throws IllegalActionException
port - The port to disconnect.IllegalActionException - If thrown while unlinking.protected java.lang.Integer _getInputChannel(Port oport, int ochan, Port iport) throws IllegalActionException
oport - The output port sending on ochan.ochan - The output channel for port oport.iport - The input port whose channel is to be determined.IllegalActionException - If thrown while getting
the receivers.protected java.lang.Integer _getOutputChannel(Port oport, Port iport, int ichan) throws IllegalActionException
oport - The output port sending on ochan.iport - The input port whose channel is to be determined.ichan - The input channel for port iport.IllegalActionException - If thrown while getting the
remote receivers.protected java.util.Collection<SyntacticNode> _getRootSet()
protected void _clearVisited()
protected void _clearMarked()
protected java.util.LinkedList<SyntacticNode> _getInputs()
protected java.util.LinkedList<SyntacticNode> _getOutputs()