Package org.protelis.test.infrastructure
Class DummyDevice
java.lang.Object
org.protelis.vm.impl.AbstractExecutionContext<DummyDevice>
org.protelis.test.infrastructure.DummyDevice
- All Implemented Interfaces:
org.protelis.vm.ExecutionContext,org.protelis.vm.LocalizedDevice,org.protelis.vm.SpatiallyEmbeddedDevice<Double>,org.protelis.vm.TimeAwareDevice<Double>
public final class DummyDevice
extends org.protelis.vm.impl.AbstractExecutionContext<DummyDevice>
implements org.protelis.vm.SpatiallyEmbeddedDevice<Double>, org.protelis.vm.LocalizedDevice, org.protelis.vm.TimeAwareDevice<Double>
A simple implementation of a Protelis-based device, encapsulating a
ProtelisVM and a network interface.-
Constructor Summary
ConstructorsConstructorDescriptionDummyDevice(it.unibo.alchemist.model.interfaces.Environment<Object> environment, ProtelisNode node, it.unibo.alchemist.model.interfaces.Reaction<Object> reaction, org.apache.commons.math3.random.RandomGenerator random, org.protelis.vm.NetworkManager networkManager) -
Method Summary
Modifier and TypeMethodDescriptionorg.protelis.lang.datatype.Tupleorg.protelis.lang.datatype.DeviceUIDprotected DummyDeviceinstance()org.protelis.lang.datatype.Field<Double>nbrDelay()org.protelis.lang.datatype.Field<Double>nbrLag()org.protelis.lang.datatype.Field<Double>nbrRange()org.protelis.lang.datatype.Field<org.protelis.lang.datatype.Tuple>doubleNote: this should be going away in the future, to be replaced by standard Java random.toString()Methods inherited from class org.protelis.vm.impl.AbstractExecutionContext
buildField, buildFieldDeferred, commit, commitRecursively, getExecutionEnvironment, getFunctions, getNetworkManager, getPersistent, getStoredState, getVariable, newCallStackFrame, newCallStackFrame, putMultipleVariables, putVariable, restrictDomain, returnFromCallFrame, runInNewStackFrame, setGloballyAvailableReferences, setPersistent, setupMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.protelis.vm.ExecutionContext
buildField, buildFieldDeferred, commit, getExecutionEnvironment, getPersistent, getVariable, newCallStackFrame, newCallStackFrame, putMultipleVariables, putVariable, restrictDomain, returnFromCallFrame, runInNewStackFrame, setGloballyAvailableReferences, setPersistent, setup
-
Constructor Details
-
DummyDevice
public DummyDevice(it.unibo.alchemist.model.interfaces.Environment<Object> environment, ProtelisNode node, it.unibo.alchemist.model.interfaces.Reaction<Object> reaction, org.apache.commons.math3.random.RandomGenerator random, org.protelis.vm.NetworkManager networkManager) - Parameters:
environment- environmentnode- nodereaction- reactionrandom- randomnetworkManager- networkManager
-
-
Method Details
-
getDeviceUID
public org.protelis.lang.datatype.DeviceUID getDeviceUID()- Specified by:
getDeviceUIDin interfaceorg.protelis.vm.ExecutionContext
-
getCurrentTime
- Specified by:
getCurrentTimein interfaceorg.protelis.vm.ExecutionContext
-
getDeltaTime
- Specified by:
getDeltaTimein interfaceorg.protelis.vm.ExecutionContext- Overrides:
getDeltaTimein classorg.protelis.vm.impl.AbstractExecutionContext<DummyDevice>
-
instance
- Specified by:
instancein classorg.protelis.vm.impl.AbstractExecutionContext<DummyDevice>
-
nextRandomDouble
public double nextRandomDouble()Note: this should be going away in the future, to be replaced by standard Java random.- Specified by:
nextRandomDoublein interfaceorg.protelis.vm.ExecutionContext- Returns:
- a double random value
-
nbrRange
- Specified by:
nbrRangein interfaceorg.protelis.vm.SpatiallyEmbeddedDevice<Double>
-
nbrDelay
- Specified by:
nbrDelayin interfaceorg.protelis.vm.TimeAwareDevice<Double>
-
nbrLag
- Specified by:
nbrLagin interfaceorg.protelis.vm.TimeAwareDevice<Double>
-
getCoordinates
public org.protelis.lang.datatype.Tuple getCoordinates()- Specified by:
getCoordinatesin interfaceorg.protelis.vm.LocalizedDevice
-
nbrVector
public org.protelis.lang.datatype.Field<org.protelis.lang.datatype.Tuple> nbrVector()- Specified by:
nbrVectorin interfaceorg.protelis.vm.LocalizedDevice
-
toString
-