Files
processing4/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Connection.pde
T
2012-12-11 20:04:34 +00:00

25 lines
360 B
Plaintext

// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
class Connection {
float weight;
Neuron a;
Neuron b;
Connection(Neuron from, Neuron to,float w) {
weight = w;
a = from;
b = to;
}
void display() {
stroke(0);
strokeWeight(weight*4);
line(a.location.x, a.location.y, b.location.x, b.location.y);
}
}