LinkedList<EvolvableBoxAgent3DAppendix> appendixList = new LinkedList<EvolvableBoxAgent3DAppendix> (agent.getAppendices().values());
Iterator<EvolvableBoxAgent3DAppendix> iter = appendixList.iterator();
//Go through the whole list and check if any appendix makes contact with the ground.
while (iter.hasNext()) {
EvolvableBoxAgent3DAppendix a = iter.next();
if (a.touchesGround()) {
// If an appendix touches the ground add its id to the list.
list.add(a.getAppendixId());
}
}
return list;