private static OCCBaseEmotion OCCAppraiseAttribution(IBaseEvent evt, float like) { const float magicFactor = 0.7f; OCCEmotionType emoType = (like >= 0)?OCCEmotionType.Love:OCCEmotionType.Hate; return(new OCCBaseEmotion(emoType, Math.Abs(like) * magicFactor, evt.Id, evt.Subject == null?Name.UNIVERSAL_SYMBOL:evt.Subject, evt.EventName)); }
//private static OCCBaseEmotion OCCAppraiseAttribution(IEventRecord evt, float like) //{ // const float magicFactor = 0.7f; // OCCEmotionType emoType = (like >= 0)?OCCEmotionType.Love:OCCEmotionType.Hate; // return new OCCBaseEmotion(emoType,Math.Abs(like)*magicFactor,evt.Id,evt.Subject==null?Name.UNIVERSAL_SYMBOL:Name.BuildName(evt.Subject)); //} private static OCCBaseEmotion AppraiseGoalEnd(OCCEmotionType hopefullOutcome, OCCEmotionType fearfullOutcome, IActiveEmotion hopeEmotion, IActiveEmotion fearEmotion, float goalImportance, uint evtId, Name eventName) { OCCEmotionType finalEmotion; float potential = goalImportance; finalEmotion = hopefullOutcome; if (hopeEmotion != null) { if (fearEmotion != null && fearEmotion.Intensity > hopeEmotion.Intensity) { potential = fearEmotion.Potential; finalEmotion = fearfullOutcome; } else { potential = hopeEmotion.Potential; finalEmotion = hopefullOutcome; } } else if (fearEmotion != null) { potential = fearEmotion.Potential; finalEmotion = fearfullOutcome; } //The goal importance now affects 66% of the final potential value for the emotion potential = (potential + 2 * goalImportance) / 3; return(new OCCBaseEmotion(finalEmotion, potential, evtId, eventName)); }
public OCCBaseEmotion(OCCEmotionType type, float potential, uint causeId, Name direction, Name eventName) : base(type.Name, type.Valence, type.AppraisalVariables, potential, type.InfluencesMood, causeId, direction, eventName) { }
//private static OCCBaseEmotion OCCAppraiseAttribution(IEventRecord evt, float like) //{ // const float magicFactor = 0.7f; // OCCEmotionType emoType = (like >= 0)?OCCEmotionType.Love:OCCEmotionType.Hate; // return new OCCBaseEmotion(emoType,Math.Abs(like)*magicFactor,evt.Id,evt.Subject==null?Name.UNIVERSAL_SYMBOL:Name.BuildName(evt.Subject)); //} private static OCCBaseEmotion AppraiseGoalEnd(OCCEmotionType hopefullOutcome, OCCEmotionType fearfullOutcome, IActiveEmotion hopeEmotion, IActiveEmotion fearEmotion, float goalImportance, uint evtId) { OCCEmotionType finalEmotion; float potential = goalImportance; finalEmotion = hopefullOutcome; if(hopeEmotion != null) { if(fearEmotion != null && fearEmotion.Intensity > hopeEmotion.Intensity) { potential = fearEmotion.Potential; finalEmotion = fearfullOutcome; } else { potential = hopeEmotion.Potential; finalEmotion = hopefullOutcome; } } else if(fearEmotion != null) { potential = fearEmotion.Potential; finalEmotion = fearfullOutcome; } //The goal importance now affects 66% of the final potential value for the emotion potential = (potential + 2* goalImportance) / 3; return new OCCBaseEmotion(finalEmotion, potential, evtId); }