Types of Graphs - kaisu1986/ATF GitHub Wiki
ATF supports general purpose and specialized graphs, such as circuits and statecharts. This section briefly describes support for the different kinds of graphs. ATF graph support is described in further detail in other sections:
The simplest graph has nodes and connecting edges, as in the ATF Fsm Editor Sample, representing a simple state machine. In this graph, states are the nodes and transitions are the connecting edges:
In ATF, the general interface for a graph is
IGraph<IGraphNode, IGraphEdge<IGraphNode, IEdgeRoute>, IEdgeRoute>
These parameters are:
-
IGraphNode
: Interface for a node in a graph. -
IGraphEdge<IGraphNode, IEdgeRoute>
: Interface for edges in a graph. -
IEdgeRoute
: Interface for edge routes, which act as sources and destinations for graph edges.
IGraph
interface, see IGraph and Related Interfaces.
ATF provides extensive support for circuit graphs. In a circuit, nodes are circuit elements, such as OR gates, that define input and output "pins", and edges are connecting wires connecting input pins to output pins. The ATF Circuit Editor Sample exercises the ATF circuit graph classes, and is illustrated in this figure:
The Circuit
class specializes the IGraph
interface:
public abstract class Circuit : DomNodeAdapter, IGraph<Element, Wire, ICircuitPin>, IAnnotatedDiagram, ICircuitContainer
The parameters in IGraph<Element, Wire, ICircuitPin>
are:
-
Element
: AdaptsDomNode
to an element, a circuit node with pins. -
Wire
: AdaptsDomNode
to a connection in a circuit. -
ICircuitPin
: Interface for pins, which are the sources and destinations (contact points) for wires between circuit elements.
IGraph
interface. This is permitted, because the type parameters in IGraph
are covariant.
Statecharts, also known as state transition diagrams, show states and transitions, and allow embedding a child machine inside a state. The ATF State Chart Editor Sample employs statecharts, as in this figure:
Statecharts in ATF specialize the IGraph
interface to this:
IGraph<IState, IGraphEdge<IState, BoundaryRoute>, BoundaryRoute>
The statechart unique items are:
IState
: Interface for states in state-transition diagrams.
BoundaryRoute
: Transition between states.