Changeset 922


Ignore:
Timestamp:
02/03/2011 03:30:00 PM (10 years ago)
Author:
joao.dias
Message:
 
Location:
AgentMind/branches/FAtiMA-Modular
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • AgentMind/branches/FAtiMA-Modular/AgentLauncher/src/AgentLauncher.java

    r914 r922  
    3535                        //aG.addComponent(new CulturalDimensionsComponent(cultureFile)); 
    3636                        //aG.addComponent(new SocialRelationsComponent(extraFiles)); 
    37                         aG.addComponent(new MotivationalComponent(extraFiles)); 
     37                        //aG.addComponent(new MotivationalComponent(extraFiles)); 
    3838                        //aG.addComponent(new ToMComponent(ConfigurationManager.getName())); 
    3939                        //aG.addComponent(new AdvancedMemoryComponent()); 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/OCCAffectDerivation/OCCBaseEmotion.java

    r896 r922  
    77public class OCCBaseEmotion extends BaseEmotion { 
    88 
    9         protected OCCBaseEmotion(OCCEmotionType type, float potential,Event cause,Name direction){ 
     9        public OCCBaseEmotion(OCCEmotionType type, float potential,Event cause,Name direction){ 
    1010                super(type.name(), type.getValence(), type.getAppraisalVariables(),potential, cause,direction); 
    1111        } 
    1212         
    13         protected OCCBaseEmotion(OCCEmotionType type, float potential,Event cause) { 
     13        public OCCBaseEmotion(OCCEmotionType type, float potential,Event cause) { 
    1414                super(type.name(), type.getValence(), type.getAppraisalVariables(),potential, cause); 
    1515 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/OCCAffectDerivation/OCCComponent.java

    r896 r922  
    5555                return null; 
    5656        } 
    57          
    58         public static String getHopeKey(Event e) 
    59         { 
    60                 return e + "-" + OCCAppraisalVariables.GOALCONDUCIVENESS + "-" +  
    61                                         OCCAppraisalVariables.SUCCESSPROBABILITY; 
    62         } 
    63          
    64         public static String getFearKey(Event e) 
    65         { 
    66                 return e + "-" + OCCAppraisalVariables.GOALCONDUCIVENESS + "-" +  
    67                         OCCAppraisalVariables.FAILUREPROBABILITY; 
    68         } 
    69          
    7057         
    7158        @Override 
     
    138125                                        } 
    139126                                } 
    140                                 else if(status == GOALCONFIRMED) 
     127                                else  
    141128                                { 
    142                                         float conduciveness = af.getAppraisalVariable(OCCAppraisalVariables.GOALCONDUCIVENESS.name()); 
    143                                         if(conduciveness != 0) 
     129                  
     130                                        fear = am.getEmotionalState().GetEmotion(new OCCBaseEmotion(OCCEmotionType.FEAR, 0, event));              
     131                                        hope = am.getEmotionalState().GetEmotion(new OCCBaseEmotion(OCCEmotionType.HOPE,0, event)); 
     132                                         
     133                                        if(fear!= null || hope != null) 
    144134                                        { 
    145                                                 fear = am.getEmotionalState().GetEmotion(getFearKey(event)); 
    146                                                 hope = am.getEmotionalState().GetEmotion(getHopeKey(event)); 
    147                                                 if(fear!= null || hope != null) 
     135                                                if(status == GOALCONFIRMED) 
    148136                                                { 
    149                                                         emotions.add(AppraiseGoalSuccess(am, hope, fear, conduciveness,af.getEvent())); 
     137                                                        emotions.add(AppraiseGoalSuccess(am, hope, fear, goalConduciveness,af.getEvent())); 
    150138                                                } 
    151                                         } 
    152                                          
    153                                 } 
    154                                 else if(status == GOALDISCONFIRMED) 
    155                                 { 
    156                                         float conduciveness = af.getAppraisalVariable(OCCAppraisalVariables.GOALCONDUCIVENESS.name()); 
    157                                         if(conduciveness != 0) 
    158                                         { 
    159                                                 fear = am.getEmotionalState().GetEmotion(getFearKey(event)); 
    160                                                 hope = am.getEmotionalState().GetEmotion(getHopeKey(event)); 
    161                                                 if(fear!= null || hope != null) 
     139                                                else if (status == GOALDISCONFIRMED) 
    162140                                                { 
    163                                                         emotions.add(AppraiseGoalFailure(am, hope, fear, conduciveness,af.getEvent())); 
    164                                                 } 
    165                                         } 
     141                                                        emotions.add(AppraiseGoalFailure(am, hope, fear, goalConduciveness,af.getEvent())); 
     142                                                }        
     143                                        }        
    166144                                } 
    167145                        } 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/OCCAffectDerivation/OCCEmotionType.java

    r914 r922  
    66        ADMIRATION (EmotionValence.POSITIVE){public String[] getAppraisalVariables(){return attribution;}}, 
    77        ANGER (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return composed;}}, 
    8         DISAPPOINTMENT (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return prospectBased;}}, 
     8        DISAPPOINTMENT (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return positiveProspect;}}, 
    99        DISTRESS (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return wellBeing;}}, 
    10         FEAR (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return fearVariables;}}, 
    11         FEARS_CONFIRMED (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return prospectBased;}}, 
     10        FEAR (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return negativeProspect;}}, 
     11        FEARS_CONFIRMED (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return negativeProspect;}}, 
    1212        GRATIFICATION (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return composed;}}, 
    1313        GLOATING (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return fortuneOfOthers;}}, 
    1414        HAPPY_FOR(EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return fortuneOfOthers;}}, 
    1515        HATE (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return attraction;}}, 
    16         HOPE (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return hopeVariables;}}, 
     16        HOPE (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return positiveProspect;}}, 
    1717        JOY (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return wellBeing;}}, 
    1818        LOVE (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return attraction;}}, 
    1919        PITTY (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return fortuneOfOthers;}}, 
    2020        PRIDE (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return attribution;}}, 
    21         RELIEF (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return prospectBased;}}, 
     21        RELIEF (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return negativeProspect;}}, 
    2222        REMORSE (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return composed;}}, 
    2323        REPROACH (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return attribution;}}, 
    2424        RESENTMENT (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return fortuneOfOthers;}}, 
    25         SATISFACTION (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return prospectBased;}}, 
     25        SATISFACTION (EmotionValence.POSITIVE) {public String[] getAppraisalVariables(){return positiveProspect;}}, 
    2626        SHAME (EmotionValence.NEGATIVE) {public String[] getAppraisalVariables(){return attribution;}}; 
    2727         
     
    3535        private static String[] composed = {OCCAppraisalVariables.DESIRABILITY.name(),OCCAppraisalVariables.PRAISEWORTHINESS.name()}; 
    3636         
    37         private static String[] fearVariables = {OCCAppraisalVariables.GOALCONDUCIVENESS.name(),OCCAppraisalVariables.FAILUREPROBABILITY.name()}; 
    38         private static String[] hopeVariables = {OCCAppraisalVariables.GOALCONDUCIVENESS.name(),OCCAppraisalVariables.SUCCESSPROBABILITY.name()};        
    39         private static String[] prospectBased = {OCCAppraisalVariables.GOALCONDUCIVENESS.name(),OCCAppraisalVariables.GOALSTATUS.name()}; 
     37        private static String[] positiveProspect = {OCCAppraisalVariables.GOALCONDUCIVENESS.name(),OCCAppraisalVariables.GOALSTATUS.name(), OCCAppraisalVariables.FAILUREPROBABILITY.name()}; 
     38        private static String[] negativeProspect = {OCCAppraisalVariables.GOALCONDUCIVENESS.name(),OCCAppraisalVariables.GOALSTATUS.name(), OCCAppraisalVariables.SUCCESSPROBABILITY.name()};    
    4039 
    4140         
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/deliberativeLayer/EmotionalPlanner.java

    r896 r922  
    116116import FAtiMA.Core.IntegrityValidator; 
    117117import FAtiMA.Core.OCCAffectDerivation.OCCAppraisalVariables; 
     118import FAtiMA.Core.OCCAffectDerivation.OCCBaseEmotion; 
    118119import FAtiMA.Core.OCCAffectDerivation.OCCComponent; 
     120import FAtiMA.Core.OCCAffectDerivation.OCCEmotionType; 
    119121import FAtiMA.Core.conditions.Condition; 
    120122import FAtiMA.Core.conditions.PropertyNotEqual; 
     
    455457                am.updateEmotions(af); 
    456458                 
    457                 hopeEmotion = am.getEmotionalState().GetEmotion(OCCComponent.getHopeKey(af.getEvent())); 
    458                 fearEmotion = am.getEmotionalState().GetEmotion(OCCComponent.getFearKey(af.getEvent())); 
     459                fearEmotion = am.getEmotionalState().GetEmotion(new OCCBaseEmotion(OCCEmotionType.FEAR, 0, af.getEvent()));               
     460                hopeEmotion = am.getEmotionalState().GetEmotion(new OCCBaseEmotion(OCCEmotionType.HOPE,0, af.getEvent())); 
    459461                 
    460462                intention.SetHope(hopeEmotion); 
     
    495497                        auxFrame.SetAppraisalVariable(DeliberativeProcess.NAME, (short)6, OCCAppraisalVariables.FAILUREPROBABILITY.name(), prob); 
    496498                        auxFrame.SetAppraisalVariable(DeliberativeProcess.NAME, (short)6, OCCAppraisalVariables.GOALCONDUCIVENESS.name(), -tGoal.GetImportanceOfFailure(am)); 
     499                        auxFrame.SetAppraisalVariable(DeliberativeProcess.NAME, (short)6, OCCAppraisalVariables.GOALSTATUS.name(), OCCComponent.GOALUNCONFIRMED); 
    497500                        am.updateEmotions(auxFrame); 
    498501                          
    499502                         
    500                         threatEmotion = am.getEmotionalState().GetEmotion(OCCComponent.getFearKey(tGoal.GetActivationEvent()));  
     503                        threatEmotion = am.getEmotionalState().GetEmotion(new OCCBaseEmotion(OCCEmotionType.FEAR, 0, tGoal.GetActivationEvent())); 
     504                                          
    501505                        if(threatEmotion != null) { //if does not exist a fear caused by the threat, emotion coping is not necessary 
    502506                                threatIntensity = threatEmotion.GetIntensity(); 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/deliberativeLayer/Intention.java

    r896 r922  
    383383            _appraisalFrame.SetAppraisalVariable(DeliberativeProcess.NAME, (short)7, OCCAppraisalVariables.FAILUREPROBABILITY.name(), 1-probability); 
    384384            _appraisalFrame.SetAppraisalVariable(DeliberativeProcess.NAME, (short)7, OCCAppraisalVariables.GOALCONDUCIVENESS.name(), goalConduciveness); 
     385            _appraisalFrame.SetAppraisalVariable(DeliberativeProcess.NAME, (short)7, OCCAppraisalVariables.GOALSTATUS.name(), OCCComponent.GOALUNCONFIRMED); 
    385386             
    386387            am.updateEmotions(_appraisalFrame); 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/emotionalState/BaseEmotion.java

    r896 r922  
    122122         */ 
    123123        public String GetHashKey() { 
    124                 String aux = _cause.toString()+_cause.GetTime(); 
     124                String aux = _cause.toString(); 
    125125                for(String s : _appraisalVariables) 
    126126                { 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/emotionalState/EmotionalState.java

    r896 r922  
    140140                int decay; 
    141141                ActiveEmotion auxEmotion; 
     142                ActiveEmotion previousEmotion; 
    142143                boolean reappraisal = false; 
    143144                 
     
    155156                if(_emotionPool.containsKey(potEm.GetHashKey())) 
    156157                { 
    157                         reappraisal = true; 
     158                        previousEmotion = _emotionPool.get(potEm.GetHashKey()); 
     159                        //if this test is true, it means that this is 100% a reappraisal of the same event 
     160                        //if not true, it is not a reappraisal, but the appraisal of a new event of the same 
     161                        //type 
     162                        if(previousEmotion.GetCause().GetTime() == potEm.GetCause().GetTime()) 
     163                        { 
     164                                reappraisal = true; 
     165                        } 
     166                         
     167                        //in both cases we need to remove the old emotion. In the case of reappraisal it is obvious. 
     168                        //In the case of the appraisal of a similar event, we want to aggregate all the similar resulting  
     169                        //emotions into only one emotion 
    158170                        _emotionPool.remove(potEm.GetHashKey()); 
    159171                } 
     
    270282        { 
    271283                return (ActiveEmotion) _emotionPool.get(emotionKey);     
     284        } 
     285         
     286        public ActiveEmotion GetEmotion(BaseEmotion emotion) 
     287        { 
     288                return (ActiveEmotion) _emotionPool.get(emotion.GetHashKey()); 
    272289        } 
    273290         
Note: See TracChangeset for help on using the changeset viewer.