conf

package
v0.0.0-...-25353bf Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 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 Conf

type Conf struct {
	ServerPort string `yaml:"port"`

	Number string `yaml:"number"`

	Rho         float64 `yaml:"rho"`
	Q           int     `yaml:"q"`
	Round       int     `yaml:"round"`
	Ant         int     `yaml:"ant"`
	UpdateRound int     `yaml:"update_round"`
	Alpha       float64 `yaml:"alpha"`
	Gamma       float64 `yaml:"gamma"` //todo data size   ask neighbor for delay

	PathThreshold int `yaml:"path_threshold"`

	GetNeighborDelayRound int `yaml:"get_neighbor_delay_round"`
	DataSize              int `yaml:"data_size"`

	RequestRelativePath     string `yaml:"request_relative_path"`
	UpdateDelayRelativePath string `yaml:"update_delay_relative_path"`
	ResponseRelativePath    string `yaml:"response_relative_path"`
	UpdateRelativePath      string `yaml:"update_relative_path"`
	UpdateDataPath          string `yaml:"update_data_path"`

	NeighborList map[string]Neighbor `yaml:"neighbor"`

	UpdateList     []UpdateInfo
	PathLog        map[string]int
	PathTotalDelay map[string]float64

	sync.RWMutex
}

func (*Conf) GetConfOrDie

func (c *Conf) GetConfOrDie(path string) *Conf

GetConfOrDie Loading config from local file

func (*Conf) UpdateTau

func (c *Conf) UpdateTau(nodeNum string, newTau float64)

type Neighbor

type Neighbor struct {
	Url       string  `yaml:"url"`       //编号
	Tau       float64 `yaml:"tau"`       //信息素浓度
	Bandwidth int     `yaml:"bandwidth"` //带宽
	Delay     float64 `yaml:"delay"`     //延时
}

type UpdateInfo

type UpdateInfo struct {
	Path     string `json:"path"`
	PathCost string `json:"path_cost"`
}

Jump to

Keyboard shortcuts

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