#391 closed defect (fixed)
Bug in GriddedSubsetSurface's distance X calculation
Reported by: | Kevin Milner | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | OpenSHA 1.3 |
Component: | sha | Version: | |
Keywords: | Cc: |
Description
I noticed an apparent bug in the caching for GriddedSubsetSurface? while investigating #390. DistanceX uses a different cache but the getDistanceX method was being called with the regular cached location, siteLocForDistCalcs, instead of siteLocForDistXCalc. This means that our distance X calculations have potentially been off any time that distance X is calculated before any of the other distance metrics for a given site. Any results since the new surface implementation was added where values for multiple sites were calculated could be affected by this bug.
public synchronized double getDistanceX(Location siteLoc){ if(!siteLocForDistXCalc.equals(siteLoc)) { siteLocForDistXCalc = siteLoc; distanceX = GriddedSurfaceUtils.getDistanceX(getEvenlyDiscritizedUpperEdge(), siteLocForDistCalcs); } return distanceX; }
Change History (2)
comment:1 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
I need to take a look at this. This very thing raised a red flag when I was working on this class many weeks ago. I started to make a change but then realized the implementation was ok, for some reason that I can't remember. That's not to say it doesn't suffer from the multithreading issues in #390
fixed in [8866].