List of usage examples for org.apache.commons.math3.exception NullArgumentException NullArgumentException
public NullArgumentException()
From source file:eu.crisis_economics.configuration.FromFileConfigurationContext.java
@Override public boolean isDeclared(String literalName) { if (literalName == null) throw new NullArgumentException(); return knownNameDeclarations.containsKey(literalName); }
From source file:eu.crisis_economics.abm.simulation.AbsoluteEventOrder.java
private AbsoluteEventOrder( // Privately Constructed final SimulatedEventOrder cycleOrder, int executionDelay) { if (cycleOrder == null) throw new NullArgumentException(); if (executionDelay < 0) throw new IllegalArgumentException( "OrderedEvent: execution delay (value " + executionDelay + ")" + "is non-positive."); this.cycleOrder = cycleOrder; this.delayPeriod = executionDelay; }
From source file:eu.crisis_economics.abm.markets.clearing.heterogeneous.MixedNetworkMarket.java
/** * Add a buy order, as specified by a response function, to the network. *//*w w w . ja v a2 s . c o m*/ public final void addBuyOrder(final Object participant, final String uniqueBuyerID, final MarketResponseFunction responseFunction) { if (responseFunction == null) throw new NullArgumentException(); MixedNetworkMarket.Participant registeredParticipant = new MixedNetworkMarket.Participant(participant, uniqueBuyerID, responseFunction); super.getBuyerParticipants().add(registeredParticipant); }
From source file:eu.crisis_economics.configuration.FromFileConfigurationContext.java
@Override public boolean hasDefinedObject(String literalName) { if (literalName == null) throw new NullArgumentException(); if (!knownDefinitions.containsKey(literalName)) return false; return (knownDefinitions.get(literalName).isPendingUserObjectCreation()); }
From source file:eu.crisis_economics.configuration.FromFileConfigurationContext.java
public boolean hasDefinitionExpression(String literalName) { if (literalName == null) throw new NullArgumentException(); if (!knownDefinitions.containsKey(literalName)) return false; return true;/*ww w .j a v a2 s. c o m*/ }
From source file:eu.crisis_economics.abm.markets.clearing.heterogeneous.MixedNetworkMarket.java
/** * Add a sell order, as specified by a response function, to the network. *//*from w w w .j av a 2s .c om*/ public final void addSellOrder(final Object participant, final String uniqueSellerID, final MarketResponseFunction responseFunction) { if (responseFunction == null) throw new NullArgumentException(); MixedNetworkMarket.Participant registeredParticipant = new MixedNetworkMarket.Participant(participant, uniqueSellerID, responseFunction); super.getSellerParticipants().add(registeredParticipant); }
From source file:eu.crisis_economics.abm.contracts.DepositAccount.java
/** Convert the deposit account to a new deposit holder. */ public final void setDepositHolder(DepositHolder newDepositHolder) { if (newDepositHolder == null) throw new NullArgumentException(); getDepositHolder().removeLiability(this); depositHolder = newDepositHolder;/*from w w w. j ava 2s. c om*/ getDepositHolder().addLiability(this); }
From source file:eu.crisis_economics.abm.markets.clearing.heterogeneous.MixedClearingNetworkNode.java
/** Latch an edge to this node. */ @Override//from w ww . ja va 2 s .c o m public final int connectEdge(SingletonEdge edge) { if (edge == null) throw new NullArgumentException(); edges.add(edge); edgeResponses.add(0.); return (edges.size() - 1); }
From source file:gamlss.utilities.WLSMultipleLinearRegression.java
/** * Loads new y sample data, overriding any previous data. * * @param y the array representing the y sample * @throws NullArgumentException if y is null * @throws NoDataException if y is empty/* w w w . j a v a 2 s. co m*/ */ protected void newYSampleData(ArrayRealVector y) { if (y == null) { throw new NullArgumentException(); } if (y.getDimension() == 0) { throw new NoDataException(); } this.yVector = y; }
From source file:gamlss.utilities.WLSMultipleLinearRegression.java
/** * {@inheritDoc}/* w w w.ja v a 2s .co m*/ * <p>This implementation computes and caches the QR decomposition of the X matrix * once it is successfully loaded.</p> */ protected void newXSampleData(double[][] x, ArrayRealVector w) { if (x == null) { throw new NullArgumentException(); } if (x.length == 0) { throw new NoDataException(); } if (this.isNoIntercept()) { this.xMatrix = new Array2DRowRealMatrix(x, true); } else { // Augment design matrix with initial unitary column final int nVars = x[0].length; final double[][] xAug = new double[x.length][nVars + 1]; for (int i = 0; i < x.length; i++) { if (x[i].length != nVars) { throw new DimensionMismatchException(x[i].length, nVars); } xAug[i][0] = w.getEntry(i); System.arraycopy(x[i], 0, xAug[i], 1, nVars); } this.xMatrix = new Array2DRowRealMatrix(xAug, false); } this.qr = new QRDecomposition(getX()); }