pub enum Operation<I, O, C, N>{
CreateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>),
UpdateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>),
DeleteCausaloid(CausaloidId),
CreateContext {
id: ContextId,
name: String,
capacity: usize,
},
CreateExtraContext {
context_id: ContextId,
extra_context_id: u64,
capacity: usize,
},
UpdateContext {
id: ContextId,
new_name: Option<String>,
},
DeleteContext(ContextId),
AddContextoidToContext {
context_id: ContextId,
contextoid: N,
},
UpdateContextoidInContext {
context_id: ContextId,
existing_contextoid: ContextoidId,
new_contextoid: N,
},
DeleteContextoidFromContext {
context_id: ContextId,
contextoid_id: ContextoidId,
},
Sequence,
NoOp,
}Expand description
Represents all possible operations that can be applied to a causal model.
This enum provides a declarative way to specify model transformations. Each variant
represents a primitive operation that can be executed by the Interpreter.
§Type Parameters
I: Input effect value typeO: Output effect value typeC: Context type (e.g.,Context)N: Node type (e.g.,Contextoid)
Variants§
CreateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>)
Creates a new causaloid with the specified ID.
§Fields
CausaloidId: Unique identifier for the causaloidCausaloid: The causaloid instance to create
UpdateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>)
Updates an existing causaloid, replacing it with a new instance.
§Fields
CausaloidId: ID of the causaloid to updateCausaloid: New causaloid instance
DeleteCausaloid(CausaloidId)
CreateContext
Creates a new base context.
§Fields
id: Unique identifier for the contextname: Human-readable namecapacity: Initial capacity for the context graph
CreateExtraContext
Creates an extra context within an existing context.
§Fields
context_id: ID of the parent contextextra_context_id: ID for the new extra contextcapacity: Initial capacity for the extra context
UpdateContext
Updates properties of an existing context.
§Fields
id: ID of the context to updatenew_name: Optional new name for the context
DeleteContext(ContextId)
AddContextoidToContext
Adds a node (contextoid) to a context’s graph.
§Fields
context_id: ID of the target contextcontextoid: The node to add
UpdateContextoidInContext
Updates an existing node (contextoid) within a context.
§Fields
context_id: ID of the containing contextexisting_contextoid: ID of the node to replacenew_contextoid: New node instance
DeleteContextoidFromContext
Deletes a node (contextoid) from a context’s graph.
§Fields
context_id: ID of the containing contextcontextoid_id: ID of the node to delete
Sequence
Control flow: Execute all child operations in sequence.
Fails if any child operation fails. Used as a root or intermediate
node in an OpTree to compose multiple operations.
NoOp
No operation. Useful as a placeholder or for conditional logic.