Documentation
¶
Overview ¶
A simple agent that notices blackboard changing
Concludes by putting a future call to itself back into the slipnet controller A more general, non slipnet specific version may be better in the future. for now we stay narrow. Cognitive clock?
A base visualization without interaction
Index ¶
- func BenchA2ALatency100MiB(b *B)
- func BenchA2ALatency10MiB(b *B)
- func BenchA2ALatency1GiB(b *B)
- func BenchA2ALatency1KiB(b *B)
- func BenchA2ALatency1MiB(b *B)
- func BenchA2ALatency32B(b *B)
- func BenchA2ALatency4KiB(b *B)
- func BenchAgentBBLatency(b *B)
- func BenchAgentOverhead(b *B)
- func GetAgentPipe(bb_addr string, tags ...string) (snd *PipeSender, rcv *PipeReceiver)
- func RandStringRunes(n int) string
- type B
- type BFunc
- type BufferedMessage
- type ChangeAgent
- type ChatAgent
- func (c *ChatAgent) Done() chan struct{}
- func (c *ChatAgent) GUICompleted() chan struct{}
- func (c *ChatAgent) Loop(ctx context.Context) (bool, error)
- func (c *ChatAgent) SetModeLine(msg string)
- func (c *ChatAgent) SetTags(tags []string)
- func (c *ChatAgent) Setup() error
- func (c *ChatAgent) Stop()
- func (c *ChatAgent) TriggerRedraw()
- type Chatterbox
- type NetworkBenchmarkAgent
- type PingAgent
- type PipeReceiver
- type PipeSender
- type PongAgent
- type ReplayAgent
- type TimeWatcher
- type WatchdogAgent
- type Watcher
- type WebAgent
- func (wa *WebAgent) BlackboardHandler(w http.ResponseWriter, r *http.Request)
- func (wa *WebAgent) IndexHandler(w http.ResponseWriter, r *http.Request)
- func (wa *WebAgent) JSHandler(w http.ResponseWriter, r *http.Request)
- func (wa *WebAgent) ListenAndServe(addr string) error
- func (wa *WebAgent) LoggingMiddleware(next http.Handler) http.HandlerFunc
- func (wa *WebAgent) Loop(ctx context.Context) (bool, error)
- func (wa *WebAgent) MessageHandler(w http.ResponseWriter, r *http.Request)
- func (wa *WebAgent) Setup() error
- func (wa *WebAgent) StreamHandler(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BenchA2ALatency100MiB ¶
func BenchA2ALatency100MiB(b *B)
func BenchA2ALatency10MiB ¶
func BenchA2ALatency10MiB(b *B)
func BenchA2ALatency1GiB ¶
func BenchA2ALatency1GiB(b *B)
func BenchA2ALatency1KiB ¶
func BenchA2ALatency1KiB(b *B)
func BenchA2ALatency1MiB ¶
func BenchA2ALatency1MiB(b *B)
func BenchA2ALatency32B ¶
func BenchA2ALatency32B(b *B)
func BenchA2ALatency4KiB ¶
func BenchA2ALatency4KiB(b *B)
func BenchAgentOverhead ¶
func BenchAgentOverhead(b *B)
func GetAgentPipe ¶
func GetAgentPipe(bb_addr string, tags ...string) (snd *PipeSender, rcv *PipeReceiver)
Get sender and receiver connected by the provided tags
func RandStringRunes ¶
Types ¶
type BufferedMessage ¶
type ChangeAgent ¶
type ChangeAgent struct { LastHash string client.CoreAgent // contains filtered or unexported fields }
func NewChangeAgent ¶
func NewChangeAgent(addr string, n_msg int) *ChangeAgent
Change agent is a "meta" agent monitoring blackboard state
func (*ChangeAgent) Loop ¶
func (agt *ChangeAgent) Loop(ctx context.Context) (cont bool, err error)
This agent starts, does it job, then dies
func (*ChangeAgent) Setup ¶
func (agt *ChangeAgent) Setup() error
type ChatAgent ¶
func (*ChatAgent) GUICompleted ¶
func (c *ChatAgent) GUICompleted() chan struct{}
func (*ChatAgent) SetModeLine ¶
func (*ChatAgent) TriggerRedraw ¶
func (c *ChatAgent) TriggerRedraw()
type Chatterbox ¶ added in v0.2.6
Chatterbox is a testing agent designed to illustrate chains of messaging
in core. We try to simulate pseudo processing conversation/dynamics. The intent it to produce chains of conversations between agents.
func (*Chatterbox) Loop ¶ added in v0.2.6
func (c *Chatterbox) Loop(ctx context.Context) (bool, error)
We want to favor longer chains of conversation Chatterboxes take three actions: 1. tell someone new (createAgent on topic/tag) # introduce new topics 2. discuss (reply to an ongoing conversation on topic) - Reply prob high if shared tag, if no shared tag p = lifetime(t) # connect topics 3. leave or change the conversation p = lifetime(t) # expire agents
func (*Chatterbox) SetTopic ¶ added in v0.2.6
func (c *Chatterbox) SetTopic(topic string)
func (*Chatterbox) Setup ¶ added in v0.2.6
func (c *Chatterbox) Setup() error
type NetworkBenchmarkAgent ¶
func (*NetworkBenchmarkAgent) Loop ¶
func (a *NetworkBenchmarkAgent) Loop(ctx context.Context) (cont bool, err error)
NetworkBenchmarkAgent runs all of our network benchmarks and reports results to the blackboard No statistics possible with this approach though (just tracking total time)
func (*NetworkBenchmarkAgent) Setup ¶
func (a *NetworkBenchmarkAgent) Setup() error
type PingAgent ¶
func (*PingAgent) PrimeBlackboard ¶ added in v0.2.6
func (a *PingAgent) PrimeBlackboard()
type PipeReceiver ¶
type PipeSender ¶
This agent pipe structure is supposed to be a super lightweight set of connected agents with send and receive tags already set up. It's more "udp" in nature in that we eschew error handling and let it fly
I think these agents will leak goroutines TODO: we need a way pass anything that inherits from a BasicAgent and kill any running goroutines
func (*PipeSender) Send ¶
func (a *PipeSender) Send(data []byte)
type ReplayAgent ¶ added in v0.2.6
type ReplayAgent struct { client.CoreAgent // BB on which we will listen Addr string RemoteAddr string OutgoingQueueSize int // contains filtered or unexported fields }
func (*ReplayAgent) ClearReplayQueue ¶ added in v0.2.6
func (r *ReplayAgent) ClearReplayQueue() error
Sit on the outgoing queue and post to the blackboard
func (*ReplayAgent) Loop ¶ added in v0.2.6
func (r *ReplayAgent) Loop(ctx context.Context) (bool, error)
func (*ReplayAgent) Setup ¶ added in v0.2.6
func (r *ReplayAgent) Setup() error
type TimeWatcher ¶ added in v0.2.6
type TimeWatcher struct {
// contains filtered or unexported fields
}
func NewTimeWatcher ¶ added in v0.2.6
func NewTimeWatcher(d time.Duration) *TimeWatcher
func (*TimeWatcher) TimeLimit ¶ added in v0.2.6
func (t *TimeWatcher) TimeLimit() time.Duration
func (*TimeWatcher) Watch ¶ added in v0.2.6
func (t *TimeWatcher) Watch() error
type WatchdogAgent ¶ added in v0.2.6
type WatchdogAgent struct { client.CoreAgent client.Controller Watcher TimeLimit time.Duration LogInterval time.Duration // contains filtered or unexported fields }
Watchdog Agent wraps a watchdog and sends a halt when the watcher triggers
func NewWatchdogAgent ¶ added in v0.2.6
func NewWatchdogAgent(bb_addr string) *WatchdogAgent
func (*WatchdogAgent) Loop ¶ added in v0.2.6
func (w *WatchdogAgent) Loop(ctx context.Context) (bool, error)
func (*WatchdogAgent) SetWatcher ¶ added in v0.2.6
func (w *WatchdogAgent) SetWatcher(wa Watcher)
func (*WatchdogAgent) Setup ¶ added in v0.2.6
func (w *WatchdogAgent) Setup() error
type WebAgent ¶ added in v0.2.6
func NewWebAgent ¶ added in v0.2.6
func (*WebAgent) BlackboardHandler ¶ added in v0.2.6
func (wa *WebAgent) BlackboardHandler(w http.ResponseWriter, r *http.Request)
func (*WebAgent) IndexHandler ¶ added in v0.2.6
func (wa *WebAgent) IndexHandler(w http.ResponseWriter, r *http.Request)
func (*WebAgent) JSHandler ¶ added in v0.2.6
func (wa *WebAgent) JSHandler(w http.ResponseWriter, r *http.Request)
func (*WebAgent) ListenAndServe ¶ added in v0.2.6
func (*WebAgent) LoggingMiddleware ¶ added in v0.2.6
func (wa *WebAgent) LoggingMiddleware(next http.Handler) http.HandlerFunc
This page functions more like a web app using JS to interact with the new blackboard that is created when visiting this page.
Thought: agent design should almost always be "fire and forget". Transactional agents are ineffective and slow. Streaming agents utilize the system to the fullest effect. Get the middle-agent out of the way.
The web interface
func (*WebAgent) MessageHandler ¶ added in v0.2.6
func (wa *WebAgent) MessageHandler(w http.ResponseWriter, r *http.Request)
func (*WebAgent) StreamHandler ¶ added in v0.2.6
func (wa *WebAgent) StreamHandler(w http.ResponseWriter, r *http.Request)
"proxy" the connection through for BB visibility without direct connection