simulation

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParamChanges

func ParamChanges(r *rand.Rand) []simulation.ParamChange

ParamChanges defines the parameters that can be modified by param change proposals on the simulation

Types

type PriceGenerator

type PriceGenerator struct {
	// contains filtered or unexported fields
}

PriceGenerator allows deterministic price generation in simulations

func NewPriceGenerator

func NewPriceGenerator(startingPrice map[string]sdk.Dec) *PriceGenerator

NewPriceGenerator returns a new market price generator from starting values

func (*PriceGenerator) GetCurrentPrice

func (p *PriceGenerator) GetCurrentPrice(marketID string) sdk.Dec

GetCurrentPrice returns price for last blockHeight set by Step

func (*PriceGenerator) Step

func (p *PriceGenerator) Step(r *rand.Rand, blockHeight int64)

Step walks prices to a current block height from the previously called height noop if called more than once for the same height

Jump to

Keyboard shortcuts

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