-
- All Implemented Interfaces:
public interface DependencyGraph<T>This interface allows to separate the usage of a dependency graph from its implementation.
-
-
Method Summary
Modifier and Type Method Description abstract voidaddNeighbor(Node<T> n1, Node<T> n2)Given two nodes, the graph assumes they are now neighbors and calculates the neighborhood dependencies between them. abstract voidcreateDependencies(Reaction<T> rh)This method creates the dependencies when a new reaction is added to the environment. abstract voidremoveDependencies(Reaction<T> rh)This method removes all the dependencies (both in and out dependencies) for a given reaction handler. abstract voidremoveNeighbor(Node<T> n1, Node<T> n2)Given two nodes, the engine assumes they are no longer neighbors and deletes the neighborhood dependencies between them. abstract ListSet<Reaction<T>>outboundDependencies(Reaction<T> reaction)Returns the set of reactions that may be influenced by the provided reaction. abstract ListSet<Reaction<T>>globalInputContextReactions()-
-
Method Detail
-
addNeighbor
abstract void addNeighbor(Node<T> n1, Node<T> n2)
Given two nodes, the graph assumes they are now neighbors and calculates the neighborhood dependencies between them.
- Parameters:
n1- The first noden2- The second node
-
createDependencies
abstract void createDependencies(Reaction<T> rh)
This method creates the dependencies when a new reaction is added to the environment. Please be careful when building the environment and populating the existing reactions map: this method assumes that all the dependencies among the existing reactions are correct and up to date.
- Parameters:
rh- the reaction handler whose dependencies should be calculated.
-
removeDependencies
abstract void removeDependencies(Reaction<T> rh)
This method removes all the dependencies (both in and out dependencies) for a given reaction handler. This method is meant to be used in order to keep the dependencies clean when removing a reaction.
- Parameters:
rh- the reaction handler whose dependencies will be deleted.
-
removeNeighbor
abstract void removeNeighbor(Node<T> n1, Node<T> n2)
Given two nodes, the engine assumes they are no longer neighbors and deletes the neighborhood dependencies between them.
- Parameters:
n1- The first noden2- The second node
-
outboundDependencies
abstract ListSet<Reaction<T>> outboundDependencies(Reaction<T> reaction)
Returns the set of reactions that may be influenced by the provided reaction.
- Parameters:
reaction- the input reaction
-
globalInputContextReactions
abstract ListSet<Reaction<T>> globalInputContextReactions()
-
-
-
-