/** * Removes the i-th {@link Species} of the {@link Model}. * * @param i * @return the removed element. */ public Species removeSpecies(int i) { return getListOfSpecies().remove(i); }
/** * Removes a species from the model. * * @param spec * @return {@code true} if the {@link Species} was found and removed. */ public boolean removeSpecies(Species spec) { return getListOfSpecies().remove(spec); }
setListOfSpecies(model.getListOfSpecies().clone());
/** * Adds a Species instance to the listOfSpecies of this Model. * * @param spec * @return {@code true} if the {@link #listOfSpecies} was changed as a * result of this call. */ public boolean addSpecies(Species spec) { return getListOfSpecies().add(spec); }
/** * Gets the n-th {@link Species} object in this Model. * * @param n the index of the element to return * @return the {@link Species} with the given index if it exists, * {@code null} otherwise. */ public Species getSpecies(int n) { return getListOfSpecies().get(n); }
/** * Returns the number of {@link Species} whose boundary condition is set to * {@code true}. * * @return the number of {@link Species} whose boundary condition is set to * {@code true}. */ public int getSpeciesWithBoundaryConditionCount() { return isSetListOfSpecies() ? getListOfSpecies().filterList(new BoundaryConditionFilter()).size() : 0; }
@Override public boolean check(ValidationContext ctx, Model m) { if (m.isSetListOfSpecies() || m.isListOfSpeciesEmpty()) { return new UnknownAttributeValidationFunction<TreeNodeWithChangeSupport>().check(ctx, m.getListOfSpecies()); } return true; } };
@Override public boolean check(ValidationContext ctx, Model m) { if (m.isSetListOfSpecies() || m.isListOfSpeciesEmpty()) { return new UnknownElementValidationFunction<TreeNodeWithChangeSupport>().check(ctx, m.getListOfSpecies()); } return true; } };
for (Species species : model.getListOfSpecies()) {
@Override public boolean check(ValidationContext ctx, Species s) { // TODO - change the way we report the error, to report the error per compartment, only once. // And we should be able to avoid a loop over the full listofSpecies for each species Model m = s.getModel(); if (s.isSetSpeciesType() && m != null) { String st = s.getSpeciesType(); for (Species spec: m.getListOfSpecies()) { // Are species in same compartment but not the same? if (spec.isSetSpeciesType() && spec.getCompartment().equals(s.getCompartment()) && !spec.getId().equals(s.getId())) { // Must have different Types if (spec.getSpeciesType().equals(st)) { return false; } } } } return true; } };
for (Species species : testDocument.getModel().getListOfSpecies()) { species.getAnnotationString();
for (Species s : model.getListOfSpecies()) { if (!s.isConstant()) { variable = new InnerNode<SBase>(s);
DataSource dataSourceMips = mdu.safeFetchDataSource("MIPS"); ListOf<Species> speci = model.getListOfSpecies(); for (int i = 0; i < speci.size(); i++) { Species species = speci.get(i);
private Model flattenModel(Model modelOfSubmodel) { flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfReactions()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfCompartments()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfConstraints()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfEvents()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfFunctionDefinitions()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfParameters()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfRules()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfSpecies()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfUnitDefinitions()); return modelOfSubmodel; }
DataSource dataSourceMips = mdu.safeFetchDataSource("MIPS"); ListOf<Species> speci = model.getListOfSpecies(); for (int i = 0; i < speci.size(); i++) { Species species = speci.get(i);
mergeListsOfModels(previousModel.getListOfSpecies(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfFunctionDefinitions(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfRules(), previousModel, mergedModel); mergeListsOfModels(currentModel.getListOfSpecies(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfFunctionDefinitions(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfRules(), currentModel, mergedModel);
processSpecies(model.getListOfSpecies()); fireEventOccurred(new GeneralOutputEvent("Finished parsing species.", "[Parser - start]"));
ListOf<Species> speciesListOf = sourceModel.getListOfSpecies().clone(); sourceModel.getListOfSpecies().removeFromParent();