Documentation
¶
Overview ¶
Package pole2 provides definition of the two pole balancing experiment. In this experiment we will try to teach RF model of balancing of two poles placed on the moving cart.
Index ¶
- func EvaluateOrganismGeneralization(species []*genetics.Species, cartPole *CartDoublePole, actionType ActionType) (*genetics.Organism, error)
- func NewCartDoublePoleGenerationEvaluator(outDir string, markov bool, actionType ActionType) experiment.GenerationEvaluator
- func NewCartDoublePoleParallelGenerationEvaluator(outDir string, markov bool, actionType ActionType) experiment.GenerationEvaluator
- func OrganismEvaluate(organism *genetics.Organism, cartPole *CartDoublePole, actionType ActionType) (winner bool, err error)
- type ActionType
- type CartDoublePole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateOrganismGeneralization ¶
func EvaluateOrganismGeneralization(species []*genetics.Species, cartPole *CartDoublePole, actionType ActionType) (*genetics.Organism, error)
EvaluateOrganismGeneralization The best individual (i.e. the one with the highest fitness value) of every generation is tested for its ability to balance the system for a longer time period. If a potential solution passes this test by keeping the system balanced for 100’000 time steps, the so-called generalization score(GS) of this particular individual is calculated. This score measures the potential of a controller to balance the system starting from different initial conditions. It's calculated with a series of experiments, running over 1000 time steps, starting from 625 different initial conditions. The initial conditions are chosen by assigning each value of the set Ω = [0.05 0.25 0.5 0.75 0.95] to each of the states x, ∆x/∆t, θ1 and ∆θ1/∆t, scaled to the range of the variables.The short pole angle θ2 and its angular velocity ∆θ2/∆t are set to zero. The GS is then defined as the number of successful runs from the 625 initial conditions and an individual is defined as a solution if it reaches a generalization score of 200 or more.
func NewCartDoublePoleGenerationEvaluator ¶
func NewCartDoublePoleGenerationEvaluator(outDir string, markov bool, actionType ActionType) experiment.GenerationEvaluator
NewCartDoublePoleGenerationEvaluator is the generations evaluator for double-pole balancing experiment: both Markov and non-Markov versions
func NewCartDoublePoleParallelGenerationEvaluator ¶
func NewCartDoublePoleParallelGenerationEvaluator(outDir string, markov bool, actionType ActionType) experiment.GenerationEvaluator
NewCartDoublePoleParallelGenerationEvaluator is the generations evaluator for double-pole balancing experiment: both Markov and non-Markov versions
func OrganismEvaluate ¶
func OrganismEvaluate(organism *genetics.Organism, cartPole *CartDoublePole, actionType ActionType) (winner bool, err error)
OrganismEvaluate method evaluates fitness of the organism for cart double pole-balancing task
Types ¶
type ActionType ¶
type ActionType byte
ActionType The type of action to be applied to environment
const ( // ContinuousAction The continuous action type meaning continuous values to be applied to environment ContinuousAction ActionType = iota // DiscreteAction The discrete action assumes that there are only discrete values of action (e.g. 0, 1) DiscreteAction )
The supported action types
type CartDoublePole ¶
type CartDoublePole struct {
// contains filtered or unexported fields
}
CartDoublePole The structure to describe cart pole emulation
func NewCartPole ¶
func NewCartPole(markov bool) *CartDoublePole
NewCartPole If markov is false, then velocity information will be withheld from the network population (non-Markov)