|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.person.ai.social.RelationshipManager
public class RelationshipManager
The RelationshipManager class keeps track of all the social relationships between people. The simulation instance has only one relationship manager.
Constructor Summary | |
---|---|
RelationshipManager()
Constructor |
Method Summary | |
---|---|
void |
addInitialSettler(Person person,
Settlement settlement)
Adds an innitial settler who will have an existing relationship with all the other inhabitants if his/her settlement. |
void |
addNewImmigrant(Person person,
java.util.Collection<Person> immigrantGroup)
Adds a new resupply immigrant who will have an existing relationship with the other immigrants in his/her group. |
void |
addRelationship(Person person1,
Person person2,
java.lang.String relationshipType)
Adds a new relationship between two people. |
java.util.Collection<Person> |
getAllKnownPeople(Person person)
Gets all the people that a person knows (has met). |
java.util.List |
getAllRelationships(Person person)
Gets all of a person's relationships. |
double |
getAverageOpinionOfPeople(Person person1,
java.util.Collection<Person> people)
Gets the average opition that a person has of a group of people. |
double |
getOpinionOfPerson(Person person1,
Person person2)
Gets the opinion that a person has of another person. |
Relationship |
getRelationship(Person person1,
Person person2)
Gets the relationship between two people. |
boolean |
hasRelationship(Person person1,
Person person2)
Checks if a person has a relationship with another person. |
void |
timePassing(Person person,
double time)
Time passing for a person's relationships. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RelationshipManager()
Method Detail |
---|
public void addInitialSettler(Person person, Settlement settlement)
person
- the person to add.settlement
- the settlement the person starts at.public void addNewImmigrant(Person person, java.util.Collection<Person> immigrantGroup)
person
- the person to add.immigrantGroup
- the groups of immigrants this person belongs to.public void addRelationship(Person person1, Person person2, java.lang.String relationshipType)
person1
- the first person (order isn't important)person2
- the second person (order isn't important)relationshipType
- the type of relationship (see Relationship static members)public boolean hasRelationship(Person person1, Person person2)
person1
- the first person (order isn't important)person2
- the second person (order isn't important)
public Relationship getRelationship(Person person1, Person person2)
person1
- the first person (order isn't important)person2
- the second person (order isn't important)
public java.util.List getAllRelationships(Person person)
person
- the person
public java.util.Collection<Person> getAllKnownPeople(Person person)
person
- the person
public double getOpinionOfPerson(Person person1, Person person2)
person1
- the person holding the opinion.person2
- the person who the opinion is of.
public double getAverageOpinionOfPeople(Person person1, java.util.Collection<Person> people)
person1
- the person holding the opinion.people
- the collection of people who the opinion is of.
public void timePassing(Person person, double time) throws java.lang.Exception
person
- the persontime
- the time passing (millisols)
java.lang.Exception
- if error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |