private final Path generatePath(long seed) {
Random rnd = new RandomAdapter(new java.util.Random(seed));
Color sample = colorModel.sample(rnd);
WavelengthPacket lambda = sample.getWavelengthPacket();
PathNode lightTail = generateLightPath(rnd, lambda);
PathNode eyeTail = generateEyePath(rnd, lambda);
if (lightTail != null && lightTail.getDepth() > 0 && lightTail.isAtInfinity()) {
lightTail = lightTail.getParent();
}
if (eyeTail != null && eyeTail.getDepth() > 0 && eyeTail.isAtInfinity()) {
eyeTail = eyeTail.getParent();
}
return new Path(lightTail, eyeTail);
}