The L200 design allows some leakage from cells connected while the circuit is not powered. D1 prevents this loss and protects the circuit from reverse polarity.
The L200 needs an input voltage that is at least 2v higher than the output to be able to yield the full rated output. You also need sufficient volts to cover the forward voltage drop of D1. With a 0.6V D1 drop, the input to the L200 needs to be 2.6V higher than the desired output.
You can use 18V 3A transformer and 3A full wave rectifier or bridge rectifier for power supply.