fix: Simplify init_engine - transducers handle their own dependencies
MasterTransducer and EmissaryTransducer only take config and name. They handle witnessing_layer and temporal_memory internally.
This commit is contained in:
+16
-30
@@ -187,20 +187,6 @@ def init_engine(
|
|||||||
dampening=0.995,
|
dampening=0.995,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create witnessing layer
|
|
||||||
witnessing_layer = WitnessingLayer(
|
|
||||||
coherence_threshold=coherence_threshold,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create temporal memory
|
|
||||||
temporal_memory = TemporalMemory(
|
|
||||||
storage_path="./memory",
|
|
||||||
max_memories=10000,
|
|
||||||
consolidation_interval=3600,
|
|
||||||
decay_base=0.01,
|
|
||||||
attention_threshold=coherence_threshold,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create master and emissary transducers with proper configs
|
# Create master and emissary transducers with proper configs
|
||||||
master_config = MasterConfig(
|
master_config = MasterConfig(
|
||||||
tau_scale=master_tau,
|
tau_scale=master_tau,
|
||||||
@@ -220,19 +206,9 @@ def init_engine(
|
|||||||
action_delay=0.0,
|
action_delay=0.0,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create master first (without sync_layer)
|
# Create master and emissary (they handle their own dependencies)
|
||||||
master = MasterTransducer(
|
master = MasterTransducer(config=master_config, name="master")
|
||||||
config=master_config,
|
emissary = EmissaryTransducer(config=emissary_config, name="emissary")
|
||||||
witnessing_layer=witnessing_layer,
|
|
||||||
temporal_memory=temporal_memory,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create emissary first (without sync_layer)
|
|
||||||
emissary = EmissaryTransducer(
|
|
||||||
config=emissary_config,
|
|
||||||
witnessing_layer=witnessing_layer,
|
|
||||||
temporal_memory=temporal_memory,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create sync layer (needs master and emissary)
|
# Create sync layer (needs master and emissary)
|
||||||
sync_layer = SyncLayer(
|
sync_layer = SyncLayer(
|
||||||
@@ -241,9 +217,19 @@ def init_engine(
|
|||||||
config=sync_config,
|
config=sync_config,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Now update the master and emissary with sync_layer
|
# Create witnessing layer
|
||||||
master.sync_layer = sync_layer
|
witnessing_layer = WitnessingLayer(
|
||||||
emissary.sync_layer = sync_layer
|
coherence_threshold=coherence_threshold,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create temporal memory
|
||||||
|
temporal_memory = TemporalMemory(
|
||||||
|
storage_path="./memory",
|
||||||
|
max_memories=10000,
|
||||||
|
consolidation_interval=3600,
|
||||||
|
decay_base=0.01,
|
||||||
|
attention_threshold=coherence_threshold,
|
||||||
|
)
|
||||||
|
|
||||||
# Create main engine
|
# Create main engine
|
||||||
engine = KAIROSTemporalEngine(
|
engine = KAIROSTemporalEngine(
|
||||||
|
|||||||
Reference in New Issue
Block a user