config

package
Version: v0.0.0-...-6d29b5c Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStub

func CreateStub(entry string)

func CreateTemplate

func CreateTemplate(config *Config)

func NewSimulation

func NewSimulation(config *Config) interfaces.ISimulation

func NewSimulationFromTemplate

func NewSimulationFromTemplate(
	config *Config,
	template interfaces.Node,
) interfaces.ISimulation

func RemoveStub

func RemoveStub()

func RemoveTemplate

func RemoveTemplate()

func RewriteDefault

func RewriteDefault()

func TemplateExists

func TemplateExists() bool

Types

type Config

type Config struct {
	// the language of the entry point and the path of the entry point: file
	// which will be used as main class running in the simulation; entry point
	// format is [go module]/[nodeStructName]
	Lang  string `json:"lang"`
	Entry string `json:"entry"`

	// path to the location of the log.json file
	LogFile string `json:"logFile"`

	// number of peers in the system
	Nodes uint `json:"nodes"`

	Network *NetworkConf `json:"network"`

	// interval of virtual time units at which the capacity scheduler runs
	TransferInterval uint `json:"transferInterval"`

	// list which shows the distribution of node capacities
	CapacityNodes []NodeConf `json:"capacityNodes"`

	// Latency support - when latency support is off, nodes run directly
	Latency bool `json:"latency"`

	// Run the simulator's event queue with support for parallel events.
	Parallel bool `json:"parallel"`
}

func JSONConfig

func JSONConfig(path string) *Config

type NetworkConf

type NetworkConf struct {
	// network level topology parameters
	TransitDomains    uint `json:"transitDomains"`
	TransitDomainSize uint `json:"transitDomainSize"`
	StubDomains       uint `json:"stubDomains"`
	StubDomainSize    uint `json:"stubDomainSize"`
}

type NodeConf

type NodeConf struct {
	Number   uint `json:"number"`
	Upload   uint `json:"upload"`
	Download uint `json:"download"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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