`network.lattice(sizex, sizey, a, node=dynNode, edge=weightedEdge)`- Adds a 2-dimensional (open) lattice to the network.

`sizex`: integer- Size of the lattice in x-direction.
`sizey`: integer- Size of the lattice in y-direction.
`a`: float- Every node is connected to all neighbors whose euclidian distance is smaller than
`a`. `node`: node template- Every added node is a copy of this template.
`edge`edge template- Every added edge is a copy of this template.

the number of the first added node. The following nodes have consecutive numbers.

```
import conedy as co
N = co.network()
N.lattice (40,40,1.5, co.node(), co.weightedEdge()) #creates a lattice of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors
print "should be slightly smaller than 8:" + str(N.meanDegree())
print "should be close to "+ str(12.0/28) +":" + str(N.meanClustering())
```

```
network N;
N.lattice (40,40,1.5, node(), weightedEdge()); #creates a lattice of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors
print "should be slightly smaller than 8:" + N.meanDegree() + newline;
print "should be close to "+ (12.0/28) +":" + (N.meanClustering()) + newline;
```