Example Experiments

Several examples can be found in ~/run/examples. This is a symbolic link to the example directory. To run these examples, please copy all files to your own experiment directory. The list below gives a high level introduction to each of the examples.

Interactive and Scripted Examples

Clear Channels

Manually sets all channels to 70 dB of loss. All nodes should be able to communicate with each other in this case.

Off Channels

Manually sets all channels to infinite attenuation. No wireless communication is possible.

Manual Channels

Shows how to manually control channels in the configuration file. No GUI is used in this example.

Simple Route

Defines a simple route for node movement.

Replay

Demonstrates replay of a recorded node movement and RSSI trace.

Remote Execution - Scripted

A simple script that spawns remote a process on a remote node.

Programmatic Examples

Hello World

Hello World for the emulator's programmatic interface. This code executes entirely on the control node.

Remote Execution - Programmatic

A simple program that spawns remote a process on a remote node.

Manual Channels - Programmatic

Shows how to programatically control channels in conjunction with running remote applications. This is useful for setting the channel conditions for a variety of configurations, and running a test for each.

Waypoint Listener

Demonstrates listening to waypoint events generated when a node navigates a route.

Position Listener

Demonstrates listening to position events generated when a node moves.

Directional Antenna

Demonstrates how to use a directional antenna

We can emulate directional antennas on the Emulator. You can specify the default type of antenna to use in the xml file (currently we only support Yagi antennas with a beamwidth of about 60 degrees):

1. In the xml file, specify the type of antenna you want to use for each node. For Yagi antennas, using "Yagi", and "isotropic" for omnidirectional antannas:

 
		<node name="nodew1" color="darkRed">
			<nic>
				<antenna>
					<type>Yagi</type>
					<txAmpGain>0</txAmpGain>
				</antenna>
			</nic>
		</node>
				<node name="nodew2" color="darkGreen">
		<nic>
				<antenna>
					<type>isotropic</type>
					<txAmpGain>0</txAmpGain>
				</antenna>
			</nic>
		</node>

2. You are allowed to switch between isotropic antenna and yagi antenna in the run time. This can be achieved by using the changeAntenna() method for individual emuNode:

 
	emuNode.changeAntenna("Yagi");
	emuNode.changeAntenna("Isotropic");

Here is one example experiment that uses a Yagi Antenna xml file and corresponding java code. More details on how to manipulate the orientation of the antenna/node can be found on the Orientation page with more examples.

Tutorial Examples

Tutorial

Includes scripts and user codes for all experiments introduced in the Tutorial.