Documentation ¶
Index ¶
- func ArgParse() (string, *StochadexConfigImplementationsStrings, *DashboardConfig)
- func ImplementationsConfigFromStrings(implementationStrings simulator.ImplementationStrings) string
- func RunWithParsedArgs(configFile string, config *StochadexConfigImplementationsStrings, ...)
- func StartReactApp(appLocation string) (*os.Process, error)
- func StepAndServeWebsocket(settings *simulator.Settings, implementations *simulator.Implementations, ...)
- func WriteMainProgram(configFile string, config *StochadexConfigImplementationsStrings, ...) string
- type DashboardConfig
- type SimulationConfigImplementationStrings
- type SimulationConfigSettings
- type StochadexConfigImplementationsStrings
- type StochadexConfigSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgParse ¶
func ArgParse() ( string, *StochadexConfigImplementationsStrings, *DashboardConfig, )
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 ¶
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 ¶
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.