Module: graph_components

Methods

(static) edge_equal(e1, e2) → {boolean}

check if the two edges are equal up to graphical representation
Parameters:
Name Type Description
e1 Object edge 1
e2 Object edge 2
Source:
Returns:
true iff equal
Type
boolean

(static) get_empty_symbol() → {string}

Check which user interface we are on and return the appropriate empty symbol
Source:
Returns:
☐ if dealing with Turing machine and ε otherwise
Type
string

(static) make_edge(from, to, transition, a1, a2, angle1, angle2, pop_symbol, push_symbol, move, mealy_output) → {Object}

making a new edge
Parameters:
Name Type Description
from string from vertex
to string to vertex
transition string | undefined transition symbol
a1 float first coordinate for the edge basis
a2 float second cooridnate for the edge basis
angle1 float start angle for self loop
angle2 float end angle for self loop
pop_symbol string the read symbol
push_symbol string the write symbol
move string whether move left of right
mealy_output string output for a Mealy machine
Source:
Returns:
the edge as a json object
Type
Object

(static) make_vertex(name, x, y, r, is_start, is_final, out, moore_output) → {Object}

making a new vertex
Parameters:
Name Type Description
name string name of the vertex
x float x cooridnate w.r.t. canvas
y float y cooridnate w.r.t. canvas
r float radius in pixels
is_start boolean is the vertex a start state?
is_final boolean is the vertex an accept state?
out Array.<Object> neighbors, more specifically array of edges to neighbors
moore_output string the output associated with the vertex (for Moore machines)
Source:
Returns:
the vertex as a json object
Type
Object