@Override public IList<ISpecies> getSubSpecies(final IScope scope) { IList<ISpecies> subspecies = GamaListFactory.create(Types.SPECIES); GamlModelSpecies model = (GamlModelSpecies) scope.getModel().getSpecies(); for (ISpecies s : model.getAllSpecies().values()) { if (s.getParentSpecies() == this) { subspecies.add(s); } } return subspecies; }
@Override public List<ISpecies> getSelfWithParents() { final List<ISpecies> retVal = new ArrayList<ISpecies>(); retVal.add(this); ISpecies currentParent = this.getParentSpecies(); while (currentParent != null) { retVal.add(currentParent); currentParent = currentParent.getParentSpecies(); } return retVal; }