ProtelisDevice

class ProtelisDevice<P : Position<P>> @JvmOverloads constructor(val environment: Environment<Any, P>, val node: Node<Any>, networkManagers: Map<RunProtelisProgram<*>, AlchemistNetworkManager> = mapOf()) : NodeProperty<Any> , ExecutionEnvironment, DeviceUID

Base implementation of ProtelisDevice. Requires an environment to work.

Constructors

Link copied to clipboard
constructor(environment: Environment<Any, P>, node: Node<Any>, networkManagers: Map<RunProtelisProgram<*>, AlchemistNetworkManager> = mapOf())

Properties

Link copied to clipboard
Link copied to clipboard
val id: Int

The node's id.

Link copied to clipboard
open override val node: Node<Any>

Functions

Link copied to clipboard
Link copied to clipboard

Finds all the RunProtelisPrograms installed on this node.

Link copied to clipboard
open override fun cloneOnNewNode(node: Node<Any>): ProtelisDevice<P>
Link copied to clipboard
open override fun commit()

Called just after the VM is executed, to finalize information of the execution for the environment.

Link copied to clipboard
open operator override fun get(id: String): Any
open operator override fun get(id: String, defaultValue: Any): Any

Returns the value associated with id.

Link copied to clipboard
open override fun has(id: String): Boolean

Returns true if node contains id.

Link copied to clipboard
open override fun keySet(): Set<String>

Return all stored variables names.

Link copied to clipboard
open override fun put(key: String, value: Any): Boolean

Stores a value associated with key.

Link copied to clipboard
fun putField(key: String, value: Field<*>): Boolean

Stores a value associated with key.

Link copied to clipboard
open override fun remove(id: String): Any

Removes the value associated with id.

Link copied to clipboard
open override fun setup()

Called just before the VM is executed, to enable and preparations needed in the environment.

Link copied to clipboard
open override fun toString(): String