code: protected int getFirstFreeInputGateIndex() {
  
  		for (int i = 0; i < this.backwardEdges.size(); i++) {
  
  			if (this.backwardEdges.get(i) == null) {
  				return i;
  			}
  		}
  
  		return this.backwardEdges.size();
  	}
docs: Returns the index of this vertex's first free input gate.
  
  @return the index of the first free input gate