org.protelis.test.infrastructure.DummyDevice 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
/*
* Copyright (C) 2021, Danilo Pianini and contributors listed in the project's build.gradle.kts or pom.xml file.
*
* This file is part of Protelis, and is distributed under the terms of the GNU General Public License,
* with a linking exception, as described in the file LICENSE.txt in this project's top directory.
*/
package org.protelis.test.infrastructure;
import static org.junit.Assert.assertNotNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
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
* {@link org.protelis.vm.ProtelisVM} and a network interface.
*/
@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "This is done by purpose")
public final class DummyDevice extends AbstractExecutionContext
implements SpatiallyEmbeddedDevice, LocalizedDevice, TimeAwareDevice {
private final RandomGenerator r;
private final ProtelisNode node;
private final Environment
© 2015 - 2024 Weber Informatics LLC | Privacy Policy