aco

package
v0.0.0-...-3660825 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ant

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

Ant : the ant agent

func NewAnt

func NewAnt(graph *g.Graph, alpha, beta uint) *Ant

NewAnt : create a new ant

func (*Ant) Evaluate

func (a *Ant) Evaluate() float64

Evaluate : get the score of the tour (it's distance)

func (*Ant) GetTour

func (a *Ant) GetTour() []*g.Vertex

GetTour : returns the array of visited vertices

func (*Ant) IsTravelFinished

func (a *Ant) IsTravelFinished() bool

IsTravelFinished : Tells wether the ant visited the whole graph or not

func (*Ant) Travel

func (a *Ant) Travel()

Travel : Make the ant travel to the next vertex on the graph

type TSP

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

TSP : the TSP problem solver using AS algorithm

func NewTSP

func NewTSP(graph *g.Graph, alpha, beta, ants, generations uint, evaporationRate float64) *TSP

NewTSP : create a new TSP problem solver

func (*TSP) Run

func (tsp *TSP) Run() *Ant

Run : start the TSP solving with the given parameters

Jump to

Keyboard shortcuts

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