PersistentGraph

Graph implemented using persistent collections.

Should be somewhat efficient if making extensive use of time-travel debugging, otherwise MutableGraph should be a better option.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun addBehavior(behavior: ExternalBehavior)
Link copied to clipboard
open override fun addChild(behavior: BehaviorID, child: NodeID)

open override fun addChild(parent: NodeID, child: NodeID)

Adds a parent-child edge to the graph.

Link copied to clipboard
open override fun addNode(node: Node<*>)

Adds a node to the graph.

Link copied to clipboard
open override fun getBehaviorParentsOf(id: NodeID): List<BehaviorID>
Link copied to clipboard
open override fun getChildrenOf(id: NodeID): List<NodeID>

Get the list of all child nodes of a node in the graph.

Link copied to clipboard

Get the current list of the child map in the graph.

Link copied to clipboard
open override fun getCurrentNodeMap(): Map<NodeID, Node<*>>

Get the current map of nodes in the graph.

Link copied to clipboard
open override fun getCurrentNodes(): Collection<Node<*>>

Get the list of current nodes in the graph.

Link copied to clipboard
Link copied to clipboard
open override fun getNode(id: NodeID): Node<*>?

Get the node (if any) corresponding to the given id.

Link copied to clipboard
open override fun resetChildren(map: Map<NodeID, Collection<NodeID>>)

Reset the state of the child map to match that of the passed map.