Documentation
¶
Index ¶
- Constants
- func LoadCortex(cortexId string, db couch.Database) *ng.Cortex
- type Agent
- type AgentJson
- type Checkerlution
- func (c Checkerlution) Cortex() *ng.Cortex
- func (c *Checkerlution) CreateActuator() *ng.Actuator
- func (c *Checkerlution) CreateHiddenLayer1Neurons(outputNeuron *ng.Neuron) []*ng.Neuron
- func (c *Checkerlution) CreateHiddenLayer2Neurons(layer1Neurons []*ng.Neuron, outputNeuron *ng.Neuron) []*ng.Neuron
- func (c *Checkerlution) CreateNeurgoCortex()
- func (c *Checkerlution) CreateOutputNeuron() *ng.Neuron
- func (c *Checkerlution) CreateSensors()
- func (c *Checkerlution) GameFinished(gameState cbot.GameState) (shouldQuit bool)
- func (c *Checkerlution) LoadNeurgoCortex(filename string)
- func (c *Checkerlution) SetMode(mode OperationMode)
- func (c *Checkerlution) Start(ourTeamId cbot.TeamType)
- func (c *Checkerlution) StartWithCortex(cortex *ng.Cortex, ourTeamId cbot.TeamType)
- func (c Checkerlution) Stop()
- func (c *Checkerlution) Think(gameState cbot.GameState) (bestMove cbot.ValidMove, ok bool)
- type CheckerlutionFlags
- type CheckerlutionRecorder
- func (r *CheckerlutionRecorder) AddFitnessScore(score float64, cortex *ng.Cortex, opponent *ng.Cortex)
- func (r *CheckerlutionRecorder) AddGeneration(evaldCortexes []nv.EvaluatedCortex)
- func (r CheckerlutionRecorder) GetLatestGenerationCortexes() []*ng.Cortex
- func (r *CheckerlutionRecorder) InitDbConnection()
- func (r *CheckerlutionRecorder) Save()
- func (r *CheckerlutionRecorder) SaveCortex(cortex *ng.Cortex)
- type CheckerlutionScape
- func (scape *CheckerlutionScape) Fitness(cortex *ng.Cortex) (fitness float64)
- func (scape *CheckerlutionScape) FitnessAgainst(cortex *ng.Cortex, opponentCortex *ng.Cortex) (fitness float64)
- func (scape *CheckerlutionScape) SetFeedType(feedType cbot.FeedType)
- func (scape *CheckerlutionScape) SetRandomDelayBeforeMove(delay int)
- func (scape *CheckerlutionScape) SetSyncGatewayUrl(syncGatewayUrl string)
- func (scape *CheckerlutionScape) SetTeam(team cbot.TeamType)
- type CheckerlutionTrainer
- type Game
- type GameJson
- type GameStateVector
- type Generation
- type GenerationJson
- type OperationMode
- type Population
- func (population *Population) AddGeneration(generation Generation)
- func (population Population) CurrentGeneration() *Generation
- func (population Population) CurrentGenerationNumber() int
- func (population Population) MarshalJSON() ([]byte, error)
- func (population Population) NextGenerationNumber() int
- func (population *Population) UnmarshalJSON(data []byte) error
- type PopulationJson
- type ValidMoveCortexInput
Constants ¶
View Source
const ( RUNNING_MODE = iota TRAINING_MODE )
View Source
const EMPTY_SQUARE = 0.0
View Source
const OPPONENT_KING = -1.0
View Source
const OPPONENT_PIECE = -0.7
View Source
const OUR_KING = 1.0
View Source
const OUR_PIECE = 0.7
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (Agent) MarshalJSON ¶
func (*Agent) UnmarshalJSON ¶
type Checkerlution ¶
type Checkerlution struct {
// contains filtered or unexported fields
}
func (Checkerlution) Cortex ¶
func (c Checkerlution) Cortex() *ng.Cortex
func (*Checkerlution) CreateActuator ¶
func (c *Checkerlution) CreateActuator() *ng.Actuator
func (*Checkerlution) CreateHiddenLayer1Neurons ¶
func (c *Checkerlution) CreateHiddenLayer1Neurons(outputNeuron *ng.Neuron) []*ng.Neuron
func (*Checkerlution) CreateHiddenLayer2Neurons ¶
func (*Checkerlution) CreateNeurgoCortex ¶
func (c *Checkerlution) CreateNeurgoCortex()
func (*Checkerlution) CreateOutputNeuron ¶
func (c *Checkerlution) CreateOutputNeuron() *ng.Neuron
func (*Checkerlution) CreateSensors ¶
func (c *Checkerlution) CreateSensors()
func (*Checkerlution) GameFinished ¶
func (c *Checkerlution) GameFinished(gameState cbot.GameState) (shouldQuit bool)
func (*Checkerlution) LoadNeurgoCortex ¶
func (c *Checkerlution) LoadNeurgoCortex(filename string)
func (*Checkerlution) SetMode ¶
func (c *Checkerlution) SetMode(mode OperationMode)
func (*Checkerlution) Start ¶
func (c *Checkerlution) Start(ourTeamId cbot.TeamType)
func (*Checkerlution) StartWithCortex ¶
func (c *Checkerlution) StartWithCortex(cortex *ng.Cortex, ourTeamId cbot.TeamType)
func (Checkerlution) Stop ¶
func (c Checkerlution) Stop()
type CheckerlutionFlags ¶
type CheckerlutionFlags struct {
CheckersBotFlags cbot.CheckersBotFlags
PopulationName string
}
type CheckerlutionRecorder ¶
type CheckerlutionRecorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶
func NewRecorder(syncGatewayUrl string, populationName string) *CheckerlutionRecorder
This assumes the population does not already exist in the database and so it will create it
func (*CheckerlutionRecorder) AddFitnessScore ¶
func (*CheckerlutionRecorder) AddGeneration ¶
func (r *CheckerlutionRecorder) AddGeneration(evaldCortexes []nv.EvaluatedCortex)
func (CheckerlutionRecorder) GetLatestGenerationCortexes ¶
func (r CheckerlutionRecorder) GetLatestGenerationCortexes() []*ng.Cortex
func (*CheckerlutionRecorder) InitDbConnection ¶
func (r *CheckerlutionRecorder) InitDbConnection()
func (*CheckerlutionRecorder) Save ¶
func (r *CheckerlutionRecorder) Save()
func (*CheckerlutionRecorder) SaveCortex ¶
func (r *CheckerlutionRecorder) SaveCortex(cortex *ng.Cortex)
type CheckerlutionScape ¶
type CheckerlutionScape struct {
// contains filtered or unexported fields
}
func (*CheckerlutionScape) Fitness ¶
func (scape *CheckerlutionScape) Fitness(cortex *ng.Cortex) (fitness float64)
func (*CheckerlutionScape) FitnessAgainst ¶
func (*CheckerlutionScape) SetFeedType ¶
func (scape *CheckerlutionScape) SetFeedType(feedType cbot.FeedType)
func (*CheckerlutionScape) SetRandomDelayBeforeMove ¶
func (scape *CheckerlutionScape) SetRandomDelayBeforeMove(delay int)
func (*CheckerlutionScape) SetSyncGatewayUrl ¶
func (scape *CheckerlutionScape) SetSyncGatewayUrl(syncGatewayUrl string)
func (*CheckerlutionScape) SetTeam ¶
func (scape *CheckerlutionScape) SetTeam(team cbot.TeamType)
type CheckerlutionTrainer ¶
type CheckerlutionTrainer struct{}
func (*CheckerlutionTrainer) RunPopulationTrainer ¶
func (trainer *CheckerlutionTrainer) RunPopulationTrainer(checkerlutionFlags CheckerlutionFlags)
func (*CheckerlutionTrainer) RunTopologyMutatingTrainer ¶
func (trainer *CheckerlutionTrainer) RunTopologyMutatingTrainer(checkersBotFlags cbot.CheckersBotFlags)
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (Game) MarshalJSON ¶
func (*Game) UnmarshalJSON ¶
type GameStateVector ¶
type GameStateVector []float64
game state array with 32 elements, possible values: OPPONENT_KING OPPONENT_PIECE EMPTY_SQUARE OUR_PIECE OUR_KING
func NewGameStateVector ¶
func NewGameStateVector() GameStateVector
type Generation ¶
type Generation struct {
// contains filtered or unexported fields
}
func NewGeneration ¶
func NewGeneration(number int, agents []Agent) *Generation
func (*Generation) AddGame ¶
func (generation *Generation) AddGame(game Game)
func (Generation) MarshalJSON ¶
func (generation Generation) MarshalJSON() ([]byte, error)
func (*Generation) UnmarshalJSON ¶
func (generation *Generation) UnmarshalJSON(data []byte) error
type GenerationJson ¶
type OperationMode ¶
type OperationMode int
type Population ¶
type Population struct {
// contains filtered or unexported fields
}
func (*Population) AddGeneration ¶
func (population *Population) AddGeneration(generation Generation)
func (Population) CurrentGeneration ¶
func (population Population) CurrentGeneration() *Generation
func (Population) CurrentGenerationNumber ¶
func (population Population) CurrentGenerationNumber() int
func (Population) MarshalJSON ¶
func (population Population) MarshalJSON() ([]byte, error)
func (Population) NextGenerationNumber ¶
func (population Population) NextGenerationNumber() int
func (*Population) UnmarshalJSON ¶
func (population *Population) UnmarshalJSON(data []byte) error
type PopulationJson ¶
type PopulationJson struct {
Name string
Rev string `json:"_rev"`
Generations []Generation
}
hack to be able to go back and forth from json
type ValidMoveCortexInput ¶
type ValidMoveCortexInput struct {
// contains filtered or unexported fields
}
func NewValidMoveCortexInput ¶
func NewValidMoveCortexInput(validMove cbot.ValidMove, piece cbot.Piece) ValidMoveCortexInput
func (ValidMoveCortexInput) Equals ¶
func (move ValidMoveCortexInput) Equals(other ValidMoveCortexInput) bool
func (ValidMoveCortexInput) VectorRepresentation ¶
func (move ValidMoveCortexInput) VectorRepresentation() []float64
Source Files
¶
Click to show internal directories.
Click to hide internal directories.

