K-means Algorithom code in ns2
Is any one have k-means clustering algo source code in .tcl formate for ns2.34?
|
Any one have k-means code in .tcl formate please reply me.
|
Google, k-means.tcl
https://www.google.com/webhp?hl=all&...&q=k-means.tcl The first hit is http://wiki.tcl.tk/11147 >>> SimpleKMeans.tcl And kmeans.tcl : http://en.pudn.com/downloads581/doc/...380916_en.html . http://www.cs.cmu.edu/afs/cs/project...tcl/kmeans.tcl Google, ns2 kmeans.tcl https://www.google.com/webhp?hl=all&...s2+k-means.tcl . http://en.pudn.com/downloads26/sourc...l83627_en.html . http://ns2-master.blogspot.dk/2012/0...using-tcl.html . http://www.coep.org.in/page_assets/341/121003017.pdf . http://dk.wow.com/search?s_pt=aolsem...ring&ifmobile= . http://dk.wow.com/search?q=k+means+c...=mid_relsearch - |
1 Attachment(s)
Thank you sir for your reply i got the code of k-means algo in .TCL formate.
I have to apply this code on LEACH protocol in WSN. For that i have refered http://nile.wpi.edu/NS/ and based on this for applying k-means i have to configure the nodes? and i have to change in make file? and afte that i have to run make command? |
Ref. post #4.
New objects are added to the Makefile.in : Like leach. Line 76 : <TAB>-I./mit/rca -I./mit/uAMPS Line 221: <TAB>mit/rca/energy.o mit/rca/rcagent.o \ Line 222: <TAB>mit/rca/rca-ll.o mit/rca/resource.o \ ... and you can then run ./install in the top directory ns-allinone-2.34/: $ export CC=gcc<?> CXX=g++<?> && ./install ... to create a new executable 'ns' - |
lines 76 ,221,and 222 is already there in make.in file. And i have performed $ export CC=gcc4.3 CXX=g++4.3 && ./install in implemantation of leach-ns234-patching.tar.gz.I want to know 1] how can i apply this k-means.tcl on LEACH protocol? 2]how can i get output?
|
The listed "kmeans.tcl" files are configuration files.
And I guess that the right kmeans.tcl can be added like the also added mit/uAMPS/ns-pegasis.tcl ... It is a pure guess : I have not found any k-means "build examples". So you may be left with what you can find out yourself. |
I explain in detail that, I have installed centos and ns2.34. In this i have implemented LEACH using leach-ns234-patching.tar.gz. As given in my base paper i have to apply this k-means algo on LEACH protocol. This algo for cluster formation. I have not found any link or reference from which i know how to apply this k-means.tcl to LEACH protocol? If you have any reference or link about how to apply this code on LEACH protocol? Please forward me.
|
Sir , I have not found any information related to how to apply this .tcl algo on LEACL protocol. If you have any example please reply me?
|
Reply me if you have any related information or link it is important for me how can i apply this kmeans.tcl algo on Leach protocol?
|
How to implemente kmeans.tcl in leach
Hi Sir Rizwanamalek,
I have the same problem. i want to implement k means clustering leach into underlying ns2.34 but i have problems to configure it. if have resolved this, please help me.my email : haitam09@hotmail.fr Thanks in advance. |
NS2 leach protocol :error "error when calling class $cls: $args" $
1 Attachment(s)
Hello friends,
I want to simulate network of 30 noeuds by using kmeans method of clustering on leach protocol in WSN. Please help me. thanks in adavances But when i run my kmeansleach.tcl script, it gives me the error following : num_nodes is set 30 warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl (_o14 cmd line 1) invoked from within "_o14 cmd addr" invoked from within "catch "$self cmd $args" ret" invoked from within "if [catch "$self cmd $args" ret] { set cls [$self info class] global errorInfo set savedInfo $errorInfo error "error when calling class $cls: $args" $..." (procedure "_o14" line 2) (SplitObject unknown line 2) invoked from within "_o14 addr" ("eval" body line 1) invoked from within "eval $node addr $args" ("default" arm line 2) invoked from within "switch -exact $routingAgent_ { DSDV { set ragent [$self create-dsdv-agent $node] } DSR { $self at 0.0 "$node start-dsr" } AODV { set ragent [$self cre..." (procedure "_o3" line 14) (Simulator create-wireless-node line 14) invoked from within "_o3 create-wireless-node" ("eval" body line 1) invoked from within "eval $self create-wireless-node $args" (procedure "_o3" line 23) (Simulator node line 23) invoked from within "$ns node" ("for" body line 2) invoked from within "for {set i 0} {$i < $NETWORK_NODE } { incr i } { set node($i) [$ns node] }" (file "kmeansleach.tcl" line 49) =================================================================================== kmeansleach.tcl is attached |
Re #12, @haitam09.
Looks like you are using an executable 'ns' with some strange functions ? So what did you add to ns-allinone-2.3x ? Leach ? Kmeans ? Or ? ... Seems like any executable can be used ? .... My result : Code:
$ ns-pegasis kmeansleach.tcl (or $ ns-leach kmeansleach.tcl, or $ ns235-orig kmeansleach.tcl) ... And $ nam kmeans.nam shows a nice animation. - |
Thank you Sir knudfl for your reply.
1) when i run $ns-leach kmeansleach.tcl , it gives me the erreur : ns-leach*: commande introuvable 2) But when i run $ ns kmeansleach.tcl , it gives me the following erreur num_nodes is set 30 warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl (_o14 cmd line 1) invoked from within "_o14 cmd addr" invoked from within "catch "$self cmd $args" ret" invoked from within "if [catch "$self cmd $args" ret] { set cls [$self info class] global errorInfo set savedInfo $errorInfo error "error when calling class $cls: $args" $..." (procedure "_o14" line 2) (SplitObject unknown line 2) invoked from within "_o14 addr" ("eval" body line 1) invoked from within "eval $node addr $args" ("default" arm line 2) invoked from within "switch -exact $routingAgent_ { DSDV { set ragent [$self create-dsdv-agent $node] } DSR { $self at 0.0 "$node start-dsr" } AODV { set ragent [$self cre..." (procedure "_o3" line 14) (Simulator create-wireless-node line 14) invoked from within "_o3 create-wireless-node" ("eval" body line 1) invoked from within "eval $self create-wireless-node $args" (procedure "_o3" line 23) (Simulator node line 23) invoked from within "$ns node" ("for" body line 2) invoked from within "for {set i 0} {$i < $NETWORK_NODE } { incr i } { set node($i) [$ns node] }" (file "kmeansleach.tcl" line 49) ---------------------------------------------------------------------------------- I inform you that I have already installed leach protocol in NS2.34 under UBUNTU and it works well. But when I want to apply "kmeans clustering" by using the file kmeansleach.tcl in leach protocol. It does not work. Thank you your help. Best regards |
Re #14.
First : Please do not show the generic (useless) errors, that the otcl library is spitting out. Tells absolutely nothing about what's going on. (Except that the executable 'ns' in your command can't be used for anything.) This command is with a clean ns-2.35 : No patches, no leach, no changes : Code:
[knudfl@localhost haitam09]$ ns235-orig kmeansleach.tcl The "Segmentation fault" happens when the trace files already are created. Result $ nam kmeans.nam https://drive.google.com/file/d/0B7S...ew?usp=sharing The reason that I'm using "ns renamed" : You can only have one 'ns' ... and I have 200 : They must all be renamed to "ns-<protocol>" / ns-unique-name. I guess your leach functions aren't working either : 'leach.alive.txt' must be about 43 lines. Build example ns-2.35 + Leach ... !! Absolutely necessary is a 64bits OS !! #11 here http://www.linuxquestions.org/questi...4175556129/#11 - |
All times are GMT -5. The time now is 07:31 PM. |