Skip to content

Commit 68d86e4

Browse files
committed
Simplified evaluate in causable graph
Signed-off-by: Marvin Hansen <[email protected]>
1 parent 28c30d3 commit 68d86e4

File tree

1 file changed

+4
-13
lines changed
  • deep_causality/src/types/causal_types/causaloid

1 file changed

+4
-13
lines changed

deep_causality/src/types/causal_types/causaloid/causable.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
use crate::errors::CausalityError;
77
use crate::{
8-
Causable, CausableCollectionExplaining, Causaloid, CausaloidType, Datable, PropagatingEffect,
9-
SpaceTemporal, Spatial, Symbolic, Temporal,
8+
AggregateLogic, Causable, CausableCollectionExplaining, CausableCollectionReasoning, Causaloid,
9+
CausaloidType, Datable, PropagatingEffect, SpaceTemporal, Spatial, Symbolic, Temporal,
1010
};
1111

1212
#[allow(clippy::type_complexity)]
@@ -39,7 +39,7 @@ where
3939
})?;
4040
context_fn(effect, context)
4141
} else {
42-
// Standard path
42+
// Standard causal function w/o context
4343
let causal_fn = self.causal_fn.ok_or_else(|| {
4444
CausalityError(format!("Causaloid {} is missing a causal_fn", self.id))
4545
})?;
@@ -52,16 +52,7 @@ where
5252
CausalityError("Causaloid::evaluate: causal collection is None".into())
5353
})?;
5454

55-
// Default aggregation: "any true" logic.
56-
// Prioritizes Halting, then looks for the first Deterministic(true).
57-
let mut has_true = false;
58-
for cause in coll.iter() {
59-
if let PropagatingEffect::Deterministic(true) = cause.evaluate(effect)? {
60-
has_true = true;
61-
break; // Short-circuit
62-
}
63-
}
64-
PropagatingEffect::Deterministic(has_true)
55+
coll.evaluate_mixed(effect, &AggregateLogic::All, 0.5)?
6556
}
6657

6758
CausaloidType::Graph => {

0 commit comments

Comments
 (0)