Entanglement Protocol

Entanglement protocol definition (abstract)

class src.entanglement_management.entanglement_protocol.EntanglementProtocol(own: Node, name: str)

Class for all entanglement management protocols.

Provides an interface for rule attachment, protocol pairing, and memory management.

own

Node object to attach to

Type:

Node

name

Name of the protocol instance

Type:

str

rule

Rule which created this protocol instance (from the rule manager).

Type:

Rule

memories

Any memories being operated on

Type:

List[Memory]

abstract is_ready() bool

Method to check if protocol is ready to start (abstract).

Returns:

if protocol is ready or not.

Return type:

bool

abstract memory_expire(memory: Memory) None

Method to receive a memory expiration event (abstract).

release() None

Method to release attached memories.

abstract set_others(remote_protocol: str, remote_node: str, memories: List[str]) None

Method to set other entanglement protocol instance.

Parameters:
  • remote_protocol (str) – other protocol name.

  • remote_node (str) – other node name.

  • memories (List[str]) – the list of memory names used on other node.

abstract start() None

Method to start entanglement protocol process (abstract).

update_resource_manager(memory: Memory, state: str) None

Method to update attached memory to desired state.

Parameters:
  • memory (Memory) – attached memory to update.

  • state (str) – state memory should be updated to.

Side Effects:

May alter the state of memory.