Changeset 761
- Timestamp:
- 12/10/2010 01:24:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AgentMind/branches/FAtiMA-Modular/FAtiMA.SocialRelations/src/FAtiMA/socialRelations/SocialRelationsComponent.java
r744 r761 8 8 9 9 import FAtiMA.Core.AgentModel; 10 import FAtiMA.Core.IAppraisalComponent; 10 11 import FAtiMA.Core.IComponent; 11 12 import FAtiMA.Core.IModelOfOtherComponent; 12 13 import FAtiMA.Core.IProcessEmotionComponent; 13 14 import FAtiMA.Core.Display.AgentDisplayPanel; 15 import FAtiMA.Core.OCCAffectDerivation.OCCComponent; 14 16 import FAtiMA.Core.emotionalState.ActiveEmotion; 15 import FAtiMA.Core.emotionalState.Appraisal Structure;17 import FAtiMA.Core.emotionalState.AppraisalFrame; 16 18 import FAtiMA.Core.memory.Memory; 17 19 import FAtiMA.Core.sensorEffector.Event; … … 22 24 23 25 24 public class SocialRelationsComponent implements I Component, IModelOfOtherComponent, IProcessEmotionComponent {26 public class SocialRelationsComponent implements IAppraisalComponent, IModelOfOtherComponent, IProcessEmotionComponent { 25 27 26 28 public static final String NAME = "SocialRelations"; … … 79 81 80 82 @Override 81 public void appraisal(AgentModel am, Event e, AppraisalStructure as) {83 public void startAppraisal(AgentModel am, Event e, AppraisalFrame as) { 82 84 if(e.GetSubject().equals(Constants.SELF) && e.GetAction().equals("look-at")) 83 85 { … … 85 87 if(relationShip != 0) 86 88 { 87 as.SetAppraisalVariable(NAME, (short)7, AppraisalStructure.LIKE, relationShip);89 as.SetAppraisalVariable(NAME, (short)7, OCCComponent.LIKE, relationShip); 88 90 } 89 91 } … … 91 93 92 94 @Override 93 public void emotionActivation(AgentModel am, Event e,ActiveEmotion em) {95 public void emotionActivation(AgentModel am, ActiveEmotion em) { 94 96 Memory m = am.getMemory(); 95 97 switch(em.GetType()) … … 147 149 case EmotionType.JOY: 148 150 { 149 if(e .GetTarget() != null && e.GetTarget().equals(Constants.SELF))151 if(em.GetCause().GetTarget() != null && em.GetCause().GetTarget().equals(Constants.SELF)) 150 152 { 151 LikeRelation.getRelation(Constants.SELF,e .GetSubject()).increment(m, em.GetIntensity());153 LikeRelation.getRelation(Constants.SELF,em.GetCause().GetSubject()).increment(m, em.GetIntensity()); 152 154 } 153 155 break; … … 155 157 case EmotionType.DISTRESS: 156 158 { 157 if(e .GetTarget() != null && e.GetTarget().equals(Constants.SELF))159 if(em.GetCause().GetTarget() != null && em.GetCause().GetTarget().equals(Constants.SELF)) 158 160 { 159 LikeRelation.getRelation(Constants.SELF,e .GetSubject()).decrement(m, em.GetIntensity());161 LikeRelation.getRelation(Constants.SELF,em.GetCause().GetSubject()).decrement(m, em.GetIntensity()); 160 162 } 161 163 break; … … 174 176 return new SocialRelationsPanel(); 175 177 } 178 179 @Override 180 public void continueAppraisal(AgentModel am) { 181 // TODO Auto-generated method stub 182 183 } 176 184 }
Note: See TracChangeset
for help on using the changeset viewer.