Class Community
- All Implemented Interfaces:
Serializable, Commented, ComprehensiveIdentification, Identified<Identification>, Named, Positioned<Place>, SimulationAgent, TaskProcessor
- Direct Known Subclasses:
EarthEcosource, Organization
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:
-
Field Summary
Fields inherited from class SocialCollective
cohesion, leader, members -
Constructor Summary
ConstructorsConstructorDescriptionCommunity(Identification id, String name, Species species, Place place) Community(Identification id, Species species, Place place) Community(Species species, Set<Individual> individuals, Place place) Creates a new Community with initial members.Creates a new empty Community at a specific place. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResource(Resource resource) voidPerforms a direct resource swap with another community.booleanconsumeResources(Task task) Consumes the necessary resources to perform the given task.Returns the set of resources available to this processor.voidremoveResource(Resource resource) voidsetResources(Set<Resource> resources) Methods inherited from class PsychologicalGroup
getFormalTerritory, getLeaders, getRelation, getRelations, setFormalTerritory, setLeaders, setRelation, setRelationMethods inherited from class Population
addMember, countAlive, countBySex, countByStage, equals, filter, getAgeDistribution, getAverageAge, getAverageFecundity, getFounders, getIndividuals, getLocation, getOldestAge, getPosition, getSexRatio, getSpecies, getTerritory, getYoungestAge, hashCode, processEvent, setIndividuals, setTerritory, size, toStringMethods inherited from class SocialCollective
getCohesion, getLeader, getMembers, removeMember, setCohesion, setLeaderMethods inherited from class SocialEntity
getEngine, getId, getInfluence, getPrestige, getSimId, getTraits, interact, setEngine, setInfluence, setPrestigeMethods inherited from interface Commented
getComments, getTrait, setCommentsMethods inherited from interface ComprehensiveIdentification
getName, getTrait, setName, setTrait
-
Constructor Details
-
Community
-
Community
-
Community
-
Community
Creates a new Community with initial members.
-
-
Method Details
-
getResources
Description copied from interface:TaskProcessorReturns the set of resources available to this processor.- Specified by:
getResourcesin interfaceTaskProcessor- Returns:
- the set of available resources.
-
consumeResources
Description copied from interface:TaskProcessorConsumes the necessary resources to perform the given task.- Specified by:
consumeResourcesin interfaceTaskProcessor- Parameters:
task- the task to perform.- Returns:
trueif resources were successfully consumed;falseotherwise.
-
addResource
-
removeResource
-
setResources
-
barterResources
-