@Override
    public void generateLinks() {
        List<Node> nodeList = networkStructurer.getNodeList();
        final Iterator<Node> it1 = nodeList.iterator();
        
        while (it1.hasNext()) {
            Node node1 = it1.next();
            Iterator<Node> it2 = nodeList.iterator();
            
            while (it2.hasNext()) {
                Node node2 = it2.next();
                
                // Even though this method examines each pair of nodes twice
                // (i.e. 'node A and node B' as well as 'node B and node A'),
                // the distance between the two nodes remains constant between
                // examinations and thus the link will be created upon the first
                // examination if it's less than the link probability. Thus, no
                // halving of the link probability is needed (see Erdos-Renyi).
                //
                // Also check that we aren't connecting a node to itself and
                // that node1 isn't already connected to node2 (as node1 to
                // node2 and node2 to node1 are the same link and should not
                // be connected twice).
                if (networkStructurer.calculateDistanceBetweenNodes(node1,
                        node2) < linkProbability &&
                        node1 != node2 && !node1.isConnectedTo(node2)) {
                    new Link(node1.getNodeID(), node2.getNodeID(),
                            networkStructurer);
                }
            }
        }
    }