Пример #1
0
 @Override
 public IList<ISpecies> getMicroSpecies() {
   final IList<ISpecies> retVal = GamaListFactory.create(Types.SPECIES);
   retVal.addAll(microSpecies.values());
   final ISpecies parentSpecies = this.getParentSpecies();
   if (parentSpecies != null) {
     retVal.addAll(parentSpecies.getMicroSpecies());
   }
   return retVal;
 }
Пример #2
0
 @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;
 }
Пример #3
0
 @Override
 public GamaMap mapValue(
     final IScope scope, final IType keyType, final IType contentsType, final boolean copy)
     throws GamaRuntimeException {
   final IList<IAgent> agents = listValue(scope, contentsType, false);
   // Default behavior : Returns a map containing the names of agents as keys and the agents
   // themselves as values
   final GamaMap result =
       GamaMapFactory.create(Types.STRING, scope.getModelContext().getTypeNamed(getName()));
   for (final IAgent agent : agents.iterable(scope)) {
     result.put(agent.getName(), agent);
   }
   return result;
 }