Skip to main content

Simulation Reproducibility with Python and Pweave

  • Chapter
  • First Online:
  • 2185 Accesses

Part of the book series: EAI/Springer Innovations in Communication and Computing ((EAISICC))

Abstract

As the amount and complexity of model source code, configuration files, and resulting data for simulative experiments are ever increasing, it becomes a real challenge to reliably and efficiently reproduce simulation data and their analysis results published in a scientific paper not only by its readers but also by the authors themselves, which makes the claims and contributions made in the paper questionable. The idea of reproducible research comes as a solution to this problem and suggests that any scientific claims should be published together with relevant experimental data and software code for their analysis so that readers may verify the findings and build upon them; in case of computer simulation, the details of simulation implementation and its configurations should be provided as well. In this chapter, we illustrate the practice of reproducible research for OMNeT++ simulation based on Pweave and Python. We show how to embed simulation configuration files and Python analysis code, import simulation data with automatic updating of simulation results, and analyze data and present the results in a file.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   139.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   179.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    pweave denotes an executable program, while Pweave denotes a Python package.

  2. 2.

    Or the development of the simulation models has already been finished and the resulting code will not change.

  3. 3.

    Chapter GitHub repository: https://github.com/kyeongsoo/reproducible_research.

  4. 4.

    The example provided in this section has been prepared and tested with OMNeT++ version 5.4 and Pweave version 0.30.2 running on Python version 3.6.6 (64-bit Anaconda distribution version 5.2 available online at https://www.anaconda.com/download/).

  5. 5.

    Listing 8.8 is shown here for explanation using the lstlisting environment.

References

  1. Abbott, B.P., et al.: Observation of gravitational waves from a binary black hole merger. Phys. Rev. Lett. 116, 061102 (2016). https://link.aps.org/doi/10.1103/PhysRevLett.116.061102

    Article  MathSciNet  Google Scholar 

  2. Chang, K.: Panel says Bell Labs scientist faked discoveries in physics. The New York Times (2002)

    Google Scholar 

  3. Finkelstein, N.: Getting started with Python for R developers. http://n-s-f.github.io/2017/03/25/r-to-python.html. Accessed 03 May 2018

  4. Jupyter: http://jupyter.org/. Accessed 03 May 2018

  5. knitr: https://yihui.name/knitr/. Accessed 03 May 2018

  6. Leisch, F., R-core: Sweave user manual (2018). https://stat.ethz.ch/R-manual/R-devel/library/utils/doc/Sweave.pdf

  7. Marcelino, D.: Blog post: What is reproducible research? (2016). http://danielmarcelino.github.io/blog/2016/reproducible-research.html. Accessed 13 Mar 2018

  8. OMNeT++ tutorials: result analysis with Python. https://docs.omnetpp.org/tutorials/pandas/. Accessed 03 May 2018

  9. pandas: Python data analysis library. https://pandas.pydata.org/. Accessed 09 July 2018

  10. Pérez, F., Granger, B.: IPython: a system for interactive scientific computing. Comput. Sci. Eng. 9(3), 21–29 (2007)

    Article  Google Scholar 

  11. Pweave: http://mpastell.com/pweave/. Accessed 03 May 2018

  12. R Core Team: R: a language and environment for statistical computing. R Foundation for Statistical Computing, Vienna (2013). http://www.R-project.org/. ISBN 3-900051-07-0

  13. Report of the investigation committee on the possibility of scientific misconduct in the work of Hendrik Schön and coauthors. Bell Labs. (2002). https://media-bell-labs-com.s3.amazonaws.com/pages/20170403_1709/misconduct-revew-report-lucent.pdf

  14. Scientific method: Oxford Dictionaries: British and World English (2016). https://en.oxforddictionaries.com/definition/scientific_method. Accessed 13 Mar 2018

  15. Signal processing with GW150914 open data. LIGO open science center (2017). https://losc.ligo.org/s/events/GW150914/GW150914_tutorial.html. Accessed 27 Mar 2018

  16. The Yale Law School Roundtable on Data and Code Sharing: Reproducible research: addressing the need for data and code sharing in computational science. Comput. Sci. Eng. 12(5), 8–13 (2010). https://doi.org/10.1109/MCSE.2010.113

  17. VirtualBox: https://www.virtualbox.org/. Accessed 03 May 2018

Download references

Acknowledgements

The author is grateful for the constructive comments and feedback from the editors Antonio Virdis and Michael Kirsche, the anonymous reviewers, and the financial support for this work from Xi’an Jiaotong-Liverpool University Research Development Fund (RDF) under Grant RDF-14-01-25.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kyeong Soo (Joseph) Kim .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Kim, K.S.(. (2019). Simulation Reproducibility with Python and Pweave. In: Virdis, A., Kirsche, M. (eds) Recent Advances in Network Simulation. EAI/Springer Innovations in Communication and Computing. Springer, Cham. https://doi.org/10.1007/978-3-030-12842-5_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-12842-5_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-12841-8

  • Online ISBN: 978-3-030-12842-5

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics