Class LogNormalDistributionParameter

java.lang.Object
it.univr.di.cstnu.util.LogNormalDistributionParameter
All Implemented Interfaces:
Serializable

public class LogNormalDistributionParameter extends Object implements Serializable
Log-normal distribution. Initially created inside the PSTN class, then extracted to allow the compilation of the package without the PSTN class.
See Also:
  • Constructor Details

    • LogNormalDistributionParameter

      public LogNormalDistributionParameter(double location, double scale, int shift)
      Parameters:
      location - Considering the associated normal distribution, this is the mean μ of the normal distribution.
      scale - Considering the associated normal distribution, this is the standard deviation σ of the normal distribution.
      shift - It is possible that a rigid distance shifts the activation time point. In such a case, the log-normal distribution of the contingent link is the same, but the sample values must be simply added to the shift to have the right value. It would be possible to adjust the location and scale of the log-normal distribution to incorporate such a shift. Still, we verified that such an adjustment introduces some approximation errors. Be careful: if the original PDF was for the contingent link 'X--v--> A===>C' and A was moved to X, the range of the contingent link is increased by v. The shift is 'v', not (-v). Shift can only be positive.
    • LogNormalDistributionParameter

      public LogNormalDistributionParameter(double location, double scale)
      Parameters:
      location - Considering the associated normal distribution, this is the mean μ of the normal distribution.
      scale - Considering the associated normal distribution, this is the standard deviation σ of the normal distribution.
  • Method Details

    • parse

      public static LogNormalDistributionParameter parse(String input)
      Parameters:
      input - a toString() representation of a LogNormalDistributionParameter object. Format is "LogNormalDistributionParameter[location=%f, scale=%f, shift=%d]"
      Returns:
      the LogNormalDistributionParameter object represented in the input, null otherwise.
    • cumulativeProbability

      public double cumulativeProbability(double x)
      Parameters:
      x - value in the domain (it will be compensated by '-shift')
      Returns:
      the cumulative probability at x.
    • getLocation

      public double getLocation()
      Returns:
      location
    • getLogNormalDistribution

      public org.apache.commons.math3.distribution.LogNormalDistribution getLogNormalDistribution()
      Returns:
      the associated PDF
    • getScale

      public double getScale()
      Returns:
      the scale
    • getShift

      public int getShift()
      Returns:
      the shift
    • setShift

      public void setShift(int shift)
      Registers shift.
      Parameters:
      shift - the shift of the location parameter.
    • sample

      public double sample()
      Returns:
      a random value sampled by the current log-normal distribution adjusted by the shift value.
    • toString

      public String toString()
      Overrides:
      toString in class Object