Example usage for org.apache.commons.math3.exception NullArgumentException NullArgumentException

List of usage examples for org.apache.commons.math3.exception NullArgumentException NullArgumentException

Introduction

In this page you can find the example usage for org.apache.commons.math3.exception NullArgumentException NullArgumentException.

Prototype

public NullArgumentException() 

Source Link

Document

Default constructor.

Usage

From source file:eu.crisis_economics.configuration.StringDefinitionExpression.java

/** A name reference. */
private StringDefinitionExpression(String literal, FromFileConfigurationContext interpretationContext) {
    super(null, interpretationContext);
    if (literal == null)
        throw new NullArgumentException();
    definition = literal;//  w w  w.j a v  a 2s  .c o m
}

From source file:de.bund.bfr.math.LinearFunction.java

public LinearFunction(double[] x, double[] y) throws NullArgumentException, NoDataException,
        DimensionMismatchException, NonMonotonicSequenceException {
    if (x == null || y == null) {
        throw new NullArgumentException();
    }//  w w  w.j  a  v a2 s  . co m
    if (x.length == 0 || y.length == 0) {
        throw new NoDataException();
    }
    if (y.length != x.length) {
        throw new DimensionMismatchException(y.length, x.length);
    }
    MathArrays.checkOrder(x);

    abscissa = MathArrays.copyOf(x);
    ordinate = MathArrays.copyOf(y);
}

From source file:eu.crisis_economics.abm.contracts.TwoPartyContract.java

protected final void setFirstSettlmentParty(SettlementParty newSettlmentParty) {
    if (newSettlmentParty == null)
        throw new NullArgumentException();
    this.firstParty = newSettlmentParty;
}

From source file:eu.crisis_economics.abm.markets.clearing.heterogeneous.MixedClearingNetworkNode.java

protected MixedClearingNetworkNode(final Object representedObject,
        final MarketResponseFunction responseFunction, final String uniqueID) {
    if (representedObject == null || responseFunction == null || uniqueID == null)
        throw new NullArgumentException();
    if (uniqueID.isEmpty())
        throw new IllegalArgumentException("HeterogeneousClearingNode: specified ID is an emptry string.");
    this.representedObject = representedObject;
    this.responseFunction = responseFunction;
    this.edges = new ArrayList<SingletonEdge>();
    this.edgeResponses = new ArrayList<Double>();
    this.uniqueID = uniqueID;
}

From source file:eu.crisis_economics.abm.household.plugins.UnemploymentBasedWageAskAlgorithm.java

public UnemploymentBasedWageAskAlgorithm(double initialLabourWage, double wageAdaptationRate,
        double minimumWage, EmploymentProportionCallback employmentProportionCallback) {
    super(initGuard(initialLabourWage));
    if (employmentProportionCallback == null)
        throw new NullArgumentException();
    this.wagePerturbation = wageAdaptationRate * initialLabourWage;
    this.dice = new Random(Simulation.getSimState().random.nextLong());
    this.employmentPropCallback = employmentProportionCallback;
    this.wageConfidence = new CircularFifoBuffer<Double>(5);
    this.minimumWage = minimumWage;
    wageConfidence.add(0.0);//  w  w w. j av  a  2  s . co m
}

From source file:eu.crisis_economics.abm.firm.plugins.UnemploymentBasedWageBidAlgorithm.java

public UnemploymentBasedWageBidAlgorithm(double initialLabourWage, double wageAdaptationRate,
        double minimumWage, EmploymentProportionCallback marketCallback) {
    super(initGuard(initialLabourWage));
    if (marketCallback == null)
        throw new NullArgumentException();
    this.adaptationRate = 1.e-2; // wageAdaptationRate;
    this.minimumWage = minimumWage;
    this.dice = new Random(Simulation.getSimState().random.nextLong());
    this.marketCallback = marketCallback;
}

From source file:eu.crisis_economics.abm.contracts.stocks.StockOwnershipTracker.java

/**
  * Create a dedicated stock ownership tracker. At construction,
  * this class will verify that every StockHolder object indicated
  * in initialStockHolders does own shares in the stock with the 
  * unique name String stockUniqueName.// www.j  a  v a 2s . c om
  * 
  * Upon construction, this class will count the total number of 
  * shares in existence (N). At all times thereafter, N will be 
  * regarded as a constant.
  */
public StockOwnershipTracker(final String stockUniqueName, final double originalTotalNumberOfShares,
        final StockReleaser stockReleaser) {
    if (stockUniqueName == null || stockReleaser == null)
        throw new NullArgumentException();
    this.stockUniqueName = stockUniqueName;
    this.stockReleaser = stockReleaser;
    this.currentStockHolders = new HashMap<String, StockHolder>();
    if (originalTotalNumberOfShares <= 0.)
        throw new IllegalStateException("StockOwnershipTracker: the total number of shares emitted (value "
                + originalTotalNumberOfShares + ") is non-positive.");
}

From source file:eu.crisis_economics.configuration.TypeDeclarationExpression.java

private static List<ConfigurationExpression> initGuard(String literalTypename,
        ConfigurationExpression arraySizeExpression, FromFileConfigurationContext context) {
    if (literalTypename == null || arraySizeExpression == null)
        throw new NullArgumentException();
    if (TypeDeclarationExpression.isExpressionOfType(literalTypename, context) == null)
        throw new IllegalArgumentException(
                "TypeDeclarationExpression: '" + literalTypename + "' is not " + "a type declaration.");
    return Arrays.asList(arraySizeExpression);
}

From source file:eu.crisis_economics.abm.contracts.TwoPartyContract.java

protected final void setSecondSettlementParty(SettlementParty newSettlmentParty) {
    if (newSettlmentParty == null)
        throw new NullArgumentException();
    this.secondParty = newSettlmentParty;
}

From source file:eu.crisis_economics.abm.markets.clearing.heterogeneous.MixedNetworkMarket.java

/**
  * Create a mixed network market./*from   w w w.ja  v  a 2 s. c  om*/
  */
public MixedNetworkMarket(
        final Map<ClearingInstrument, Pair<ResourceExchangeDelegate, SubnetworkClearingMode>> subnetworks) {
    if (subnetworks == null)
        throw new NullArgumentException();
    if (subnetworks.isEmpty())
        throw new IllegalArgumentException("MixedNetworkMarket: no subnetworks were specified.");
    this.subnetworks = subnetworks;
}