Documentation
¶
Index ¶
- Constants
- func ColorWrap(name string, str string) string
- func CoreSplash() string
- func CoreSplash2() string
- func CoreSplash3() string
- func CoreSplash4() string
- func CoreSplashOverTheTop() string
- func DoSplash()
- func GetNextColor() string
- func HexSplash() string
- func HexSplash2() string
- func JawharSplash() string
- func KaneruSplash() string
- func L2Norm(v vec2f) float64
- func MD5HashSplash() string
- func MD5HashSplash2() string
- func NewNode(name string) *node
- func NewStreamingApplication(ctx context.Context, cancel_func context.CancelFunc, names []string, ...) error
- func Plus(v1, v2 vec2f) vec2f
- func RandomSplash() string
- func RandomVec2f() vec2f
- func ScalarMult(c float64, v vec2f) vec2f
- func ShinzuiSplash() string
- func Sub(v1, v2 vec2f) vec2f
- func TcellFriendlyRandomSplash() string
- func Unit(v vec2f) vec2f
- func YadroSplash() string
- type Animation
- type Arranger
- type Artist
- type BeamAnimation
- type BusArranger
- type BusArtist
- type Drawable
- type MultiAgentMonitor
- func (s *MultiAgentMonitor) AddWindow(name string, stdin io.Reader) *Window
- func (s *MultiAgentMonitor) Draw(elapsed float64)
- func (s *MultiAgentMonitor) DrawAgentView()
- func (s *MultiAgentMonitor) DrawBorder(idx int, style tcell.Style)
- func (s *MultiAgentMonitor) DrawHeader(idx int, style tcell.Style)
- func (s *MultiAgentMonitor) DrawMapView(elapsed float64)
- func (s *MultiAgentMonitor) DrawRectangle(x, y, w, h int, char rune, style tcell.Style)
- func (s *MultiAgentMonitor) DrawSplash()
- func (s *MultiAgentMonitor) DrawStatusLine(idx int, style tcell.Style)
- func (s *MultiAgentMonitor) GetNames() []string
- func (s *MultiAgentMonitor) GetWindowWidth() int
- func (s *MultiAgentMonitor) InitializeMapView(names []string)
- func (s *MultiAgentMonitor) PutString(x, y, w int, text string, style tcell.Style)
- type PhysicsParticle
- type SplashFunc
- type Window
Constants ¶
const ( Reset string = "\033[0m" Red string = "\033[31m" Green string = "\033[32m" Yellow string = "\033[33m" Blue string = "\033[34m" Purple string = "\033[35m" Cyan string = "\033[36m" Gray string = "\033[37m" White string = "\033[97m" )
const ( SplashScreen = iota AgentView MapView )
Variables ¶
This section is empty.
Functions ¶
func ColorWrap ¶
ColorWrap retrieves the color of a core component from a color table and returns it if it exists.
func CoreSplash ¶
func CoreSplash() string
func CoreSplash2 ¶
func CoreSplash2() string
func CoreSplash3 ¶
func CoreSplash3() string
func CoreSplash4 ¶
func CoreSplash4() string
func CoreSplashOverTheTop ¶
func CoreSplashOverTheTop() string
func GetNextColor ¶
func GetNextColor() string
GetNextColor iterates on supported colors and returns the next one.
func HexSplash2 ¶
func HexSplash2() string
func MD5HashSplash ¶
func MD5HashSplash() string
func MD5HashSplash2 ¶
func MD5HashSplash2() string
func NewStreamingApplication ¶
func NewStreamingApplication(ctx context.Context, cancel_func context.CancelFunc, names []string, rdrs []io.Reader, bb_addr string) error
NewStreaminingApplication launches a core process visualizer in the console.
func ScalarMult ¶
func ScalarMult(c float64, v vec2f) vec2f
ScalarMult calculates the product between a scalar and a vector.
func TcellFriendlyRandomSplash ¶
func TcellFriendlyRandomSplash() string
TcellFriendlyRandomSplash returns a splash function at random that is compatible with tcell.
Types ¶
type Animation ¶
type Animation interface { Update(elapsed float64) Draw(scr *MultiAgentMonitor) Done() <-chan struct{} }
Animation bundles basic core animation functionality.
type Artist ¶
type Artist interface {
Draw(scr *MultiAgentMonitor, agents []*node)
}
Artist represents somethat that can draw agents into the scene.
type BeamAnimation ¶
type BeamAnimation struct {
// contains filtered or unexported fields
}
BeamAnimation represents the source and destination vectors of a beam for node and data visualization in the map view.
type BusArranger ¶
type BusArranger struct {
// contains filtered or unexported fields
}
BusArranger defines the width and padding of a visualization bus. A bus allows users to visualize data flow in the core system.
func NewBusArranger ¶
func NewBusArranger() *BusArranger
NewBusArranger creates a default BusArranger.
func (*BusArranger) Arrange ¶
func (b *BusArranger) Arrange(nodes []*node, screen_w, screen_h int)
Arrange organizes and arranges nodes (representing agents) on the screen in a multiagent monitor.
type BusArtist ¶
type BusArtist struct{}
BusArtist generates the graphics representing agent nodes on the bus.
func (*BusArtist) Draw ¶
func (b *BusArtist) Draw(scr *MultiAgentMonitor, nodes []*node)
Draw generates the graphics representing agent nodes on the bus. This breaks any convenient reuse of the draw interface
type MultiAgentMonitor ¶
type MultiAgentMonitor struct { tcell.Screen Windows []*Window Active int // Current agent being controlled ScreenIdx int // Currently shown screen // contains filtered or unexported fields }
MultiAgentMonitor is the primary on-screen visualization structure for core.
func NewMultiAgentMonitor ¶
func NewMultiAgentMonitor() *MultiAgentMonitor
NewMultiAgentMonitor creates a new MultiAgentMonitor for the current core run.
func (*MultiAgentMonitor) AddWindow ¶
func (s *MultiAgentMonitor) AddWindow(name string, stdin io.Reader) *Window
AddWindow adds a window to the MultiAgentMonitor.
func (*MultiAgentMonitor) Draw ¶
func (s *MultiAgentMonitor) Draw(elapsed float64)
Draw is a convenience function that calls on different draw functions based on the screen index (i.e. currently shown screen).
func (*MultiAgentMonitor) DrawAgentView ¶
func (s *MultiAgentMonitor) DrawAgentView()
DrawAgentView generates a single agent view on the monitor screen.
func (*MultiAgentMonitor) DrawBorder ¶
func (s *MultiAgentMonitor) DrawBorder(idx int, style tcell.Style)
DrawBorder creates a rectangular border on the view window.
func (*MultiAgentMonitor) DrawHeader ¶
func (s *MultiAgentMonitor) DrawHeader(idx int, style tcell.Style)
DrawHeader creates a header bar on the MultiAgentMonitor.
func (*MultiAgentMonitor) DrawMapView ¶
func (s *MultiAgentMonitor) DrawMapView(elapsed float64)
DrawMapView draws a map view on the MultiAgentMonitor screen.
func (*MultiAgentMonitor) DrawRectangle ¶
func (s *MultiAgentMonitor) DrawRectangle(x, y, w, h int, char rune, style tcell.Style)
DrawRectangle draws a rectangle on the MultiAgentMonitor.
func (*MultiAgentMonitor) DrawSplash ¶
func (s *MultiAgentMonitor) DrawSplash()
DrawSplash displays the MultiAgentMonitor's core splash on the screen.
func (*MultiAgentMonitor) DrawStatusLine ¶
func (s *MultiAgentMonitor) DrawStatusLine(idx int, style tcell.Style)
DrawStatusLine draws a status line on the window.
func (*MultiAgentMonitor) GetNames ¶
func (s *MultiAgentMonitor) GetNames() []string
GetNames retrieves the names of the windows in the MultiAgentMonitor.
func (*MultiAgentMonitor) GetWindowWidth ¶
func (s *MultiAgentMonitor) GetWindowWidth() int
GetWindowWidth calculates and returns the width of the window.
func (*MultiAgentMonitor) InitializeMapView ¶
func (s *MultiAgentMonitor) InitializeMapView(names []string)
InitializeMapView creates an initialized map view from a slice of node names.
Map views perform actions:
- arrange agents (sets state of graph)
- connect agents (draw any background dependent on agent position)
- draw "sends" (illustrate or update any "pew pew" information)
type PhysicsParticle ¶
type PhysicsParticle struct {
// contains filtered or unexported fields
}
PhysicsParticle represents a physics-based particle for animation.
func NewPhysicsParticle ¶
func NewPhysicsParticle(dst, src vec2f, vel vec2f) *PhysicsParticle
NewPhysicsParticle creates a new PhysicsParticle with initialized vectors.
func (*PhysicsParticle) Done ¶
func (b *PhysicsParticle) Done() <-chan struct{}
Done signals that the PhysicsParticle process is done.
func (*PhysicsParticle) Draw ¶
func (b *PhysicsParticle) Draw(scr *MultiAgentMonitor)
Draw visualizes the PhysicsParticle on the screen in the MultiAgentMonitor.
func (*PhysicsParticle) Update ¶
func (b *PhysicsParticle) Update(elapsed float64)
Update updates the vectors of the PhysicsParticle.
type SplashFunc ¶
type SplashFunc func() string
SplashFunc is an alias type for func() string for splashes.
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window represents the visualizer window.
func (*Window) Complete ¶
func (w *Window) Complete()
Complete marks the process in the window as completed (freezes the spinner).
func (*Window) GetBuffer ¶
GetBuffer extracts currently visualized strings based on the current position in the window's string buffer.
func (*Window) GetStatusString ¶
GetStatusString returns a string describing the current Window.