/** * {@inheritDoc} */ @Override public long getTimeIDOfLastEvidence() { return this.assignment.getTimeID(); }
/** * Creates a new multinomial dynamic Variable from a given Attribute. * @param att a given {@link Attribute}. * @return a new multinomial {@link Variable} object. */ public Variable newMultinomialDynamicVariable(Attribute att) { return this.newDynamicVariable(att, DistributionTypeEnum.MULTINOMIAL); }
/** * Returns an interface variable given its name. * @param name a {@code String} that represents a valid interface variable name. * @return a {@link Variable} object. */ public Variable getInterfaceVariableByName(String name) { return this.getInterfaceVariable(this.getVariableByName(name)); }
/** * {@inheritDoc} */ @Override public void addDynamicEvidence(DynamicAssignment assignment_) { if (this.sequenceID != -1 && this.sequenceID != assignment_.getSequenceID()) throw new IllegalArgumentException("The sequence ID does not match. If you want to change the sequence, invoke reset method"); if (this.timeID >= assignment_.getTimeID()) throw new IllegalArgumentException("The provided assignment is not posterior to the previous provided assignment."); this.assignment = assignment_; }
/** * Method to set the class variable. Note that it should be multinomial * @param className String with the name of the class variable * @throws WrongConfigurationException is thrown when the variable is not a multinomial. */ public T setClassName(String className) throws WrongConfigurationException { setClassVar(variables.getVariableByName(className)); return (T)this; }
/** * Blocks this DynamicVariables. */ public void block(){ for (int i = 0; i < this.interfaceVariables.size(); i++) { VariableImplementation var = (VariableImplementation)this.interfaceVariables.get(i); var.setVarID(i+this.getNumberOfVars()); } }
/** * Sets a new set of attributes. It links current variables with this new set by matching * variable names with attributes names. * @param attributes an object of class {@link Attributes}. */ public void setAttributes(Attributes attributes){ for (Variable variable : nonInterfaceVariables) { VariableImplementation variableImplementation = (VariableImplementation)variable; variableImplementation.setAttribute(attributes.getAttributeByName(variable.getName())); } for (Variable variable : interfaceVariables) { VariableImplementation variableImplementation = (VariableImplementation)variable; variableImplementation.setAttribute(attributes.getAttributeByName(getVariableFromInterface(variable).getName())); } }
/** * Returns the total number of variables in this DynamicBayesianNetwork. * @return an {@code int} that represents the number of variables. */ public int getNumberOfVars() { return this.getDynamicVariables().getNumberOfVars(); }
public static VariableImplementation newInterfaceVariable(Variable variable){ return new VariableImplementation(variable); }
/** * {@inheritDoc} */ @Override public void addDynamicEvidence(DynamicAssignment assignment_) { if (this.sequenceID!= -1 && this.sequenceID != assignment_.getSequenceID()) throw new IllegalArgumentException("The sequence ID does not match. If you want to change the sequence, invoke reset method"); if (this.timeID>= assignment_.getTimeID()) throw new IllegalArgumentException("The provided assignment is not posterior to the previous provided assignment."); this.assignment = assignment_; }
/** * Creates a new gaussian dynamic Variable from a given Attribute. * @param att a given {@link Attribute}. * @return a new gaussian {@link Variable} object. */ public Variable newGaussianDynamicVariable(Attribute att) { return this.newDynamicVariable(att, DistributionTypeEnum.NORMAL); }
/** * {@inheritDoc} */ @Override public long getTimeIDOfLastEvidence() { return this.assignment.getTimeID(); }
/** * Returns the total number of variables in this DynamicBayesianNetwork. * @return an {@code int} that represents the number of variables. */ public int getNumberOfDynamicVars() { return this.getDynamicVariables().getNumberOfVars(); }
/** * {@inheritDoc} */ @Override public void addDynamicEvidence(DynamicAssignment assignment_) { if (this.sequenceID!= -1 && this.sequenceID != assignment_.getSequenceID()) throw new IllegalArgumentException("The sequence ID does not match. If you want to change the sequence, invoke reset method"); if (this.timeID>= assignment_.getTimeID()) throw new IllegalArgumentException("The provided assignment is not posterior to the previous provided assignment."); this.assignment = assignment_; }
/** * Creates a new multionomial dynamic Variable from a given name and a list of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param states a {@code List} of {@code String} that represents the different states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialDynamicVariable(String name, List<String> states) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL, new FiniteStateSpace(states)); }
/** * {@inheritDoc} */ @Override public long getTimeIDOfLastEvidence(){ return this.assignment.getTimeID(); }
/** * Creates a new gaussian dynamic Variable from a given Attribute. * @param name a given {@code String} that represents the name of the dynamic variable. * @return a new gaussian {@link Variable} object. */ public Variable newGaussianDynamicVariable(String name) { return this.newDynamicVariable(name, DistributionTypeEnum.NORMAL, new RealStateSpace()); }
/** * Creates a new multionomial logistic dynamic Variable from a given name and number of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param nOfStates an {@code int} that represents the number of states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialLogisticDynamicVariable(String name, int nOfStates) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL_LOGISTIC, new FiniteStateSpace(nOfStates)); }
/** * Creates a new multionomial dynamic Variable from a given name and number of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param nOfStates an {@code int} that represents the number of states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialDynamicVariable(String name, int nOfStates) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL, new FiniteStateSpace(nOfStates)); }
/** * Creates a new multionomial logistic dynamic Variable from a given name and a list of states. * @param name a {@code String} that represents the name of the dynamic variable. * @param states a {@code List} of {@code String} that represents the different states of the dynamic variable. * @return a {@link Variable} object. */ public Variable newMultinomialLogisticDynamicVariable(String name, List<String> states) { return this.newDynamicVariable(name, DistributionTypeEnum.MULTINOMIAL_LOGISTIC, new FiniteStateSpace(states)); }