Skip to content

Commit

Permalink
removed current ruptures counter; it was only used for ui stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbutler committed Nov 22, 2011
1 parent c8f3f88 commit b10ac8f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
30 changes: 1 addition & 29 deletions java/org/opensha/sha/calc/HazardCurveCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public class HazardCurveCalculator extends UnicastRemoteObject implements
private ParameterList adjustableParams;

// misc counting and index variables
protected int currRuptures = -1;
protected int sourceIndex;
protected int numSources;

Expand Down Expand Up @@ -310,8 +309,6 @@ public DiscretizedFuncAPI getHazardCurve(DiscretizedFuncAPI hazFunction,
System.out.println("Haz Curv Calc: magDistCutoffParam.getValue()="
+ magDistCutoffParam.getValue().toString());

this.currRuptures = -1;

/*
* this determines how the calculations are done (doing it the way it's
* outlined in our original SRL paper gives probs greater than 1 if the
Expand Down Expand Up @@ -348,9 +345,6 @@ public DiscretizedFuncAPI getHazardCurve(DiscretizedFuncAPI hazFunction,
// get total number of sources
numSources = eqkRupForecast.getNumSources();

// init the current rupture number (also for progress bar)
currRuptures = 0;

// initialize the hazard function to 1.0
initDiscretizeValues(hazFunction, 1.0);

Expand Down Expand Up @@ -380,8 +374,6 @@ public DiscretizedFuncAPI getHazardCurve(DiscretizedFuncAPI hazFunction,

// apply distance cutoff to source
if (distance > maxDistance) {
currRuptures += source.getNumRuptures(); // update progress bar
// for skipped ruptures
continue;
}

Expand All @@ -404,7 +396,7 @@ public DiscretizedFuncAPI getHazardCurve(DiscretizedFuncAPI hazFunction,
int numRuptures = source.getNumRuptures();

// loop over these ruptures
for (int n = 0; n < numRuptures; n++, ++currRuptures) {
for (int n = 0; n < numRuptures; n++) {

EqkRupture rupture = source.getRupture(n);

Expand Down Expand Up @@ -526,13 +518,9 @@ public DiscretizedFuncAPI getAverageEventSetHazardCurve(
hazCurve = hazFunction.deepClone();
initDiscretizeValues(hazFunction, 0);
int numPts = hazCurve.getNum();
// for progress bar
currRuptures = 0;
// totRuptures=numEventSets;

for (int i = 0; i < numEventSets; i++) {
ArrayList<EqkRupture> events = eqkRupForecast.drawRandomEventSet();
currRuptures += events.size();
getEventSetHazardCurve(hazCurve, site, imr, events, false);
for (int x = 0; x < numPts; x++)
hazFunction.set(x, hazFunction.getY(x) + hazCurve.getY(x));
Expand Down Expand Up @@ -595,10 +583,6 @@ public DiscretizedFuncAPI getEventSetHazardCurve(
imr.setUserMaxDistance(maxDistance);

int totRups = eqkRupList.size();
// progress bar stuff
if (updateCurrRuptures) {
currRuptures = 0;
}

// initialize the hazard function to 1.0 (initial total non-exceedance
// probability)
Expand All @@ -613,9 +597,6 @@ public DiscretizedFuncAPI getEventSetHazardCurve(
// loop over ruptures
for (int n = 0; n < totRups; n++) {

if (updateCurrRuptures)
++currRuptures;

EqkRupture rupture = eqkRupList.get(n);

// set the EqkRup in the IMR
Expand Down Expand Up @@ -702,15 +683,6 @@ public DiscretizedFuncAPI getHazardCurve(DiscretizedFuncAPI hazFunction,
return hazFunction;
}

/**
*
* @returns the current rupture being traversed
* @throws java.rmi.RemoteException
*/
public int getCurrRuptures() throws java.rmi.RemoteException {
return this.currRuptures;
}

/**
* stops the Hazard Curve calculations.
*
Expand Down
3 changes: 0 additions & 3 deletions java/org/opensha/sha/calc/HazardCurveCalculatorAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ public DiscretizedFuncAPI getHazardCurve(DiscretizedFuncAPI hazFunction,
Site site, ScalarIntensityMeasureRelationshipAPI imr,
EqkRupture rupture) throws java.rmi.RemoteException;

// gets the current rupture that is being processed
public int getCurrRuptures() throws java.rmi.RemoteException;

/**
* stops the Hazard Curve calculations.
*
Expand Down

0 comments on commit b10ac8f

Please sign in to comment.