alchemist-interfaces / it.unibo.alchemist.model.interfaces / Reaction

Reaction

interface Reaction<T : Any!> : Comparable<Reaction<T>!>, Serializable

Functions

canExecute

abstract fun canExecute(): Boolean

cloneOnNewNode

This method allows to clone this reaction on a new node. It may result useful to support runtime creation of nodes with the same reaction programming, e.g. for morphogenesis.

abstract fun cloneOnNewNode(n: Node<T>!, currentTime: Time!): Reaction<T>!

execute

Executes the reactions.

abstract fun execute(): Unit

getActions

abstract fun getActions(): MutableList<Action<T>!>!

getConditions

abstract fun getConditions(): MutableList<Condition<T>!>!

getInboundDependencies

abstract fun getInboundDependencies(): ListSet<out Dependency!>!

getInputContext

abstract fun getInputContext(): Context!

getNode

abstract fun getNode(): Node<T>!

getOutboundDependencies

abstract fun getOutboundDependencies(): ListSet<out Dependency!>!

getOutputContext

abstract fun getOutputContext(): Context!

getRate

Returns the speed of this Reaction. It is an average number, and can potentially change during the simulation, depending on the implementation.

abstract fun getRate(): Double

getTau

abstract fun getTau(): Time!

getTimeDistribution

abstract fun getTimeDistribution(): TimeDistribution<T>!

initializationComplete

This method is called when the environment has completed its initialization. Can be used by this reaction to compute its next execution time - in case such computation requires an inspection of the environment.

abstract fun initializationComplete(t: Time!, env: Environment<T, *>!): Unit

setActions

Sets the Actions list. Some implementations may not allow to change it at runtime.

abstract fun setActions(a: MutableList<Action<T>!>!): Unit

setConditions

Sets the Conditions list. Some implementations may not allow to change it at runtime.

abstract fun setConditions(c: MutableList<Condition<T>!>!): Unit

update

Updates the scheduling of this reaction.

abstract fun update(curTime: Time!, executed: Boolean, env: Environment<T, *>!): Unit