Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
The ONE simulator has been developed using Java 6. In the remainder of this chapter, all examples provided were executed using NetBeans running with OpenJDK 6. Minor changes might be required if Java 7 is used instead. The reader is suggested to consult appropriate documents/forums regarding this.
- 4.
https://search.maven.org/#searchgav|1|g:%22junit%22%20AND%20a:%22junit%22.
- 5.
By default, assertions are disabled in Java.
- 6.
Such descriptions are made available by many users in the simulator’s community.
- 7.
- 8.
For an interesting discussion, refer to http://programmers.stackexchange.com/questions/110518/binaries-in-source-control.
- 9.
Windows users can use a command prompt for this purpose. Another alternative is to install Cygwin. Of course, whether you are using Linux or Windows, a Git client must be installed in your system.
- 10.
An alternative to this approach is to use the @org.junit.Test annotation for each test method.
- 11.
- 12.
An abstract class is one which cannot be instantiated, i.e., no objects of the type of the abstract class can be created.
- 13.
Technically, it is an ArrayList with FIFO operations.
- 14.
This is required for version 1.5.1 RC2. The behavior with other versions was not tested.
- 15.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Misra, S., Saha, B.K., Pal, S. (2016). A Developer’s Guide to the ONE Simulator. In: Opportunistic Mobile Networks. Computer Communications and Networks. Springer, Cham. https://doi.org/10.1007/978-3-319-29031-7_3
Download citation
DOI: https://doi.org/10.1007/978-3-319-29031-7_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-29029-4
Online ISBN: 978-3-319-29031-7
eBook Packages: Computer ScienceComputer Science (R0)