Changeset 699


Ignore:
Timestamp:
11/11/2010 03:10:12 PM (9 years ago)
Author:
joao.dias
Message:
 
Location:
AgentMind/branches/FAtiMA-Modular
Files:
8 edited

Legend:

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

    r685 r699  
    2828                motivatorName = attributes.getValue("motivator"); 
    2929                type = MotivatorType.ParseType(motivatorName); 
    30                 MotivationalComponent ms = (MotivationalComponent)_agent.GetComponent(MotivationalComponent.NAME); 
     30                MotivationalComponent ms = (MotivationalComponent)_agent.getComponent(MotivationalComponent.NAME); 
    3131                 
    3232                ms.AddMotivator(new Motivator(type, 
     
    4949        public void Motivator(Attributes attributes) 
    5050        { 
    51                 MotivationalComponent motivComp = (MotivationalComponent)_agent.GetComponent(MotivationalComponent.NAME); 
     51                MotivationalComponent motivComp = (MotivationalComponent)_agent.getComponent(MotivationalComponent.NAME); 
    5252                 
    5353                String driveName = attributes.getValue("drive"); 
     
    7171         
    7272        private void setGoalExpectedEffectOnDrive(Attributes attributes, short effectType){ 
    73                 MotivationalComponent ms = (MotivationalComponent)_agent.GetComponent(MotivationalComponent.NAME); 
     73                MotivationalComponent ms = (MotivationalComponent)_agent.getComponent(MotivationalComponent.NAME); 
    7474                 
    7575                String driveName = attributes.getValue("drive"); 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA.culture/src/FAtiMA/culture/CulturalDimensionsComponent.java

    r694 r699  
    6161                aM.getDeliberativeLayer().AddOptionsStrategy(this); 
    6262                aM.getDeliberativeLayer().setExpectedUtilityStrategy(this); 
     63                aM.getRemoteAgent().setProcessActionStrategy(new CultureProcessActionStrategy()); 
    6364        } 
    6465         
     
    7172        public void appraisal(Event e, AppraisalStructure as, AgentModel am) 
    7273        { 
     74                float desirabilityForOther = 0; 
     75                AppraisalStructure appraisalOfOther; 
    7376                float desirability = as.getAppraisalVariable(AppraisalStructure.DESIRABILITY); 
    74                 float desirabilityForOther = as.getAppraisalVariable(AppraisalStructure.DESIRABILITY_FOR_OTHER); 
     77                for(String other : as.getOthers()) 
     78                { 
     79                        appraisalOfOther = as.getAppraisalOfOther(other); 
     80                        desirabilityForOther += appraisalOfOther.getAppraisalVariable(AppraisalStructure.DESIRABILITY); 
     81                } 
    7582                         
    7683                float praiseWorthiness = this.determinePraiseWorthiness( 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/AgentCore.java

    r698 r699  
    127127                        //For efficiency reasons these two are not real processes 
    128128                        _reactiveLayer = new ReactiveProcess(); 
    129                         AddComponent(_reactiveLayer); 
     129                        addComponent(_reactiveLayer); 
    130130 
    131131                        _deliberativeLayer = new DeliberativeProcess(goalLibrary,planner); 
    132                         AddComponent(_deliberativeLayer); 
     132                        addComponent(_deliberativeLayer); 
    133133 
    134134                        //TODO:PARSETHEGOALS 
     
    202202 
    203203 
    204         public void AddComponent(IComponent c) 
     204        public void addComponent(IComponent c) 
    205205        { 
    206206                this._components.put(c.name(), c); 
     
    212212                } 
    213213        } 
    214  
    215         public IComponent GetComponent(String name) 
     214         
     215        public RemoteAgent getRemoteAgent() 
     216        { 
     217                return this._remoteAgent; 
     218        } 
     219 
     220        public IComponent getComponent(String name) 
    216221        { 
    217222                return this._components.get(name); 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/AgentModel.java

    r679 r699  
    55import FAtiMA.Core.memory.Memory; 
    66import FAtiMA.Core.reactiveLayer.ReactiveProcess; 
     7import FAtiMA.Core.sensorEffector.RemoteAgent; 
    78import FAtiMA.Core.wellFormedNames.Symbol; 
    89 
     
    2324        public void setModelStrategy(IGetModelStrategy strat); 
    2425         
     26        public RemoteAgent getRemoteAgent(); 
     27         
    2528} 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/sensorEffector/IONRemoteAgent.java

    r667 r699  
    6464import FAtiMA.Core.wellFormedNames.Name; 
    6565import FAtiMA.Core.wellFormedNames.Symbol; 
    66 import FAtiMA.culture.SymbolTranslator; 
    6766 
    6867/** 
     
    9897        protected boolean SendAction(RemoteAction ra) 
    9998        { 
    100                 ra.setActionType(SymbolTranslator.GetInstance().translateActionToSymbol(ra.getActionType())); 
     99                ra = _processActionStrategy.ProcessActionToWorld(ra); 
     100                 
    101101                String msg = ra.toXML(); 
    102102                 
     
    294294                RemoteAction rmAction = RemoteAction.ParseFromXml(perc); 
    295295                 
    296                 rmAction.setActionType(SymbolTranslator.GetInstance().translateSymbolToAction(rmAction.getActionType())); 
     296                 
     297                rmAction = _processActionStrategy.ProcessActionFromWorld(rmAction); 
     298                 
    297299                if(rmAction.getActionType().equals("look-at")) 
    298300                { 
     
    328330                else{ 
    329331                        rmAction = RemoteAction.ParseFromXml(perc); 
    330                         rmAction.setActionType(SymbolTranslator.GetInstance().translateSymbolToAction(rmAction.getActionType())); 
     332                        rmAction = _processActionStrategy.ProcessActionFromWorld(rmAction); 
    331333                } 
    332334                 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/sensorEffector/RemoteAgent.java

    r667 r699  
    147147        protected boolean _running; 
    148148        protected String _userName; 
    149         //protected LanguageEngine _languageEngine; 
    150         //protected String _userLanguageDataBase; 
    151         //protected LanguageEngine _userLanguageEngine; 
    152          
     149         
     150        protected IProcessActionStrategy _processActionStrategy; 
    153151         
    154152         
     
    160158                _canAct = true; 
    161159                _running = true; 
     160                _processActionStrategy = new DefaultProcessActionStrategy(); 
    162161                 
    163162                 
     
    233232        public final boolean isRunning() { 
    234233            return _running; 
     234        } 
     235         
     236        public void setProcessActionStrategy(IProcessActionStrategy strat) 
     237        { 
     238                _processActionStrategy = strat; 
    235239        } 
    236240                 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/sensorEffector/WorldSimulatorRemoteAgent.java

    r667 r699  
    1717import FAtiMA.Core.wellFormedNames.Name; 
    1818import FAtiMA.Core.wellFormedNames.Symbol; 
    19 import FAtiMA.culture.SymbolTranslator; 
    2019 
    2120public class WorldSimulatorRemoteAgent extends RemoteAgent { 
     
    5150        protected boolean SendAction(RemoteAction ra) { 
    5251                 
     52                ra = _processActionStrategy.ProcessActionToWorld(ra); 
    5353                String msg = ra.toPlainStringMessage();  
    5454                AgentLogger.GetInstance().log("Sending action for execution: " + msg); 
     
    158158                subject = st.nextToken(); 
    159159                symbol = st.nextToken(); 
    160  
    161                 action = SymbolTranslator.GetInstance().translateSymbolToAction(symbol); 
     160                 
     161                RemoteAction ra = new RemoteAction(); 
     162                ra.setActionType(symbol); 
     163                ra = _processActionStrategy.ProcessActionFromWorld(ra); 
     164                action = ra.getActionType(); 
    162165 
    163166 
     
    295298                subject = st.nextToken(); 
    296299                symbol = st.nextToken(); 
    297  
    298                 action = SymbolTranslator.GetInstance().translateSymbolToAction(symbol); 
     300                 
     301                RemoteAction ra = new RemoteAction(); 
     302                ra.setActionType(symbol); 
     303                ra = _processActionStrategy.ProcessActionFromWorld(ra); 
     304                action = ra.getActionType(); 
    299305 
    300306                if(st.hasMoreTokens()) { 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/ToM/ModelOfOther.java

    r698 r699  
    2020import FAtiMA.Core.reactiveLayer.ReactiveProcess; 
    2121import FAtiMA.Core.sensorEffector.Event; 
     22import FAtiMA.Core.sensorEffector.RemoteAgent; 
    2223import FAtiMA.Core.wellFormedNames.Symbol; 
    2324 
     
    4647                        _es.AddEmotionDisposition(ed); 
    4748                }                
     49        } 
     50         
     51        public RemoteAgent getRemoteAgent() 
     52        { 
     53                return null; 
    4854        } 
    4955 
Note: See TracChangeset for help on using the changeset viewer.