evaluate

Function evaluate 

Source
pub fn evaluate(
    graph: &Graph,
    inputs: &HashMap<u16, bool>,
) -> Result<HashMap<u16, bool>, EvalError>
Expand description

Evaluate a TØR-G graph with given input values.

§Arguments

  • graph - The graph to evaluate
  • inputs - Map from input IDs to their boolean values

§Returns

Map from output IDs to their computed boolean values.

§Errors

Returns an error if:

  • A required input is missing
  • An output references an undefined ID
  • Internal evaluation fails (should not happen with valid graphs)