tui

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Empty          = ' '
	Shade          = '░'
	Full           = '█'
	SelectionStart = '['
	SelectionEnd   = ']'
	EvidenceStart  = '+'
	EvidenceEnd    = '+'
	ArrowUp        = '^'
	ArrowDown      = 'v'
	ArrowLeft      = '<'
	ArrowRight     = '>'
)

Variables

View Source
var (
	BorderH  = []rune{'─', '═'}
	BorderV  = []rune{'│', '║'}
	BorderNE = []rune{'┐', '╗'}
	BorderNW = []rune{'┌', '╔'}
	BorderSE = []rune{'┘', '╝'}
	BorderSW = []rune{'└', '╚'}
)
View Source
var ColorNames = []string{
	"black",
	"maroon",
	"green",
	"olive",
	"navy",
	"purple",
	"teal",
	"silver",
	"gray",
	"red",
	"lime",
	"yellow",
	"blue",
	"fuchsia",
	"aqua",
	"white",
}
View Source
var ColorTags = []string{
	"[black]",
	"[maroon]",
	"[green]",
	"[olive]",
	"[navy]",
	"[purple]",
	"[teal]",
	"[silver]",
	"[gray]",
	"[red]",
	"[lime]",
	"[yellow]",
	"[blue]",
	"[fuchsia]",
	"[aqua]",
	"[-]",
}
View Source
var NamedColors = map[string]Color{
	"black":   Black,
	"maroon":  Maroon,
	"green":   Green,
	"olive":   Olive,
	"navy":    Navy,
	"purple":  Purple,
	"teal":    Teal,
	"silver":  Silver,
	"gray":    Gray,
	"red":     Red,
	"lime":    Lime,
	"yellow":  Yellow,
	"blue":    Blue,
	"fuchsia": Fuchsia,
	"aqua":    Aqua,
	"white":   White,
}
View Source
var Partial = []rune{
	'▏', '▎', '▍', '▌', '▋', '▊', '▉',
}

Functions

func ParseEvidence

func ParseEvidence(evidence []string) (map[string]string, error)

func Solve added in v0.5.0

func Solve(network *bbn.Network, evidence map[string]string, nodes []Node, ignorePolicies bool) (map[string][]float64, error)

func TrainNetwork added in v0.5.0

func TrainNetwork(net *bbn.Network, nodes []bbn.Variable, dataFile, noData string, delimiter rune) (*bbn.Network, error)

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func New

func New(path string, evidence map[string]string, trainingFile, noData string, csvDelimiter rune) *App

func (*App) Run

func (a *App) Run() error

type Bounds

type Bounds struct {
	X int
	Y int
	W int
	H int
}

func NewBounds

func NewBounds(x, y, w, h int) Bounds

func (*Bounds) Centroid

func (b *Bounds) Centroid() (int, int)

func (*Bounds) Contains

func (b *Bounds) Contains(x, y int) bool

func (*Bounds) Extend

func (b *Bounds) Extend(other *Bounds)

type Color

type Color uint8
const (
	Black Color = iota
	Maroon
	Green
	Olive
	Navy
	Purple
	Teal
	Silver
	Gray
	Red
	Lime
	Yellow
	Blue
	Fuchsia
	Aqua
	White
	ColorsEnd
)

type Node

type Node interface {
	Node() *bbn.Variable
	Bounds() *Bounds
	Render(probs []float64, selected bool, state int, evidence bool) ([][]rune, [][]Color)
	SelectedOutcome(x, y int) (int, bool)
}

func NewNode

func NewNode(n bbn.Variable) Node

type Table

type Table struct {
	tview.TableContentReadOnly
	// contains filtered or unexported fields
}

func NewTable

func NewTable(nodes []Node, index int, nodesByName map[string]int) Table

func (*Table) GetCell

func (t *Table) GetCell(row, column int) *tview.TableCell

func (*Table) GetColumnCount

func (t *Table) GetColumnCount() int

func (*Table) GetRowCount

func (t *Table) GetRowCount() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳