org.opensha.sha.earthquake.griddedForecast
Class GriddedHypoMagFreqDistForecast

java.lang.Object
  extended by org.opensha.sha.earthquake.griddedForecast.GriddedHypoMagFreqDistForecast
All Implemented Interfaces:
Serializable, Comparable<BaseERF>, EventListener, Named, ParameterChangeListener, BaseERF, HypoMagFreqDistAtMultLocsAPI
Direct Known Subclasses:
AfterShockHypoMagFreqDistForecast, GriddedHypoMagFreqDistForecastWrappedERF

public abstract class GriddedHypoMagFreqDistForecast
extends Object
implements BaseERF, HypoMagFreqDistAtMultLocsAPI, ParameterChangeListener

Title: GriddedHypoMagFreqForecast

Description: This constitutes a Poissonian hypocenter forecast. Are locations unique?.

Note : The rate provided by this forecast are always yearly rate.

Version:
1.0
Author:
Nitin Gupta , Edward (Ned) Field, Vipin Gupta
See Also:
Serialized Form

Field Summary
protected  boolean parameterChangeFlag
           
protected  GriddedRegion region
           
 
Fields inherited from interface org.opensha.sha.earthquake.BaseERF
NAME
 
Constructor Summary
GriddedHypoMagFreqDistForecast()
           
 
Method Summary
 int compareTo(BaseERF o)
           
 ParameterList getAdjustableParameterList()
          Returns the adjustable parameters list
 ListIterator getAdjustableParamsIterator()
          Returns the adjustable parameters as the ListIterator
 Region getApplicableRegion()
          Get the region for which this forecast is applicable
 ArrayList<TectonicRegionType> getIncludedTectonicRegionTypes()
          This specifies what types of Tectonic Regions are included in the ERF.
 String getName()
          Return the name for this class
 int getNumHypoLocs()
          getNumHypoLocation
 GriddedRegion getRegion()
          Gets the EvenlyGriddedGeographic Region
 TimeSpan getTimeSpan()
          Allows the user to get the Timespan for this GriddedHypoMagFreqDistForecast
 void parameterChange(ParameterChangeEvent event)
          This is the main function of this interface.
 void setParameter(String name, Object value)
          Loops over all the adjustable parameters and set parameter with the given name to the given value.
 void setRegion(GriddedRegion region)
           
 void setTimeSpan(TimeSpan timeSpan)
          Allows the user to set the Timespan for this GriddedHypoMagFreqDistForecast
 void timeSpanChange(EventObject event)
          Function that must be implemented by all Timespan Listeners for ParameterChangeEvents.
 String updateAndSaveForecast()
          Update and save the serialized forecast into the file
 void updateForecast()
          If any parameter has been changed then update the forecast.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensha.sha.earthquake.griddedForecast.HypoMagFreqDistAtMultLocsAPI
getHypoMagFreqDistAtLoc
 

Field Detail

parameterChangeFlag

protected boolean parameterChangeFlag

region

protected GriddedRegion region
Constructor Detail

GriddedHypoMagFreqDistForecast

public GriddedHypoMagFreqDistForecast()
Method Detail

getRegion

public GriddedRegion getRegion()
Gets the EvenlyGriddedGeographic Region

Returns:
EvenlyGriddedGeographicRegionAPI

setRegion

public void setRegion(GriddedRegion region)

getApplicableRegion

public Region getApplicableRegion()
Get the region for which this forecast is applicable

Specified by:
getApplicableRegion in interface BaseERF
Returns:
: Geographic region object specifying the applicable region of forecast

getAdjustableParameterList

public ParameterList getAdjustableParameterList()
Returns the adjustable parameters list

Specified by:
getAdjustableParameterList in interface BaseERF
Returns:
ParameterList

getAdjustableParamsIterator

public ListIterator getAdjustableParamsIterator()
Returns the adjustable parameters as the ListIterator

Returns:
ListIterator

getName

public String getName()
Return the name for this class

Specified by:
getName in interface Named
Returns:
: return the name for this class

updateAndSaveForecast

public String updateAndSaveForecast()
Update and save the serialized forecast into the file

Specified by:
updateAndSaveForecast in interface BaseERF

getNumHypoLocs

public int getNumHypoLocs()
getNumHypoLocation

Specified by:
getNumHypoLocs in interface HypoMagFreqDistAtMultLocsAPI
Returns:
int

timeSpanChange

public void timeSpanChange(EventObject event)
Function that must be implemented by all Timespan Listeners for ParameterChangeEvents.

Parameters:
event - The Event which triggered this function call

parameterChange

public void parameterChange(ParameterChangeEvent event)
This is the main function of this interface. Any time a control paramater or independent paramater is changed by the user in a GUI this function is called, and a paramater change event is passed in. This sets the flag to indicate that the sources need to be updated

Specified by:
parameterChange in interface ParameterChangeListener
Parameters:
event -

getTimeSpan

public TimeSpan getTimeSpan()
Allows the user to get the Timespan for this GriddedHypoMagFreqDistForecast

Specified by:
getTimeSpan in interface BaseERF
Returns:
TimeSpan

setParameter

public void setParameter(String name,
                         Object value)
Description copied from interface: BaseERF
Loops over all the adjustable parameters and set parameter with the given name to the given value. First checks if the parameter is contained within the ERF adjustable parameter list or TimeSpan adjustable parameters list. If not then IllegalArgumentException is thrown.

Specified by:
setParameter in interface BaseERF
Parameters:
name - String Name of the Adjustable Parameter
value - Object Parameeter Value

setTimeSpan

public void setTimeSpan(TimeSpan timeSpan)
Allows the user to set the Timespan for this GriddedHypoMagFreqDistForecast

Specified by:
setTimeSpan in interface BaseERF
Parameters:
timeSpan - TimeSpan

updateForecast

public void updateForecast()
If any parameter has been changed then update the forecast. NOTE : Not implemented

Specified by:
updateForecast in interface BaseERF

getIncludedTectonicRegionTypes

public ArrayList<TectonicRegionType> getIncludedTectonicRegionTypes()
This specifies what types of Tectonic Regions are included in the ERF. This default implementation includes only ACTIVE_SHALLOW, so it should be overridden in subclasses if other types are used

Specified by:
getIncludedTectonicRegionTypes in interface BaseERF
Returns:
: ArrayList

compareTo

public int compareTo(BaseERF o)
Specified by:
compareTo in interface Comparable<BaseERF>