Example #1
0
  public double getNextValueForTime(double time) {

    if (!Double.isNaN(dVal)) currentValue = dVal;

    if (monthVal != null) currentValue = monthVal.get(Clock.getMonthIndex(time));

    if (probVal != null) currentValue = probVal.nextValue();

    if (monthProbVal != null)
      currentValue = monthProbVal.get(Clock.getMonthIndex(time)).nextValue();

    return currentValue;
  }
Example #2
0
  public double getExpectedValueForTime(double time) {
    if (!Double.isNaN(dVal)) return currentValue;

    if (monthVal != null) return currentValue;

    if (probVal != null) return probVal.getExpectedValue();
    return monthProbVal.get(Clock.getMonthIndex(time)).getExpectedValue();
  }
Example #3
0
  public void initialize() {

    if (probVal != null) {
      probVal.initialize();
    }
    if (monthProbVal != null) {
      for (ProbabilityDistribution each : monthProbVal) {
        each.initialize();
      }
    }

    // Initialize the current value
    if (!Double.isNaN(dVal)) currentValue = dVal;

    if (monthVal != null) currentValue = monthVal.get(Clock.getMonthIndex(0));

    if (probVal != null) currentValue = probVal.getExpectedValue();
  }