consequences

package
v0.0.0-...-cd09ded Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

type Inventory struct {
	Inventory []Receptor
}

Inventory provides a struct to allow for a slice of ConcequenceReceptor

type ParameterValue

type ParameterValue struct {
	Value interface{}
}

ParameterValue is a way to allow parameters to be either a scalar or a distribution.

func (ParameterValue) CentralTendency

func (p ParameterValue) CentralTendency() float64

CentralTendency on a ParameterValue is intended to help set structure values content values and foundaiton heights to central tendencies.

func (ParameterValue) SampleValue

func (p ParameterValue) SampleValue(input interface{}) float64

SampleValue on a ParameterValue is intended to help set structure values content values and foundaiton heights to uncertain parameters - this is a first draft of this interaction.

type Receptor

type Receptor interface {
	Compute(event hazards.HazardEvent) (Result, error)
	Location() geography.Location
}

Receptor is an interface for all things that can have consequences from a hazard event

type Result

type Result struct {
	Headers []string      `json:"headers"`
	Result  []interface{} `json:"result"`
}

Result is a container to store a list of headers and a list of results

func (Result) Fetch

func (c Result) Fetch(parameter string) (interface{}, error)

func (Result) MarshalJSON

func (c Result) MarshalJSON() ([]byte, error)

type ResultAddable

type ResultAddable interface {
	AddResult(c Result) //is this too confusing? it works, but is it confusing?
}

ResultAddable gives me the ability to convert the results slice of interface into a table of slice of interface and store many results...

type Results

type Results struct {
	IsTable bool
	Result  `json:"results"`
}

Results stores a consequence struct and a boolean flagging the result as a table or not

func (*Results) AddResult

func (c *Results) AddResult(cr Result)

AddResult fulfils the ConsequenceAddable interface on the Consequences struct

func (Results) MarshalJSON

func (c Results) MarshalJSON() ([]byte, error)

MarshalJSON a better printed version of results - this is my preferred way to print, but it is more complex

type ResultsWriter

type ResultsWriter interface {
	Write(Result)
	Close()
}

type StreamProcessor

type StreamProcessor func(str Receptor)

type StreamProvider

type StreamProvider interface {
	ByFips(fipscode string, sp StreamProcessor)
	ByBbox(bbox geography.BBox, sp StreamProcessor)
}

Jump to

Keyboard shortcuts

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