datastructures

package
v1.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QMap

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

QMap is a mapping of states to actions (and each action's q-value).

func NewQMap

func NewQMap() *QMap

NewQMap returns a new QMap

func (*QMap) GetActionsForState

func (qq *QMap) GetActionsForState(state iface.Stater) map[string]iface.ActionStatter

GetActionsForState returns the actions associated with a given state.

func (*QMap) GetStats

func (qq *QMap) GetStats(state iface.Stater, action iface.Actioner) (stats iface.ActionStatter, found bool)

GetStats returns the stats for a given state and action. If a the specified action has not been recorded for the given state, the method will return nil, false.

func (*QMap) UpdateStats

func (qq *QMap) UpdateStats(state iface.Stater, action iface.Actioner, stats iface.ActionStatter)

UpdateStats updates the stats of a given state and action.

Jump to

Keyboard shortcuts

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