Documentation
¶
Index ¶
- Variables
- type BaseStructure
- type DFStore
- type DamageCategory
- type DamageFunction
- type DamageFunctionFamily
- type DamageFunctionFamilyStochastic
- type DamageFunctionStochastic
- type FoundationHeightUncertainty
- type FoundationHeightUncertaintyContainer
- type FoundationUncertainty
- type FoundationUncertaintyContainer
- type FunctionDD
- type IPrototype
- type JsonOccupancyTypeProvider
- type OccupancyTypeDeterministic
- type OccupancyTypeProvider
- type OccupancyTypeStochastic
- type OccupancyTypesContainer
- func (otc *OccupancyTypesContainer) ExtendMap(extension map[string]OccupancyTypeStochastic) error
- func (otc *OccupancyTypesContainer) MergeMap(additionalDFs map[string]OccupancyTypeStochastic) error
- func (otc OccupancyTypesContainer) OcctypeReport() ([]byte, error)
- func (otc *OccupancyTypesContainer) OverrideMap(overrides map[string]OccupancyTypeStochastic) error
- type Ordinate
- type PopulationSet
- type Prototype
- type RawDFStruct
- type StructureDeterministic
- type StructureStochastic
- type Uncertainty
- type UncertaintyOccupancyTypeSampler
Constants ¶
This section is empty.
Variables ¶
var DefaultOcctypeBytes []byte
Functions ¶
This section is empty.
Types ¶
type BaseStructure ¶
BaseStructure represents a Structure name xy location and a damage category
func (BaseStructure) Location ¶
func (s BaseStructure) Location() geography.Location
GetX implements consequences.Locatable
type DamageCategory ¶
type DamageFunction ¶
type DamageFunction struct {
Source string `json:"source"`
DamageDriver hazards.Parameter `json:"damagedriver"`
DamageFunction paireddata.PairedData `json:"damagefunction"`
}
type DamageFunctionFamily ¶
type DamageFunctionFamily struct {
DamageFunctions map[hazards.Parameter]DamageFunction `json:"damagefunctions"` //parameter is a bitflag
}
DamageFunctionFamily is to support a family of damage functions stored by hazard parameter types
func (DamageFunctionFamily) MarshalJSON ¶
func (dff DamageFunctionFamily) MarshalJSON() ([]byte, error)
func (*DamageFunctionFamily) UnmarshalJSON ¶
func (dff *DamageFunctionFamily) UnmarshalJSON(b []byte) error
type DamageFunctionFamilyStochastic ¶
type DamageFunctionFamilyStochastic struct {
DamageFunctions map[hazards.Parameter]DamageFunctionStochastic `json:"damagefunctions"` //parameter is a bitflag
}
DamageFunctionFamilyStochastic is to support a family of damage functions stored by hazard parameter types that can represent uncertain paired data
func (DamageFunctionFamilyStochastic) MarshalJSON ¶
func (dffs DamageFunctionFamilyStochastic) MarshalJSON() ([]byte, error)
func (*DamageFunctionFamilyStochastic) UnmarshalJSON ¶
func (dffs *DamageFunctionFamilyStochastic) UnmarshalJSON(b []byte) error
type DamageFunctionStochastic ¶
type DamageFunctionStochastic struct {
Source string `json:"source"`
DamageDriver hazards.Parameter `json:"damagedriver"`
DamageFunction paireddata.UncertaintyPairedData `json:"damagefunction"`
}
type FoundationHeightUncertainty ¶
type FoundationHeightUncertainty struct {
DefaultDistribution statistics.ContinuousDistribution `json:"default"`
VzoneDistribution statistics.ContinuousDistribution `json:"vzone"`
}
func (*FoundationHeightUncertainty) MarshalJSON ¶
func (fhu *FoundationHeightUncertainty) MarshalJSON() ([]byte, error)
func (FoundationHeightUncertainty) Sample ¶
func (fhu FoundationHeightUncertainty) Sample(firmZone string) statistics.ContinuousDistribution
func (*FoundationHeightUncertainty) UnmarshalJSON ¶
func (fhu *FoundationHeightUncertainty) UnmarshalJSON(data []byte) error
type FoundationHeightUncertaintyContainer ¶
type FoundationHeightUncertaintyContainer struct {
DefaultDistribution statistics.ContinuousDistributionContainer `json:"default"`
VzoneDistribution statistics.ContinuousDistributionContainer `json:"vzone"`
}
type FoundationUncertainty ¶
type FoundationUncertainty struct {
Values map[string]FoundationHeightUncertainty `json:"values"`
}
func InitFoundationUncertainty ¶
func InitFoundationUncertainty() (*FoundationUncertainty, error)
func InitFoundationUncertaintyFromFile ¶
func InitFoundationUncertaintyFromFile(file string) (*FoundationUncertainty, error)
func (*FoundationUncertainty) MarshalJSON ¶
func (fu *FoundationUncertainty) MarshalJSON() ([]byte, error)
func (*FoundationUncertainty) Unmarshal ¶
func (fu *FoundationUncertainty) Unmarshal(b []byte) error
type FoundationUncertaintyContainer ¶
type FoundationUncertaintyContainer struct {
Values map[string]FoundationHeightUncertaintyContainer `json:"values"`
}
type FunctionDD ¶
type IPrototype ¶
type IPrototype interface {
DamageFunction(component string) DamageFunction // component = structure, content, vehicle, etc.
}
Common interface for all damage function providers
type JsonOccupancyTypeProvider ¶
type JsonOccupancyTypeProvider struct {
// contains filtered or unexported fields
}
func (*JsonOccupancyTypeProvider) InitDefault ¶
func (jotp *JsonOccupancyTypeProvider) InitDefault()
func (*JsonOccupancyTypeProvider) InitLocalPath ¶
func (jotp *JsonOccupancyTypeProvider) InitLocalPath(path string)
func (JsonOccupancyTypeProvider) OccupancyTypeMap ¶
func (jotp JsonOccupancyTypeProvider) OccupancyTypeMap() map[string]OccupancyTypeStochastic
func (JsonOccupancyTypeProvider) Write ¶
func (jotp JsonOccupancyTypeProvider) Write(path string) error
type OccupancyTypeDeterministic ¶
type OccupancyTypeDeterministic struct {
Name string `json:"name"`
ComponentDamageFunctions map[string]DamageFunctionFamily `json:"componentdamagefunctions"`
}
OccupancyTypeDeterministic is used to describe an occupancy type without uncertainty in the damage relationships
func (OccupancyTypeDeterministic) GetComponentDamageFunctionForHazard ¶
func (o OccupancyTypeDeterministic) GetComponentDamageFunctionForHazard(component string, h hazards.HazardEvent) (DamageFunction, error)
GetComponentDamageFunctionForHazard provides a hazard specific damage function for a component (e.g. structure, content, car, or other)
type OccupancyTypeProvider ¶
type OccupancyTypeProvider interface {
OccupancyTypeMap() map[string]OccupancyTypeStochastic
Write(outputpath string) error
}
type OccupancyTypeStochastic ¶
type OccupancyTypeStochastic struct {
Name string `json:"name"`
ComponentDamageFunctions map[string]DamageFunctionFamilyStochastic `json:"componentdamagefunctions"`
}
OccupancyTypeStochastic is used to describe an occupancy type with uncertainty in the damage relationships it produces an OccupancyTypeDeterministic through the UncertaintyOccupancyTypeSampler interface
func (OccupancyTypeStochastic) CentralTendency ¶
func (o OccupancyTypeStochastic) CentralTendency() OccupancyTypeDeterministic
CentralTendency implements the UncertaintyOccupancyTypeSampler on the OccupancyTypeStochastic interface.
func (OccupancyTypeStochastic) SampleOccupancyType ¶
func (o OccupancyTypeStochastic) SampleOccupancyType(seed int64) OccupancyTypeDeterministic
SampleOccupancyType implements the UncertaintyOccupancyTypeSampler on the OccupancyTypeStochastic interface.
type OccupancyTypesContainer ¶
type OccupancyTypesContainer struct {
OccupancyTypes map[string]OccupancyTypeStochastic `json:"occupancytypes"`
}
func (*OccupancyTypesContainer) ExtendMap ¶
func (otc *OccupancyTypesContainer) ExtendMap(extension map[string]OccupancyTypeStochastic) error
func (*OccupancyTypesContainer) MergeMap ¶
func (otc *OccupancyTypesContainer) MergeMap(additionalDFs map[string]OccupancyTypeStochastic) error
func (OccupancyTypesContainer) OcctypeReport ¶
func (otc OccupancyTypesContainer) OcctypeReport() ([]byte, error)
func (*OccupancyTypesContainer) OverrideMap ¶
func (otc *OccupancyTypesContainer) OverrideMap(overrides map[string]OccupancyTypeStochastic) error
type PopulationSet ¶
type PopulationSet struct {
Pop2pmo65, Pop2pmu65, Pop2amo65, Pop2amu65 int32
}
type Prototype ¶
type Prototype struct {
Name string `json:"Name"`
Description string `json:"Description"`
DamageCategory DamageCategory `json:"DamageCategory"`
FoundationHeightUncertainty Uncertainty `json:"FoundationHeightUncertainty"`
StructureUncertainty Uncertainty `json:"StructureUncertainty"`
ContentUncertainty Uncertainty `json:"ContentUncertainty"`
OtherUncertainty Uncertainty `json:"OtherUncertainty"`
VehicleUncertainty Uncertainty `json:"VehicleUncertainty"`
StructureDD FunctionDD `json:"StructureDD"`
ContentDD FunctionDD `json:"ContentDD"`
OtherDD FunctionDD `json:"OtherDD"`
VehicleDD FunctionDD `json:"VehicleDD"`
}
Main container that includes all info associated with a structure prototype
type RawDFStruct ¶
type RawDFStruct struct {
OccTypes struct {
Prototypes []Prototype `json:"OccupancyType"`
} `json:"OccTypes"`
}
type StructureDeterministic ¶
type StructureDeterministic struct {
BaseStructure
OccType OccupancyTypeDeterministic
FoundType, FirmZone, ConstructionType string
StructVal, ContVal, FoundHt float64
NumStories int32
PopulationSet
}
StructureDeterministic is a base strucure with a deterministic occupancy type and deterministic parameters
func (StructureDeterministic) Clone ¶
func (s StructureDeterministic) Clone() StructureDeterministic
Compute implements the consequences.Receptor interface on StrucutreDeterminstic
func (StructureDeterministic) Compute ¶
func (s StructureDeterministic) Compute(d hazards.HazardEvent) (consequences.Result, error)
Compute implements the consequences.Receptor interface on StrucutreDeterminstic
type StructureStochastic ¶
type StructureStochastic struct {
BaseStructure
UseUncertainty bool //defaults to false!
OccType OccupancyTypeStochastic
FoundType, FirmZone, ConstructionType string
StructVal, ContVal, FoundHt consequences.ParameterValue
NumStories int32
PopulationSet
}
StructureStochastic is a base structure with an occupancy type stochastic and parameter values for all parameters
func (*StructureStochastic) ApplyFoundationHeightUncertanty ¶
func (f *StructureStochastic) ApplyFoundationHeightUncertanty(fu *FoundationUncertainty)
func (StructureStochastic) Compute ¶
func (s StructureStochastic) Compute(d hazards.HazardEvent) (consequences.Result, error)
Compute implements the consequences.Receptor interface on StrucutreStochastic
func (StructureStochastic) SampleStructure ¶
func (s StructureStochastic) SampleStructure(seed int64) StructureDeterministic
SampleStructure converts a structureStochastic into a structure deterministic based on an input seed
type Uncertainty ¶
type Uncertainty struct {
None struct {
Value string `json:"_value"`
} `json:"None"`
}
type UncertaintyOccupancyTypeSampler ¶
type UncertaintyOccupancyTypeSampler interface {
SampleOccupancyType(rand int64) OccupancyTypeDeterministic
CentralTendencyOccupancyType() OccupancyTypeDeterministic
}
UncertaintyOccupancyTypeSampler provides the pattern for an OccupancyTypeStochastic to produce an OccupancyTypeDeterministic