Skip to content

Types of Graphs

Gary edited this page Aug 27, 2014 · 1 revision

Table of Contents

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:

General Purpose Graphs

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.
For more information on the general purpose IGraph interface, see IGraph and Related Interfaces.

Circuit Graphs

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: Adapts DomNode to an element, a circuit node with pins.
  • Wire: Adapts DomNode to a connection in a circuit.
  • ICircuitPin: Interface for pins, which are the sources and destinations (contact points) for wires between circuit elements.
Each of the interface parameters here derive from the parameters in the general IGraph interface. This is permitted, because the type parameters in IGraph are covariant.

Statechart Graphs

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.

Topics in this section

Clone this wiki locally