strategy

package
v0.0.0-...-74b5f4e Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

Package strategy defines different strategies for drawing images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actions

type Actions []gui.Action

Actions lets you sort by gui.Action values.

See: https://gobyexample.com/sorting-by-functions

func (Actions) Len

func (s Actions) Len() int

func (Actions) Less

func (s Actions) Less(i, j int) bool

func (Actions) Swap

func (s Actions) Swap(i, j int)

type Ideal

type Ideal struct {
	Rating perception.Rating
}

func (*Ideal) Strategize

func (s *Ideal) Strategize(app *gui.AppState) (gui.Action, Rating)

Ideal chooses the next action which has the highest expected overall Rating.

type Plurality

type Plurality struct {
	Voters []*Ideal
}

func (*Plurality) Strategize

func (s *Plurality) Strategize(app *gui.AppState) (gui.Action, Rating)

type RandomWalk

type RandomWalk struct{}

func (*RandomWalk) Strategize

func (_ *RandomWalk) Strategize(_ *gui.AppState) (gui.Action, Rating)

RandomWalk chooses the next action completely randomly.

type Rating

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

func (*Rating) String

func (r *Rating) String() string

type Strategizer

type Strategizer interface {
	// Strategize chooses the next action.
	//
	// The Rating is returned to help debug its behavior. It should indicate
	// the desirability (rating and distance to event) of the next action and
	// why it was chosen.
	Strategize(*gui.AppState) (gui.Action, Rating)
}

Strategizer chooses the next action.

Jump to

Keyboard shortcuts

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