I have no idea.
Leach : I've only run the one and only simulation with the MIT Leach.
And the 3? examples in the Mannasim Leach.
( You never responded to my posts asking you to specify Leach version.)
.... How the file works and why is beyond my knowledge.
Note : code.tcl is a generic name. Always use a new unique name foe a new file.
code.tcl, line 58 : $ns_ node-config -adhocRouting DSR \
I.e. the file is not "LEACH", but dsr. Seems to run equally well with ....
$ ns235-64-orig code.tcl // stock ns2. No changes, no patches
$ ns235-mannasim-64 code.tcl // Mannasim executable
$ ns235-leach-64 code.tcl // MIT Leach executable
$ ns234-leach code.tcl // Ubuntu 10.04 MIT Leach executable
// etc. etc.
My best advice is to compare with other non Leach "cluster examples"