api

package
v0.0.0-...-d9ff806 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgParse

ArgParse builds the configs parsed as args to the stochadex binary and also retrieves other args.

func ImplementationsConfigFromStrings

func ImplementationsConfigFromStrings(
	implementationStrings simulator.ImplementationStrings,
) string

ImplementationsConfigFromStrings creates a single string representation of the Implementations config struct out of the simulator.ImplementationStrings.

func RunWithParsedArgs

func RunWithParsedArgs(
	configFile string,
	config *StochadexConfigImplementationsStrings,
	dashboard *DashboardConfig,
)

RunWithParsedArgs takes in the outputs from ArgParse and runs the stochadex with these configurations.

func StartReactApp

func StartReactApp(appLocation string) (*os.Process, error)

StartReactApp starts a react app defined in the appLocation directory.

func StepAndServeWebsocket

func StepAndServeWebsocket(
	settings *simulator.Settings,
	implementations *simulator.Implementations,
	stepDelay time.Duration,
	handle string,
	address string,
)

StepAndServeWebsocket runs a simulation while serving a websocket with the simulator.WebsocketOutputFunction.

func WriteMainProgram

func WriteMainProgram(
	configFile string,
	config *StochadexConfigImplementationsStrings,
	dashboard *DashboardConfig,
) string

WriteMainProgram writes string representations of various types of data to a template /tmp/*main.go file ready for runtime execution in this *main.go.

Types

type DashboardConfig

type DashboardConfig struct {
	Address          string `yaml:"address"`
	Handle           string `yaml:"handle"`
	MillisecondDelay uint64 `yaml:"millisecond_delay"`
	ReactAppLocation string `yaml:"react_app_location"`
	LaunchDashboard  bool   `yaml:"launch_dashboard"`
}

DashboardConfig is a yaml-loadable config for the real-time dashboard.

type SimulationConfigImplementationStrings

type SimulationConfigImplementationStrings struct {
	Implementations simulator.ImplementationStrings `yaml:"implementations"`
}

SimulationConfigImplementationsStrings is the yaml-loadable config which consists of all the necessary config to load a simulation's implementations into templating.

type SimulationConfigSettings

type SimulationConfigSettings struct {
	Settings simulator.Settings `yaml:"settings"`
}

SimulationConfigSettings is the yaml-loadable config which consists of all the necessary config to load a simulation's settings into templating.

type StochadexConfigImplementationsStrings

type StochadexConfigImplementationsStrings struct {
	Simulation          SimulationConfigImplementationStrings              `yaml:"simulation"`
	EmbeddedSimulations []map[string]SimulationConfigImplementationStrings `yaml:"embedded_simulations,omitempty"`
	ExtraVarsByPackage  []map[string][]map[string]string                   `yaml:"extra_vars_by_package,omitempty"`
}

StochadexConfigImplementationsStrings is the yaml-loadable config which consists of all the necessary implementations information to compile a stochadex run binary with templating.

type StochadexConfigSettings

type StochadexConfigSettings struct {
	Simulation          SimulationConfigSettings              `yaml:"simulation"`
	EmbeddedSimulations []map[string]SimulationConfigSettings `yaml:"embedded_simulations,omitempty"`
}

StochadexConfigSettings is the yaml-loadable config which consists of all the necessary settings information to compile a stochadex run binary with templating.

func LoadStochadexConfigSettingsFromYaml

func LoadStochadexConfigSettingsFromYaml(path string) *StochadexConfigSettings

LoadStochadexConfigSettingsFromYaml creates a new StochadexConfigSettings from a provided yaml path.

Jump to

Keyboard shortcuts

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