Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Libraries/ExperimentLibrary

Version 4 (modified by jsamuel, 10 years ago)

--

Seattle Experiment Library

The Experiment Library provides a means of scripting interaction with individual nodes and vessels as well as with SeattleGENI. Whereas Seash is for interactive use, the Experiment Library allows for writing Python scripts to acquire vessels, run experiments, download logs, etc.

Getting the Experiment Library

You can obtain the experiment library by running the following commands:

mkdir experimentlibrary
cd experimentlibrary
svn export https://seattle.cs.washington.edu/svn/seattle/trunk/experimentmanager
svn export https://seattle.cs.washington.edu/svn/seattle/trunk/seattlegeni/xmlrpc_clients/seattlegeni_xmlrpc.py
svn export https://seattle.cs.washington.edu/svn/seattle/trunk/seattlelib
svn export https://seattle.cs.washington.edu/svn/seattle/trunk/portability
svn export https://seattle.cs.washington.edu/svn/seattle/trunk/repy
rm -rf seattlelib/test seattlelib/tests portability/tests repy/apps repy/tests repy/winAPItests
mv experimentmanager/* seattlelib/* portability/* repy/* ./
rmdir experimentmanager seattlelib portability repy
touch servicelogger.py
cd ..

Running the above commands will give you a directory named experimentlibrary/ that contains the file experimentlib.py as well as all necessary supporting files. The file experimentlib.py is the Experiment Library that you will use.

Usage

At the top of your own Python script add:

import sys
sys.path.append("/path/to/experimentlibrary")
import experimentlib

You can then use the Experiment Library in your script by calling the methods of the experimentlib module you imported.

All of the public constants, variables, and functions in experimentlib.py are meant to be used by your script. The private identifiers (the ones beginning with an underscore) should not need to be used by your script.

The comments at the top of experimentlib.py contain useful information about the data types and exceptions used by the Experiment Library. All of the public functions have comments to explain their usage. The examples/ directory that is in your experimentlibrary directory (if you performed the steps above) contains a handful of scripts that show different ways to use the Experiment Library.

If you run into problems, find bugs, or feel that some useful functionality is missing, send an email to seattle-devel -at- cs -dot- washington -dot- edu.

Documentation

The best documentation is just to look at the comments in experimentlib.py.

Second to that is to look at the examples.

Attachments