Skip to content

Feature/coastal multi frequency - #139

Open
sebastianrowan wants to merge 3 commits into
USACE:feature/coastal-multi-frequencyfrom
sebastianrowan:feature/coastal-multi-frequency
Open

Feature/coastal multi frequency#139
sebastianrowan wants to merge 3 commits into
USACE:feature/coastal-multi-frequencyfrom
sebastianrowan:feature/coastal-multi-frequency

Conversation

@sebastianrowan

Copy link
Copy Markdown
Contributor

@HenryGeorgist two patterns here for implementing multi-frequency hazard. The coastal version here puts the frequency on the individual CoastalEvents and accesses the values through a Frequency() method. The version on the DepthEvent stores the frequencies as a slice in the MultiFrequencyDepth event.

Preference?

@HenryGeorgist HenryGeorgist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create an interface called "FrequencyEvent" that has the methods for Frequency and SetFreqeuncy.

then we can have the same behavoir on any event as long as a hazard provider provides it. i like the pattern

Comment thread hazards/coastal.go
func (h CoastalFrequencyEvent) DV() float64 {
return -901.0
}
func (h CoastalFrequencyEvent) Frequency() float64 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm. this is interesting. have you thought through how that works with a hazard provider?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hazard provider itself does not deal with the frequency. The hazard provider would provide a MultiFrequencyEvent which implements the HazardEvent interface (per your suggestion above it the MultiFrequencyEvent would implement the FrequencyEvent which would itself implement the HazardEvent).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants