Package FAtiMA.motivationalSystem
Class Motivator
- java.lang.Object
-
- FAtiMA.motivationalSystem.Motivator
-
- All Implemented Interfaces:
java.io.Serializable
public class Motivator extends java.lang.Object implements java.io.SerializableRepresents a motivator based on the PSI model, which is an instance of MotivatorType- Author:
- Meiyii Lim
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static floatMotivatorDecayFactorConstant value that defines how fast should a drive decay over time.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidDecayMotivator()Decays the motivator intensity according to the system's timerfloatGetDecayFactor()floatGetIntensity()Gets the motivator's intensityfloatGetNeed()Deprecated.use GetNeedUrgency() instead.floatGetNeedUrgency()Gets the motivator's urgency discretizing the need intensity into diffent categories (very urgent, urgent, not urgent, satisfied)shortGetType()Gets the motivator's typefloatGetWeight()Gets the motivator's weightvoidSetDecayFactor(float newAffiliationDecayFactor)voidSetIntensity(float intensity)Set the motivator's intensityvoidSetWeight(float weight)java.lang.StringtoXml()Converts the Motivator to XMlfloatUpdateIntensity(float effect)Update the motivator's intensity
-
-
-
Field Detail
-
MotivatorDecayFactor
public static final float MotivatorDecayFactor
Constant value that defines how fast should a drive decay over time.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Motivator
public Motivator(short type, float decayFactor, float weight, float intensity)Creates a new Motivator- Parameters:
type- - the type of built-in motivator // * @param threshold - the min value for the motivator that the character wants to maintaindecayFactor- - the decay factor for the intensity of the motivator over timeweight- - the weight of the motivatorintensity- - intensity of the built-in motivator, the higher the intensity the lower the need due to a smaller deviation from the threshold, this value will be pre-defined based on scenario
-
Motivator
public Motivator(Motivator mot)
Creates a new Motivator that consists in a copy of a given motivator- Parameters:
mot- - the motivator that will be copied into the new motivator
-
-
Method Detail
-
GetType
public short GetType()
Gets the motivator's type- Returns:
- a short representing the motivator type (enumerable)
- See Also:
MotivatorType
-
GetWeight
public float GetWeight()
Gets the motivator's weight- Returns:
- a float value corresponding to the motivator's weight
-
SetWeight
public void SetWeight(float weight)
-
GetIntensity
public float GetIntensity()
Gets the motivator's intensity- Returns:
- a float value corresponding to the motivator's intensity
-
GetNeed
public float GetNeed()
Deprecated.use GetNeedUrgency() instead.Gets the motivator's need- Returns:
- a float value corresponding to the motivator's intensity
-
GetNeedUrgency
public float GetNeedUrgency()
Gets the motivator's urgency discretizing the need intensity into diffent categories (very urgent, urgent, not urgent, satisfied)- Returns:
- a multiplier corresponding to the motivator's urgency
-
UpdateIntensity
public float UpdateIntensity(float effect)
Update the motivator's intensity- Returns:
- a float value corresponding to the difference between the current and the old value
-
SetIntensity
public void SetIntensity(float intensity)
Set the motivator's intensity
-
DecayMotivator
public void DecayMotivator()
Decays the motivator intensity according to the system's timer
-
toXml
public java.lang.String toXml()
Converts the Motivator to XMl- Returns:
- a XML String that contains all information about the Motivator
-
GetDecayFactor
public float GetDecayFactor()
-
SetDecayFactor
public void SetDecayFactor(float newAffiliationDecayFactor)
-
-