Package FAtiMA.motivationalSystem
Class Motivator
java.lang.Object
FAtiMA.motivationalSystem.Motivator
- All Implemented Interfaces:
Serializable
Represents a motivator based on the PSI model, which is an instance of
MotivatorType
- Author:
- Meiyii Lim
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatConstant value that defines how fast should a drive decay over time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDecays the motivator intensity according to the system's timerfloatfloatGets the motivator's intensityfloatGetNeed()Deprecated.use GetNeedUrgency() instead.floatGets the motivator's urgency discretizing the need intensity into diffent categories (very urgent, urgent, not urgent, satisfied)shortGetType()Gets the motivator's typefloatGets the motivator's weightvoidSetDecayFactor(float newAffiliationDecayFactor) voidSetIntensity(float intensity) Set the motivator's intensityvoidSetWeight(float weight) toXml()Converts the Motivator to XMlfloatUpdateIntensity(float effect) Update the motivator's intensity
-
Field Details
-
MotivatorDecayFactor
public static final float MotivatorDecayFactorConstant value that defines how fast should a drive decay over time.- See Also:
-
-
Constructor Details
-
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
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 Details
-
GetType
public short GetType()Gets the motivator's type- Returns:
- a short representing the motivator type (enumerable)
- See Also:
-
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
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)
-