To use PeerSim in eclipse you should do the follow
1. Download the peerSim. Here you can find the source code.
2. Create a Java project in Eclipse.
File -> New -> Java project
3. Code the project or copy some example of the package of step 1
4. Create a config file.
4.1 Go to Run -> Run configuration ...
4.2 Choose a name for the configuration
4.3 In the main tab, select the project and the class file that contains your Main function (I have used peersim.Simulator)
4.4 Go to the arguments tab. Fill the "program arguments" part with the name of your configuration file. One way is using the complete path with double quote. For example, "/user/Document/config.txt"