Module: Neuro::Display::Draw

Included in:
Edges, Input, NetworkDrawer, Node, Output
Defined in:
lib/neuro/display.rb

Constant Summary collapse

WIDTH =
32
HEIGHT =
32
XGAP =
128
YGAP =
64
LAYERS =
{
  :input_layer  => XGAP + XGAP / 2,
  :hidden_layer => XGAP * 2 + XGAP / 2 + WIDTH,
  :output_layer => XGAP * 3 + XGAP / 2 + WIDTH * 2,
}

Instance Method Summary collapse

Instance Method Details

#position(layer = @layer, i = @i) ⇒ Object



23
24
25
26
27
# File 'lib/neuro/display.rb', line 23

def position(layer = @layer, i = @i)
  x = LAYERS[layer]
  y = (i + 1) * YGAP + i * HEIGHT + @offsets[layer] * (HEIGHT + YGAP)
  return x, y
end