Ignore:
Timestamp:
11/11/2010 02:20:18 PM (10 years ago)
Author:
joao.dias
Message:
 
File:
1 edited

Legend:

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

    r694 r696  
    4343import FAtiMA.Core.conditions.RecentEventCondition; 
    4444import FAtiMA.Core.deliberativeLayer.DeliberativeProcess; 
     45import FAtiMA.Core.deliberativeLayer.goals.Goal; 
    4546import FAtiMA.Core.exceptions.ContextParsingException; 
    4647import FAtiMA.Core.exceptions.DuplicateSymbolTranslatorEntry; 
     
    6768        private AgentModel _am; 
    6869        private CulturalDimensionsComponent _culturalComponent; 
     70        private String _currentGoalKey; 
    6971         
    7072        ReactiveProcess _reactiveLayer; 
     
    8183                _am = aM; 
    8284                _culturalComponent = cDM; 
     85                 
     86                _currentGoalKey = null; 
    8387        } 
    8488 
     
    146150                _rituals.add(_ritual); 
    147151                _conditionType = "PreConditions"; 
     152                _currentGoalKey = null; 
    148153        } 
    149154 
     
    178183        public void ActivePursuitGoal(Attributes attributes) 
    179184        { 
    180                 AgentLogger.GetInstance().logAndPrint("ERROR! Culture file has an 'ActivePursuitGoal' defined in it."); 
    181                 System.exit(-1); 
     185                _currentGoalKey = attributes.getValue("name"); 
    182186        } 
    183187 
     
    253257                {        
    254258                        _ritual.AddCondition(_conditionType, cond); 
     259                }else if (_currentGoalKey != null){ 
     260                        Goal g = _deliberativeLayer.getGoalLibrary().GetGoal(Name.ParseName(_currentGoalKey)); 
     261                        g.AddCondition(_conditionType, cond); 
    255262                } 
    256263        } 
Note: See TracChangeset for help on using the changeset viewer.