types

package
v0.0.0-...-e1d4e1a Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 3 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CHM

type CHM interface {
	Name() string
	Threshold(int) float64
	Initialise(int, float64)
	Update(int, float64)
	Violation(int, Fitness) float64
}

type CHMMethod

type CHMMethod int
const (
	//Epsilon method uses normal epsilon
	Epsilon CHMMethod = iota + 1
	//ImprovedEpsilon uses the improved epsilon constraint handling method
	ImprovedEpsilon
	//R2S uses the Reduces Search Space method to handle constraints
	R2S
)

type Cmop

type Cmop struct {
	ObjectiveCount, ConstraintCount, DecisionVariables int
	ConstraintTypes                                    []ConstraintType
	DecisionInterval                                   [][]float64
	Evaluate                                           func(Genotype) Fitness
	Name, TrueParetoFrontFilename                      string
	// contains filtered or unexported fields
}

Cmop is a interface describing a multi objective optimisation problem

func (*Cmop) TrueParetoFront

func (c *Cmop) TrueParetoFront() [][]float64

TrueParetoFront returns the true paretofront in the form of a 2d array. If no datafile for the pareto front is available, the function will return nil.

type ConstraintType

type ConstraintType int

// CMOP is a interface describing a multi objective optimisation problem

type CMOP interface {
	NumberOfObjectives() int
	NumberOfConstraints() int
	Name() string
	Calculate(Genotype) Fitness
}

ConstraintType describes which type of constraint it is. Either a equals-or-less-than or equals-or-greater-than constraint.

const (
	//EqualsOrLessThanZero the constraint is a less-than-or-equals-zero constraint
	EqualsOrLessThanZero ConstraintType = iota + 1
	//EqualsOrGreaterThanZero the constraint is a less-than-or-greater-zero constraint
	EqualsOrGreaterThanZero ConstraintType = iota + 1
)

type Fitness

type Fitness struct {
	ObjectiveCount, ConstraintCount   int
	ObjectiveValues, ConstraintValues []float64
	ConstraintTypes                   []ConstraintType
}

func (Fitness) Feasible

func (f Fitness) Feasible() bool

Feasible returns true if an individual is feasible or false if it's infeasible, according to it's constraint values.

func (Fitness) TotalViolation

func (f Fitness) TotalViolation() (total float64)

TotalViolation returns the total constraint violation of all constraints.

func (Fitness) Violation

func (f Fitness) Violation(c int) float64

Violation returns the violation of a constraint at position c.

type Genotype

type Genotype []float64

type Individual

type Individual interface {
	Genotype() Genotype //TODO: se på måter å gjøre dette mer generelt senere
	Fitness() Fitness
	UpdateFitness() Fitness
	Copy() Individual
	Initialise()
}

Individual is an interface describing an individual in a population

type MOEA

type MOEA interface {
	MaxFuncEvals() int
	MaxViolation() float64
	Population() []Individual
	Initialise()
	FunctionEvaluations() int
	FeasibleRatio() float64
	Archive() []Individual
	Evolve(Stage)
	CHM() CHM
}

MOEA is an interface describing Multi Objective Evolutionary Algorithms

type Stage

type Stage interface {
	Name() string
	Type() StageType //TODO Fix this in the structs
	SetOver()
	IsOver() bool
}

Stage interface defines all the menthods needed to be a stage. Might be overkill to have this as an interface and not a single struct

type StageType

type StageType int
const (
	// Push PPS is in the push stage and constraints are ignored
	Push StageType = iota
	// BinarySearch PPS is a the stage between Push and Pull
	BinarySearch

	//Pull PPS is in the pull stage and constraints are handled
	Pull
)

type TestSuite

type TestSuite struct {
	NumberOfProblems int
	Problems         []Cmop
	Name             string
}

TestSuite is a struct containing a set of CMOPs.

func (TestSuite) SingleProblem

func (ts TestSuite) SingleProblem(n int) TestSuite

Jump to

Keyboard shortcuts

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