protected bool _componentHasWrongSize(NetworkComponent componentToAdd) { if (NumberOfComponents == 0) { return(false); } return(_tail.Component.NumberOfOutputs != componentToAdd.NumberOfInputs); }
public override void Add(NetworkComponent componentToAdd) { Layer layerToAdd = componentToAdd as Layer; if (layerToAdd == null) { throw new ArgumentException("Attempt to add non-layer to a LayerChain."); } this.Add(layerToAdd); }
public virtual void Add(NetworkComponent componentToAdd) { if (_componentHasWrongSize(componentToAdd)) { throw new ArgumentException("Attempt to add with inputs size differnt from output size of the last existing Layer"); } _networkComponentNode nodeToAdd = new _networkComponentNode(componentToAdd); if (_head == null) { _head = nodeToAdd; _tail = _head; } else { _tail.Next = nodeToAdd; _tail.Next.Previous = _tail; _tail = _tail.Next; } }
public NetworkComponentChain(NetworkComponent component) : this() { Add(component); }
public _networkComponentNode(NetworkComponent component) { Component = component; }