org.protelis.test.infrastructure.SimpleDevice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protelis-test Show documentation
Show all versions of protelis-test Show documentation
Essential libraries for testing Protelis programs and simulations
package org.protelis.test.infrastructure;
import static org.junit.Assert.assertNotNull;
import org.apache.commons.lang.NotImplementedException;
import org.apache.commons.math3.random.RandomGenerator;
import org.protelis.lang.datatype.DeviceUID;
import org.protelis.lang.datatype.Field;
import org.protelis.lang.datatype.Tuple;
import org.protelis.lang.datatype.impl.ArrayTupleImpl;
import org.protelis.vm.LocalizedDevice;
import org.protelis.vm.NetworkManager;
import org.protelis.vm.SpatiallyEmbeddedDevice;
import org.protelis.vm.TimeAwareDevice;
import org.protelis.vm.impl.AbstractExecutionContext;
import it.unibo.alchemist.model.interfaces.Environment;
import it.unibo.alchemist.model.interfaces.Reaction;
/**
* A simple implementation of a Protelis-based device, encapsulating a
* ProtelisVM and a network interface.
*/
public class SimpleDevice extends AbstractExecutionContext
implements SpatiallyEmbeddedDevice, LocalizedDevice, TimeAwareDevice {
private final RandomGenerator r;
private final ProtelisNode node;
private final Environment