예제 #1
0
        public void attract(AnimatedElement n, float factor)
        {
            PointF delta = diff(position, n.Position);

            shift.X += (float)(factor * delta.X / k);
            shift.Y += (float)(factor * delta.Y / k);

            if (n is AnimatedReceptor)
            {
                shift.X += (float)(8 * factor * delta.X * Math.Abs(delta.X * delta.X) / (k * k * k));
                shift.Y += (float)(8 * factor * delta.Y * Math.Abs(delta.Y * delta.Y) / (k * k * k));
            }
        }
예제 #2
0
        public AnimatedSynapse(AnimatedNeuron pre, AnimatedNeuron post, Synapse syn)
        {
            this.pre  = pre;
            this.post = post;

            duplex  = null;
            vector  = new AnimatedVector(pre, post);
            synapse = new AnimatedState(syn, vector);

            pre.Output.Add(this);
            post.Input.Add(this);

            changePosition();
        }
예제 #3
0
 public AnimatedVector(AnimatedElement start, AnimatedElement end)
 {
     this.start = start;
     this.end   = end;
 }