optstats

package
v0.0.0-...-dff1495 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithConfigCustomStats

func RunWithConfigCustomStats[T any](ctx context.Context, cfg string, simcfg *info.ActionList, gcsl ast.Node, opts simulator.Options, seed int64, cstat NewStatsFuncCustomStats[T], cagg func(T)) (*model.SimulationResult, error)

Runs the simulation with a given parsed config and custom stat collector and aggregator TODO: cfg string should be in the action list instead TODO: need to add a context here to avoid infinite looping

Types

type CollectorCustomStats

type CollectorCustomStats[T any] interface {
	Flush(core *core.Core) T
}

type CustomDamageAggBuffer

type CustomDamageAggBuffer struct {
	ExpectedDps     []float64
	CharExpectedDps [][]float64
}

func NewDamageAggBuffer

func NewDamageAggBuffer(cfg *info.ActionList) CustomDamageAggBuffer

func (*CustomDamageAggBuffer) Add

func (*CustomDamageAggBuffer) Flush

func (agg *CustomDamageAggBuffer) Flush()

type CustomDamageStatsBuffer

type CustomDamageStatsBuffer struct {
	ExpectedDmgCumu []float64
	// contains filtered or unexported fields
}

func (CustomDamageStatsBuffer) Flush

type CustomEnergyAggBuffer

type CustomEnergyAggBuffer struct {
	WeightedER         [][]float64
	ErNeeded           [][]float64
	AdditionalErNeeded [][]float64
}

func NewEnergyAggBuffer

func NewEnergyAggBuffer(cfg *info.ActionList) CustomEnergyAggBuffer

func (*CustomEnergyAggBuffer) Add

func (*CustomEnergyAggBuffer) Flush

func (agg *CustomEnergyAggBuffer) Flush()

type CustomEnergyStatsBuffer

type CustomEnergyStatsBuffer struct {
	ErNeeded   [][]float64
	WeightedER [][]float64
}

func (CustomEnergyStatsBuffer) Flush

type JobCustomStats

type JobCustomStats[T any] struct {
	Cfg     *info.ActionList
	Actions ast.Node
	Seed    int64
	Cstat   NewStatsFuncCustomStats[T]
}

type NewStatsFuncCustomStats

type NewStatsFuncCustomStats[T any] func(core *core.Core) (CollectorCustomStats[T], error)

type PoolCustomStats

type PoolCustomStats[T any] struct {
	QueueCh chan JobCustomStats[T]

	StopCh chan bool
	// contains filtered or unexported fields
}

func WorkerNewWithCustomStats

func WorkerNewWithCustomStats[T any](maxWorker int, respCh chan stats.Result, errCh chan error, customCh chan T) *PoolCustomStats[T]

New creates a new Pool. Jobs can be sent to new pool by sending to p.QueueCh Closing p.StopCh will cause the pool to stop executing any queued jobs and currently working workers will no longer send back responses

Jump to

Keyboard shortcuts

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