All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bnd.math.domain.rand.CompositeDistribution Maven / Gradle / Ivy

The newest version!
package com.bnd.math.domain.rand;

/** 
 * @author © Peter Banda
 * @since 2013
 */
public class CompositeDistribution extends RandomDistribution {

	static public enum CompositeFunction {
		PLUS, TIMES
	}

	private RandomDistribution distribution1;
	private RandomDistribution distribution2;
	private CompositeFunction function;

	public CompositeDistribution() {
		// no-op
	}

	public CompositeDistribution(
		RandomDistribution distribution1,
		RandomDistribution distribution2,
		CompositeFunction function
	) {
		this.distribution1 = distribution1;
		this.distribution2 = distribution2;
		this.function = function;
	}

	public RandomDistribution getDistribution1() {
		return distribution1;
	}

	public void setDistribution1(RandomDistribution distribution1) {
		this.distribution1 = distribution1;
	}

	public RandomDistribution getDistribution2() {
		return distribution2;
	}

	public void setDistribution2(RandomDistribution distribution2) {
		this.distribution2 = distribution2;
	}

	public CompositeFunction getFunction() {
		return function;
	}

	public void setFunction(CompositeFunction function) {
		this.function = function;
	}

	@Override
	public RandomDistributionType getType() {
		return RandomDistributionType.Composite;
	}

	@Override
	public Class getValueType() {
		return distribution1.getValueType();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy