simulator

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CryptoRandSeed added in v1.2.2

func CryptoRandSeed() int64

cryptoRandSeed generates a random seed using crypo rand

func GenerateCharacterDetails added in v1.2.2

func GenerateCharacterDetails(cfg *ast.ActionList) ([]simulation.CharacterDetail, error)

func GenerateDebugLog

func GenerateDebugLog(cfg *ast.ActionList) ([]map[string]interface{}, error)

GenerateDebugLog will run one simulation with debug enabled using a random seed

func GenerateDebugLogWithSeed

func GenerateDebugLogWithSeed(cfg *ast.ActionList, seed int64) ([]map[string]interface{}, error)

GenerateDebugLogWithSeed will run one simulation with debug enabled using the given seed and output the debug log. Used for generating debug for min/max runs

func GenerateResult added in v1.2.2

func GenerateResult(cfg string, simcfg *ast.ActionList, stats *agg.Result, opts Options) (result.Summary, error)

func ReadConfig

func ReadConfig(fpath string) (string, error)

readConfig will load and read the config at specified path. Will resolve any import statements as well

func Run

func Run(opts Options) (result.Summary, error)

Run will run the simulation given number of times

func RunWithConfig

func RunWithConfig(cfg string, simcfg *ast.ActionList, opts Options) (result.Summary, error)

Runs the simulation with a given parsed config

Types

type Options

type Options struct {
	ResultSaveToPath string // file name (excluding ext) to save the result file; if "" then nothing is saved to file
	GZIPResult       bool   // should the result file be gzipped; only if ResultSaveToPath is not ""
	ConfigPath       string // path to the config file to read
	Version          string
	BuildDate        string
	DebugMinMax      bool // whether to additional include debug logs for min/max-DPS runs
}

Options sets out the settings to run the sim by (such as debug mode, etc..)

Jump to

Keyboard shortcuts

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