There are existing examples of WSN based on OMNET++, but if you want to include neural network for optimization, you should develop C++ codes that OMNET++ suports.
You can see code and documentation for WSN Clustering using Self Organizing Map Neural Network -- https://tetcos.com/File_Exchange/v10.2/SOM_CLUSTERING_v10.2.zip