Changeset 763


Ignore:
Timestamp:
12/10/2010 01:27:33 PM (10 years ago)
Author:
joao.dias
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • AgentMind/branches/FAtiMA-Modular/FAtiMA.MotivationalSystem/src/FAtiMA/motivationalSystem/MotivationalComponent.java

    r744 r763  
    1616import FAtiMA.Core.AgentModel; 
    1717import FAtiMA.Core.AgentSimulationTime; 
     18import FAtiMA.Core.IAppraisalComponent; 
    1819import FAtiMA.Core.IComponent; 
    1920import FAtiMA.Core.IModelOfOtherComponent; 
    2021import FAtiMA.Core.Display.AgentDisplayPanel; 
     22import FAtiMA.Core.OCCAffectDerivation.OCCComponent; 
    2123import FAtiMA.Core.deliberativeLayer.IActionFailureStrategy; 
    2224import FAtiMA.Core.deliberativeLayer.IExpectedUtilityStrategy; 
     
    2729import FAtiMA.Core.deliberativeLayer.goals.ActivePursuitGoal; 
    2830import FAtiMA.Core.deliberativeLayer.plan.Step; 
    29 import FAtiMA.Core.emotionalState.AppraisalStructure; 
     31import FAtiMA.Core.emotionalState.AppraisalFrame; 
    3032import FAtiMA.Core.sensorEffector.Event; 
    3133import FAtiMA.Core.util.AgentLogger; 
     
    4446 */ 
    4547 
    46 public class MotivationalComponent implements Serializable, Cloneable, IComponent, IModelOfOtherComponent, IExpectedUtilityStrategy, IProbabilityStrategy, IUtilityStrategy, IGoalSuccessStrategy, IGoalFailureStrategy, IActionFailureStrategy { 
     48public class MotivationalComponent implements Serializable, Cloneable, IAppraisalComponent, IModelOfOtherComponent, IExpectedUtilityStrategy, IProbabilityStrategy, IUtilityStrategy, IGoalSuccessStrategy, IGoalFailureStrategy, IActionFailureStrategy { 
    4749         
    4850        private static final long serialVersionUID = 1L; 
     
    282284        public float getUtility(AgentModel am, ActivePursuitGoal g) 
    283285        { 
    284                 return getContributionToNeeds(am,g); 
     286                return getContributionToNeeds(am,g)*0.2f; 
    285287        } 
    286288         
     
    382384         * Update the agent's certainty value 
    383385         * @param expectation - ranges from -1 to 1, -1 means complete violation of expectation while 
    384          *                                              1 means complete fulfilment of expectation 
     386         *                                              1 means complete fulfillment of expectation 
    385387         * Changed the factor from 10 to 3 (Meiyii) 
    386388         */ 
     
    426428        { 
    427429                float result =  UpdateMotivators(am, e); 
    428                 _appraisals.put(e.toString(), new Float(result)); 
    429         } 
    430  
    431         @Override 
    432         public void appraisal(AgentModel am, Event e, AppraisalStructure as) { 
     430                _appraisals.put(e.toString(), new Float(result*0.5)); 
     431        } 
     432 
     433        @Override 
     434        public void startAppraisal(AgentModel am, Event e, AppraisalFrame as) { 
    433435                Float desirability = _appraisals.get(e.toString()); 
    434436                if(desirability != null) 
    435437                { 
    436                         as.SetAppraisalVariable(NAME, (short) 8, AppraisalStructure.DESIRABILITY, desirability.floatValue()); 
    437                 } 
     438                        as.SetAppraisalVariable(NAME, (short) 8, OCCComponent.DESIRABILITY, desirability.floatValue()); 
     439                } 
     440                _appraisals.remove(e.toString()); 
    438441        } 
    439442 
     
    496499                        ms.AddMotivator(m2); 
    497500                } 
     501                 
     502                ms._actionEffectsOnDrives =  (HashMap<String,ActionEffectsOnDrives>)_actionEffectsOnDrives.clone(); 
     503                ms._goalEffectsOnDrives =  (HashMap<String,ExpectedGoalEffectsOnDrives>)_goalEffectsOnDrives.clone(); 
    498504                 
    499505                return ms; 
     
    548554                UpdateCertainty(-a.getProbability(am)); 
    549555        } 
     556 
     557 
     558        @Override 
     559        public void continueAppraisal(AgentModel am) { 
     560                // TODO Auto-generated method stub 
     561                 
     562        } 
    550563} 
Note: See TracChangeset for help on using the changeset viewer.