neosim.iface
Interface Population

All Known Subinterfaces:
PopulationBuilder, PopulationView
All Known Implementing Classes:
PopulationImpl

public interface Population
extends PopulationNode

A population is a collection of one or more entity handles. It can contain extra methods for initialising the elements of the population, or for indexing them rapidly.


Method Summary
 void addMember(EntityID eid)
          Add a member to this population
 EntityID getEntityID(int index)
          Returns entityID of a given index
 int getID()
          Returns unique population id
 int getIndex(EntityID eid)
          Returns index of a given entity ID
 java.util.Vector getMemberList()
          Returns a list of all members
 int getNumEnts()
          Returns number of entities
 boolean isMember(EntityID eid)
          Returns whether a given entity is a member
 
Methods inherited from interface neosim.iface.PopulationNode
getName, getParent, isLeaf
 

Method Detail

getID

public int getID()
Returns unique population id

getNumEnts

public int getNumEnts()
Returns number of entities

getIndex

public int getIndex(EntityID eid)
Returns index of a given entity ID
Parameters:
eid - handle of entity
Returns:
index of entity in population if present, or -1 otherwise.

getEntityID

public EntityID getEntityID(int index)
Returns entityID of a given index
Parameters:
index - index in population
Returns:
entityID of given index

isMember

public boolean isMember(EntityID eid)
Returns whether a given entity is a member
Parameters:
eid - handle of entity
Returns:
true if entity is a member of this population

getMemberList

public java.util.Vector getMemberList()
Returns a list of all members

addMember

public void addMember(EntityID eid)
Add a member to this population
Parameters:
eid - handle of entity