agent

package
v0.0.0-...-7a8c1c4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	GetId() string
	GetName() string
	IsManual() bool
	GetGameId() int64
	GetGameSeed() int64

	MakeMove(step int, score int, noMove bool, valueList []int) common.Direction
	LogStep(step int, score int, noMove bool, valueList []int, d common.Direction) error

	GameFinished(step int, score int, noMove bool, valueList []int, d common.Direction)
}

func NewAnticlockwiseAgent

func NewAnticlockwiseAgent(gameId int64) Agent

func NewClockwiseAgent

func NewClockwiseAgent(gameId int64) Agent

func NewHumanAgent

func NewHumanAgent(gameId int64) Agent

func NewPoolAgent

func NewPoolAgent(gameId int64) Agent

type AgentAvgRecord

type AgentAvgRecord struct {
	Score int
	Cnt   int
}

type AgentStat

type AgentStat struct {
	Count    int
	Min      AgentStatRecord
	AvgScore float64
	Max      AgentStatRecord
}

type AgentStatRecord

type AgentStatRecord struct {
	Score  int
	Step   int
	GameId int64
}

type AnticlockwiseAgent

type AnticlockwiseAgent struct {
	GenericAgent
	// contains filtered or unexported fields
}

func (*AnticlockwiseAgent) MakeMove

func (a *AnticlockwiseAgent) MakeMove(step int, _ int, noMove bool, _ []int) (direction common.Direction)

type ClockwiseAgent

type ClockwiseAgent struct {
	GenericAgent
	// contains filtered or unexported fields
}

func (*ClockwiseAgent) MakeMove

func (a *ClockwiseAgent) MakeMove(step int, _ int, noMove bool, _ []int) (direction common.Direction)

type GenericAgent

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

func NewGenericAgent

func NewGenericAgent(id string, name string, isManual bool, startGameId int64) GenericAgent

func (*GenericAgent) GameFinished

func (a *GenericAgent) GameFinished(step int, score int, noMove bool, lst []int, d common.Direction)

func (*GenericAgent) GetGameId

func (a *GenericAgent) GetGameId() int64

func (*GenericAgent) GetGameSeed

func (a *GenericAgent) GetGameSeed() int64

func (*GenericAgent) GetId

func (a *GenericAgent) GetId() string

func (*GenericAgent) GetName

func (a *GenericAgent) GetName() string

func (*GenericAgent) IsManual

func (a *GenericAgent) IsManual() bool

func (*GenericAgent) LogStep

func (a *GenericAgent) LogStep(step int, score int, noMove bool, lst []int, d common.Direction) error

type HumanAgent

type HumanAgent struct {
	GenericAgent
	// contains filtered or unexported fields
}

func (*HumanAgent) MakeMove

func (a *HumanAgent) MakeMove(_ int, _ int, _ bool, _ []int) (direction common.Direction)

type PoolAgent

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

PoolAgent Represent a collection of agents which is executed one by one

func (*PoolAgent) GameFinished

func (p *PoolAgent) GameFinished(step int, score int, noMove bool, lst []int, d common.Direction)

func (*PoolAgent) GetGameId

func (p *PoolAgent) GetGameId() int64

func (*PoolAgent) GetGameSeed

func (p *PoolAgent) GetGameSeed() int64

func (*PoolAgent) GetId

func (p *PoolAgent) GetId() string

func (*PoolAgent) GetName

func (p *PoolAgent) GetName() string

func (*PoolAgent) GetStatStr

func (p *PoolAgent) GetStatStr() string

func (*PoolAgent) IsManual

func (p *PoolAgent) IsManual() bool

func (*PoolAgent) LogStep

func (p *PoolAgent) LogStep(step int, score int, noMove bool, lst []int, d common.Direction) error

func (*PoolAgent) MakeMove

func (p *PoolAgent) MakeMove(step int, score int, noMove bool, lst []int) common.Direction

Jump to

Keyboard shortcuts

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