Class Community

All Implemented Interfaces:
Serializable, Commented, ComprehensiveIdentification, Identified<Identification>, Named, Positioned<Place>, SimulationAgent, TaskProcessor
Direct Known Subclasses:
EarthEcosource, Organization

public class Community extends PsychologicalGroup implements TaskProcessor
Represents a primitive or cooperative social PsychologicalGroup where resources are shared. Suitable for modeling anything from animal social structures to human cooperatives. * @version 1.1
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Community

      public Community(Species species, Place place)
      Creates a new empty Community at a specific place.
      Parameters:
      species - predominant species
      place - location
    • Community

      public Community(Identification id, Species species, Place place)
    • Community

      public Community(Identification id, String name, Species species, Place place)
    • Community

      public Community(Species species, Set<Individual> individuals, Place place)
      Creates a new Community with initial members.
  • Method Details

    • getResources

      public Set<Resource> getResources()
      Description copied from interface: TaskProcessor
      Returns the set of resources available to this processor.
      Specified by:
      getResources in interface TaskProcessor
      Returns:
      the set of available resources.
    • consumeResources

      public boolean consumeResources(Task task)
      Description copied from interface: TaskProcessor
      Consumes the necessary resources to perform the given task.
      Specified by:
      consumeResources in interface TaskProcessor
      Parameters:
      task - the task to perform.
      Returns:
      true if resources were successfully consumed; false otherwise.
    • addResource

      public void addResource(Resource resource)
    • removeResource

      public void removeResource(Resource resource)
    • setResources

      public void setResources(Set<Resource> resources)
    • barterResources

      public void barterResources(Set<Resource> offered, Community other, Set<Resource> wanted)
      Performs a direct resource swap with another community.