hazardproviders

package
v0.0.0-...-366b2a4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(fp string) (cogHazardProvider, error)

Init creates and produces an unexported cogHazardProvider

func InitDaAHP

func InitDaAHP(durationfp string, arrivalfp string, startTime time.Time) (cogDurationAndArrivalHazardProvider, error)

Init creates and produces an unexported cogHazardProvider

func InitMulti

func InitMulti(hpinfo HazardProviderInfo) (cogMultiHazardProvider, error)

InitMulti creates and produces an unexported cogMultiHazardProvider

func Init_CustomFunction

func Init_CustomFunction(fp string, function HazardFunction) (cogHazardProvider, error)

func Init_Meters

func Init_Meters(fp string) (cogHazardProvider, error)

func Init_Meters_CustomFunction

func Init_Meters_CustomFunction(fp string, function HazardFunction) (cogHazardProvider, error)

Types

type HazardError

type HazardError struct {
	Input string
}

HazardError is an error for a generic hazarderror for the given args

func (HazardError) Error

func (h HazardError) Error() string

Error implements the error interface for HazardError

type HazardFunction

type HazardFunction func(valueIn hazards.HazardData, hazard hazards.HazardEvent) (hazards.HazardEvent, error)

func ArrivalAndDurationHazardFunction

func ArrivalAndDurationHazardFunction() HazardFunction

func DepthHazardFunction

func DepthHazardFunction() HazardFunction

type HazardProvider

type HazardProvider interface {
	Hazard(location geography.Location) (hazards.HazardEvent, error)
	//ProcessedHazard(location geography.Location, process HazardFunction) (hazards.HazardEvent, error)
	HazardBoundary() (geography.BBox, error)
	Close()
}

HazardProvider provides hazards as a return for an argument input

type HazardProviderInfo

type HazardProviderInfo struct {
	Hazards   []HazardProviderParameterAndPath `json:"hazards"`
	StartTime time.Time                        `json:"start_time"`
	EndTime   time.Time                        `json:"end_time"`
}

func (HazardProviderInfo) CreateHazardProvider

func (info HazardProviderInfo) CreateHazardProvider() (HazardProvider, error)

type HazardProviderParameterAndPath

type HazardProviderParameterAndPath struct {
	Hazard   hazards.Parameter `json:"hazard_parameter_type"`
	FilePath string            `json:"hazard_provider_file_path"` //this should get fixed to be able to represent more complex information. e.g. what parameter?
}

type NoDataHazardError

type NoDataHazardError struct {
	Input string
}

NoDataHazardError is an error for a situation where no hazard could be computed for the given args

func (NoDataHazardError) Error

func (h NoDataHazardError) Error() string

Error implements the error interface for NoDataHazardError

type NoFrequencyFoundError

type NoFrequencyFoundError struct {
	Input string
}

NoFrequencyFoundError is an error for a situation where no frequency could be associated for the hazard for the given args

func (NoFrequencyFoundError) Error

func (h NoFrequencyFoundError) Error() string

Error implements the error interface for NoFrequencyFoundError

type NoHazardFoundError

type NoHazardFoundError struct {
	Input string
}

NoHazardFoundError is an error for a situation where no hazard could be computed for the given args

func (NoHazardFoundError) Error

func (h NoHazardFoundError) Error() string

Error implements the error interface for NoHazardFoundError

Jump to

Keyboard shortcuts

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