Changeset 957


Ignore:
Timestamp:
02/13/2011 12:41:28 PM (8 years ago)
Author:
joao.dias
Message:
 
Location:
AgentMind/branches/FAtiMA-Modular/FAtiMA.culture
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • AgentMind/branches/FAtiMA-Modular/FAtiMA.culture/.classpath

    r694 r957  
    44        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> 
    55        <classpathentry combineaccessrules="false" kind="src" path="/FAtiMA"/> 
     6        <classpathentry combineaccessrules="false" kind="src" path="/FAtiMA.DeliberativeComponent"/> 
    67        <classpathentry kind="output" path="bin"/> 
    78</classpath> 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA.culture/src/FAtiMA/culture/CulturalDimensionsComponent.java

    r950 r957  
    1515import FAtiMA.Core.componentTypes.IAppraisalDerivationComponent; 
    1616import FAtiMA.Core.conditions.Condition; 
    17 import FAtiMA.Core.deliberativeLayer.DeliberativeProcess; 
    18 import FAtiMA.Core.deliberativeLayer.IExpectedUtilityStrategy; 
    19 import FAtiMA.Core.deliberativeLayer.IGetUtilityForOthers; 
    20 import FAtiMA.Core.deliberativeLayer.IOptionsStrategy; 
    21 import FAtiMA.Core.deliberativeLayer.IUtilityStrategy; 
    22 import FAtiMA.Core.deliberativeLayer.Intention; 
    23 import FAtiMA.Core.deliberativeLayer.goals.ActivePursuitGoal; 
    2417import FAtiMA.Core.emotionalState.AppraisalFrame; 
     18import FAtiMA.Core.goals.ActivePursuitGoal; 
    2519import FAtiMA.Core.sensorEffector.Event; 
    2620import FAtiMA.Core.util.AgentLogger; 
     
    2923import FAtiMA.Core.wellFormedNames.SubstitutionSet; 
    3024import FAtiMA.Core.wellFormedNames.Symbol; 
     25import FAtiMA.DeliberativeComponent.DeliberativeComponent; 
     26import FAtiMA.DeliberativeComponent.IExpectedUtilityStrategy; 
     27import FAtiMA.DeliberativeComponent.IGetUtilityForOthers; 
     28import FAtiMA.DeliberativeComponent.IOptionsStrategy; 
     29import FAtiMA.DeliberativeComponent.IUtilityStrategy; 
     30import FAtiMA.DeliberativeComponent.Intention; 
    3131 
    3232 
     
    5858        @Override 
    5959        public void initialize(AgentModel aM){ 
    60                 DeliberativeProcess dp = (DeliberativeProcess) aM.getComponent(DeliberativeProcess.NAME); 
     60                DeliberativeComponent dc = (DeliberativeComponent) aM.getComponent(DeliberativeComponent.NAME); 
    6161                this.loadCulture(aM); 
    62                 dp.addOptionsStrategy(this); 
    63                 dp.setExpectedUtilityStrategy(this); 
     62                dc.addOptionsStrategy(this); 
     63                dc.setExpectedUtilityStrategy(this); 
    6464                aM.getRemoteAgent().setProcessActionStrategy(new CultureProcessActionStrategy()); 
    6565        } 
     
    113113                Ritual r2, r3; 
    114114                String ritualName; 
    115                 DeliberativeProcess dp = (DeliberativeProcess) am.getComponent(DeliberativeProcess.NAME); 
     115                DeliberativeComponent dc = (DeliberativeComponent) am.getComponent(DeliberativeComponent.NAME); 
    116116                 
    117117                //this section detects if a ritual has started with another agent's action 
     
    141141                                                                ritualName = r3.getNameWithCharactersOrdered(); 
    142142                                                                r3.setUrgency(2); 
    143                                                                 if(!_ritualOptions.containsKey(ritualName) && !dp.containsIntention(r3)) 
     143                                                                if(!_ritualOptions.containsKey(ritualName) && !dc.containsIntention(r3)) 
    144144                                                                { 
    145145                                                                        AgentLogger.GetInstance().logAndPrint("Reactive Activation of a Ritual:" + r3.getName()); 
     
    163163        private void loadCulture(AgentModel aM){ 
    164164                 
    165                 DeliberativeProcess dp = (DeliberativeProcess) aM.getComponent(DeliberativeProcess.NAME); 
     165                DeliberativeComponent dp = (DeliberativeComponent) aM.getComponent(DeliberativeComponent.NAME); 
    166166 
    167167                AgentLogger.GetInstance().log("LOADING Culture: " + this.cultureFile); 
     
    281281        public Collection<? extends ActivePursuitGoal> options(AgentModel am) { 
    282282                 
    283                 DeliberativeProcess dp = (DeliberativeProcess) am.getComponent(DeliberativeProcess.NAME); 
     283                DeliberativeComponent dc = (DeliberativeComponent) am.getComponent(DeliberativeComponent.NAME); 
    284284                 
    285285                Iterator<Ritual> it = _ritualOptions.values().iterator(); 
     
    289289                { 
    290290                        r = it.next(); 
    291                         if(dp.containsIntention(r)) 
     291                        if(dc.containsIntention(r)) 
    292292                        { 
    293293                                it.remove(); 
     
    301301        private float culturalEU(AgentModel am, ActivePursuitGoal g, float probability) 
    302302        { 
    303                 DeliberativeProcess dp = (DeliberativeProcess) am.getComponent(DeliberativeProcess.NAME); 
    304                  
    305                 IUtilityStrategy str =  dp.getUtilityStrategy(); 
     303                DeliberativeComponent dc = (DeliberativeComponent) am.getComponent(DeliberativeComponent.NAME); 
     304                 
     305                IUtilityStrategy str =  dc.getUtilityStrategy(); 
    306306                 
    307307                float contributionToSelf = str.getUtility(am, g); 
    308308                 
    309                 IGetUtilityForOthers ostrat = dp.getUtilityForOthersStrategy(); 
     309                IGetUtilityForOthers ostrat = dc.getUtilityForOthersStrategy(); 
    310310                 
    311311                float contributionOthers = ostrat.getUtilityForOthers(am, g); 
     
    323323        @Override 
    324324        public float getExpectedUtility(AgentModel am, ActivePursuitGoal g) { 
    325                 DeliberativeProcess dp = (DeliberativeProcess) am.getComponent(DeliberativeProcess.NAME); 
    326                  
    327                 float probability = dp.getProbabilityStrategy().getProbability(am, g); 
     325                DeliberativeComponent dc = (DeliberativeComponent) am.getComponent(DeliberativeComponent.NAME); 
     326                 
     327                float probability = dc.getProbabilityStrategy().getProbability(am, g); 
    328328                return culturalEU(am,g,probability); 
    329329        } 
     
    332332        public float getExpectedUtility(AgentModel am, Intention i) { 
    333333                 
    334                 DeliberativeProcess dp = (DeliberativeProcess) am.getComponent(DeliberativeProcess.NAME);  
     334                DeliberativeComponent dp = (DeliberativeComponent) am.getComponent(DeliberativeComponent.NAME);  
    335335                 
    336336                float probability = dp.getProbabilityStrategy().getProbability(am, i); 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA.culture/src/FAtiMA/culture/CultureLoaderHandler.java

    r950 r957  
    4242import FAtiMA.Core.conditions.PropertyCondition; 
    4343import FAtiMA.Core.conditions.RecentEventCondition; 
    44 import FAtiMA.Core.deliberativeLayer.DeliberativeProcess; 
    45 import FAtiMA.Core.deliberativeLayer.goals.Goal; 
    4644import FAtiMA.Core.exceptions.ContextParsingException; 
    4745import FAtiMA.Core.exceptions.DuplicateSymbolTranslatorEntry; 
     
    4947import FAtiMA.Core.exceptions.InvalidEmotionTypeException; 
    5048import FAtiMA.Core.exceptions.UnknownGoalException; 
     49import FAtiMA.Core.goals.Goal; 
    5150import FAtiMA.Core.reactiveLayer.Reaction; 
    5251import FAtiMA.Core.reactiveLayer.ReactiveProcess; 
     
    5756import FAtiMA.Core.wellFormedNames.Substitution; 
    5857import FAtiMA.Core.wellFormedNames.Symbol; 
     58import FAtiMA.DeliberativeComponent.DeliberativeComponent; 
    5959 
    6060 
     
    7070         
    7171        ReactiveProcess _reactiveLayer; 
    72         DeliberativeProcess _deliberativeLayer; 
     72        DeliberativeComponent _deliberativeLayer; 
    7373         
    7474 
     
    8080                _self = new Substitution(new Symbol("[SELF]"), new Symbol(FAtiMA.Core.util.Constants.SELF)); 
    8181                _reactiveLayer = (ReactiveProcess) aM.getComponent(ReactiveProcess.NAME);  
    82                 _deliberativeLayer = (DeliberativeProcess) aM.getComponent(DeliberativeProcess.NAME); 
     82                _deliberativeLayer = (DeliberativeComponent) aM.getComponent(DeliberativeComponent.NAME); 
    8383                _am = aM; 
    8484                _culturalComponent = cDM; 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA.culture/src/FAtiMA/culture/Ritual.java

    r950 r957  
    3838import FAtiMA.Core.AgentModel; 
    3939import FAtiMA.Core.conditions.Condition; 
    40 import FAtiMA.Core.deliberativeLayer.DeliberativeProcess; 
    41 import FAtiMA.Core.deliberativeLayer.goals.ActivePursuitGoal; 
    42 import FAtiMA.Core.deliberativeLayer.plan.CausalLink; 
    43 import FAtiMA.Core.deliberativeLayer.plan.Effect; 
    44 import FAtiMA.Core.deliberativeLayer.plan.IPlanningOperator; 
    45 import FAtiMA.Core.deliberativeLayer.plan.OrderingConstraint; 
    46 import FAtiMA.Core.deliberativeLayer.plan.Plan; 
    47 import FAtiMA.Core.deliberativeLayer.plan.ProtectedCondition; 
    48 import FAtiMA.Core.deliberativeLayer.plan.Step; 
    4940import FAtiMA.Core.exceptions.InvalidReplaceUnboundVariableException; 
     41import FAtiMA.Core.goals.ActivePursuitGoal; 
     42import FAtiMA.Core.plans.CausalLink; 
     43import FAtiMA.Core.plans.Effect; 
     44import FAtiMA.Core.plans.IPlanningOperator; 
     45import FAtiMA.Core.plans.OrderingConstraint; 
     46import FAtiMA.Core.plans.Plan; 
     47import FAtiMA.Core.plans.ProtectedCondition; 
     48import FAtiMA.Core.plans.Step; 
    5049import FAtiMA.Core.sensorEffector.Event; 
    5150import FAtiMA.Core.wellFormedNames.Name; 
     
    164163        public void BuildPlan(AgentModel am) 
    165164        { 
    166                 DeliberativeProcess dp = (DeliberativeProcess) am.getComponent(DeliberativeProcess.NAME); 
    167165                 
    168166                Step s; 
    169167                OrderingConstraint o; 
    170                 _plan = new Plan(new ArrayList<ProtectedCondition>(),dp.getDetectThreatStrategy(),_successConditions); 
     168                _plan = new Plan(new ArrayList<ProtectedCondition>(),_successConditions); 
    171169                 
    172170                for(int i=0; i < _steps.size(); i++) 
Note: See TracChangeset for help on using the changeset viewer.