algorithm

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Alpha   = 1.0 // ResourceScore weight
	Beta    = 0.5 // StorageScore weight
	Gamma   = 0.5 // NetworkScore weight
	Delta   = 1.0 // PriceScore weight
	Epsilon = 1.0 // NodeScore weight
	Zeta    = 0.8 // PodScore weight
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm struct {
}

func NewAlgorithm added in v0.0.7

func NewAlgorithm() *Algorithm

func (*Algorithm) NetworkScore

func (a *Algorithm) NetworkScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64

func (*Algorithm) NodeScore

func (a *Algorithm) NodeScore(node *ultron.WeightedNode) float64

func (*Algorithm) PodScore

func (a *Algorithm) PodScore(pod *ultron.WeightedPod) float64

func (*Algorithm) PriceScore

func (a *Algorithm) PriceScore(node *ultron.WeightedNode) float64

func (*Algorithm) ResourceScore

func (a *Algorithm) ResourceScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64

func (*Algorithm) StorageScore

func (a *Algorithm) StorageScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64

func (*Algorithm) TotalScore

func (a *Algorithm) TotalScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64

type IAlgorithm

type IAlgorithm interface {
	ResourceScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64
	StorageScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64
	NetworkScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64
	PriceScore(node *ultron.WeightedNode) float64
	NodeScore(node *ultron.WeightedNode) float64
	PodScore(pod *ultron.WeightedPod) float64
	TotalScore(node *ultron.WeightedNode, pod *ultron.WeightedPod) float64
}

Jump to

Keyboard shortcuts

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