ProtelisDevice

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

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>

The node to which the capability is added.

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>

Clones this property to be added on a new node.

Link copied to clipboard
open fun commit()

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

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

Returns the value associated with id.

Link copied to clipboard
fun getNetworkManager(program: RunProtelisProgram<*>): <Error class: unknown class>
Link copied to clipboard
open fun has(id: String): Boolean

Returns true if node contains id.

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

Return all stored variables names.

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

Stores a value associated with key.

Link copied to clipboard
fun putField(key: String, value: <Error class: unknown class><out <Error class: unknown class>>): Boolean

Stores a value associated with key.

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

Removes the value associated with id.

Link copied to clipboard
open 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