public class SyntacticGraph extends CompositeEntity
red |
red (shaver) |
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, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDerivedLevel, getDerivedList, propagateValue
description, getDisplayName, getFullName, getName, getName
public 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
public void structure() throws IllegalActionException, NameDuplicationException
public void insertPermutations() throws IllegalActionException, NameDuplicationException
public void layoutGraph() throws IllegalActionException, NameDuplicationException
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
protected void _removeConnection(SyntacticPort port) throws IllegalActionException
port
- The port to disconnect.IllegalActionException
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
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
protected java.util.Collection<SyntacticNode> _getRootSet()
protected void _clearVisited()
protected void _clearMarked()
protected java.util.LinkedList<SyntacticNode> _getInputs()
protected java.util.LinkedList<SyntacticNode> _getOutputs()