org.mars_sim.msp.core.person.ai.social
Class Relationship

java.lang.Object
  extended by org.mars_sim.msp.core.person.ai.social.Relationship
All Implemented Interfaces:
Serializable

public class Relationship
extends Object
implements Serializable

The Relationship class represents a social relationship between two people.

See Also:
Serialized Form

Field Summary
static String COMMUNICATION_MEETING
           
static String EXISTING_RELATIONSHIP
           
static String FIRST_IMPRESSION
           
 
Method Summary
 Person[] getPeople()
          Gets the two people in relationship.
 double getPersonOpinion(Person person)
          Gets one of the two people's opinion of the other.
 boolean hasPerson(Person person)
          Checks if a given person is in this relationship.
 void setPersonOpinion(Person person, double opinion)
          Sets one of the two people's opinion of the other.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_IMPRESSION

public static final String FIRST_IMPRESSION
See Also:
Constant Field Values

EXISTING_RELATIONSHIP

public static final String EXISTING_RELATIONSHIP
See Also:
Constant Field Values

COMMUNICATION_MEETING

public static final String COMMUNICATION_MEETING
See Also:
Constant Field Values
Method Detail

getPeople

public Person[] getPeople()
Gets the two people in relationship.

Returns:
array of two people

hasPerson

public boolean hasPerson(Person person)
Checks if a given person is in this relationship.

Parameters:
person - the person to check
Returns:
true if person is in this relationship

getPersonOpinion

public double getPersonOpinion(Person person)
                        throws IllegalArgumentException
Gets one of the two people's opinion of the other.

Parameters:
person - the person to get an opinion from.
Returns:
the person's opinion of the other person as a value from 0 to 100.
Throws:
IllegalArgumentException - if person is not one of the two people in the relationship.

setPersonOpinion

public void setPersonOpinion(Person person,
                             double opinion)
                      throws IllegalArgumentException
Sets one of the two people's opinion of the other.

Parameters:
person - the person to set the opinion for.
opinion - the person's opinion of the other person as a value from 0 to 100.
Throws:
IllegalArgumentException - if person is not one of the two people in the relationship.


Copyright © 2009-2013. All Rights Reserved.