perctools

package
v0.0.0-...-54ad92e Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Percolator

type Percolator struct {
	N     int
	Ids   []int
	Spout []int
	// contains filtered or unexported fields
}

Percolator, a type for convenience in comparisons with range indices

func NewPercolator

func NewPercolator(prob float64, N int, seed uint64) Percolator

NewPercolator randomly generates iid bernoulli and construct percolator graph

func (*Percolator) DownSpout

func (Pg *Percolator) DownSpout()

Downspout uses dijkstra to find a path from top to bottom dijkstra is way overkill. if you didn't care about the whole path, could use From method on bottom return first path found from top to bottom

func (Percolator) Print

func (Pg Percolator) Print(s string, d int)

Print plays the percolator game in terminal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL