A Developer’s Guide to the ONE Simulator
In this chapter, we look at how to work with the Opportunistic Network Environment (ONE) simulator using the NetBeans integrated development environment (IDE). Use of such an IDE often makes workflow easier. Next, we discuss in detail a key topic—creating a new routing protocol using the ONE simulator. We illustrate this process with a simple example by considering a variation of the SnW protocol. A walkthrough of the code, together with insights, is provided. In real life, developing software is usually a complex process. In such scenarios, tracking back the code and debugging becomes easier using the graphical user interface (GUI) based IDEs. In this regard, we take a look at version control of source code using Git. Git operations can be performed from a terminal or from within NetBeans—we illustrate both approaches here. Later in this chapter, we cover the issue of testing a protocol developed with the ONE simulator. We discuss how to write a test case from scratch by using JUnit and the framework provided by the ONE simulator. Finally, we conclude this chapter with a set of best practices based on our experiences with the ONE simulator.