PerceptionBuffer class
A short-lived, high-capacity pre-attentive buffer.
Raw Perception objects flow in here and are held for retentionDuration. The attention spotlight then selects which perceptions propagate further into the global workspace. Unattended perceptions decay and are lost.
Constructors
- PerceptionBuffer({int capacity = 50, Duration retentionDuration = const Duration(seconds: 3), ConsciousnessLogger? logger})
Properties
- capacity → int
-
final
- currentSize → int
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasPending → bool
-
True when the buffer has pending perceptions.
no setter
-
modalityDistribution
→ Map<
PerceptionModality, int> -
Returns how many perceptions are of each modality.
no setter
- retentionDuration → Duration
-
How long a perception survives without being processed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalAdded → int
-
no setter
- totalDropped → int
-
no setter
Methods
-
add(
Perception perception) → void - Adds a Perception to the buffer.
-
addAll(
Iterable< Perception> perceptions) → void - Adds multiple perceptions at once.
-
clear(
) → void - Clears the entire buffer (drop everything).
-
drain(
) → List< Perception> - Drains and returns all non-expired perceptions.
-
drainByModality(
PerceptionModality modality) → List< Perception> -
Drains only perceptions of a specific
modality. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
peek(
) → List< Perception> - Peeks at all current perceptions without removing them.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited