Class Population<T extends Individual>

All Implemented Interfaces:
Serializable, Commented, ComprehensiveIdentification, Identified<Identification>, Named, Positioned<Place>, SimulationAgent
Direct Known Subclasses:
Crowd, PsychologicalGroup, Society, SociologicalGroup

public class Population<T extends Individual> extends SocialCollective<T> implements Positioned<Place>
Represents a population of individuals of the same species. Provides population-level analysis: demographics, statistics, growth modeling.
See Also:
  • Constructor Details

  • Method Details

    • getSpecies

      public Species getSpecies()
    • getTerritory

      public Place getTerritory()
    • setTerritory

      public void setTerritory(Place territory)
    • getPosition

      public Place getPosition()
      Description copied from interface: Positioned
      Returns the position of this entity.
      Specified by:
      getPosition in interface Positioned<T extends Individual>
      Returns:
      the position.
    • getLocation

      public String getLocation()
    • addMember

      public void addMember(T individual)
      Overrides:
      addMember in class SocialCollective<T extends Individual>
    • getIndividuals

      public Set<T> getIndividuals()
    • setIndividuals

      public void setIndividuals(Set<T> individuals)
    • size

      public int size()
      Overrides:
      size in class SocialCollective<T extends Individual>
    • countAlive

      public long countAlive()
    • countByStage

      public long countByStage(LifeStage stage)
    • countBySex

      public long countBySex(BiologicalSex sex)
    • getSexRatio

      public double getSexRatio()
    • getAverageAge

      public double getAverageAge()
    • getOldestAge

      public int getOldestAge()
    • getYoungestAge

      public int getYoungestAge()
    • getAgeDistribution

      public Map<LifeStage, Long> getAgeDistribution()
    • getFounders

      public List<T> getFounders()
    • getAverageFecundity

      public double getAverageFecundity()
    • filter

      public List<T> filter(Predicate<T> predicate)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • processEvent

      public void processEvent(Event event)
      Description copied from interface: SimulationAgent
      Process an event delivered to this agent.
      Specified by:
      processEvent in interface SimulationAgent
      Specified by:
      processEvent in class SocialEntity
      Parameters:
      event - The event to process
    • toString

      public String toString()
      Overrides:
      toString in class Object