policy

package
v0.0.0-...-13f8a94 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

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

Policy implements cfr.NodePolicy by keeping a table of accumulated regrets and strategies.

func New

func New(nActions int) *Policy

NewPolicy returns a new Policy for a game node with the given number of actions.

func (*Policy) AddRegret

func (p *Policy) AddRegret(w float32, samplingQ, instantaneousRegrets []float32)

func (*Policy) AddStrategyWeight

func (p *Policy) AddStrategyWeight(w float32)

func (*Policy) CombineData

func (p *Policy) CombineData(np *Policy)

func (*Policy) GetAverageStrategy

func (p *Policy) GetAverageStrategy() []float32

func (*Policy) GetBaseline

func (p *Policy) GetBaseline() []float32

func (*Policy) GetStrategy

func (p *Policy) GetStrategy() []float32

func (*Policy) GetStrategySum

func (p *Policy) GetStrategySum() []float32

func (*Policy) IsEmpty

func (p *Policy) IsEmpty() bool

func (*Policy) MarshalBinary

func (p *Policy) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*Policy) NextStrategy

func (p *Policy) NextStrategy(discountPositiveRegret, discountNegativeRegret, discountstrategySum float32)

func (*Policy) NumActions

func (p *Policy) NumActions() int

func (*Policy) SetStrategy

func (p *Policy) SetStrategy(strat []float32)

func (*Policy) UnmarshalBinary

func (p *Policy) UnmarshalBinary(buf []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (*Policy) UpdateBaseline

func (p *Policy) UpdateBaseline(w float32, action int, value float32)

Jump to

Keyboard shortcuts

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