Ignore:
Timestamp:
11/12/2010 12:06:25 PM (10 years ago)
Author:
joao.dias
Message:
 
Location:
AgentMind/branches/FAtiMA-Modular/FAtiMA.culture/src/FAtiMA/culture
Files:
2 edited

Legend:

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

    r694 r709  
    88import FAtiMA.Core.wellFormedNames.Substitution; 
    99import FAtiMA.Core.wellFormedNames.SubstitutionSet; 
    10 import FAtiMA.socialRelations.LikeCondition; 
    1110 
    1211/** 
     
    2322        private TimeCondition _timeCondition; 
    2423        private PlaceCondition _placeCondition; 
    25         private ArrayList<LikeCondition> _socialConditions; 
     24        private ArrayList<SocialCondition> _socialConditions; 
    2625         
    2726        public Context(){ 
    2827                _timeCondition = NullTimeCondition.GetInstance(); 
    2928                _placeCondition = NullPlaceCondition.GetInstance(); 
    30                 _socialConditions = new ArrayList<LikeCondition>(); 
     29                _socialConditions = new ArrayList<SocialCondition>(); 
    3130        } 
    3231         
     
    4746        } 
    4847         
    49         public void SetSocialConditions( ArrayList<LikeCondition> socialConditions ){ 
     48        public void SetSocialConditions( ArrayList<SocialCondition> socialConditions ){ 
    5049                _socialConditions = socialConditions; 
    5150        } 
    5251         
    53         public void AddSocialCondition( LikeCondition socialCondition ){ 
     52        public void AddSocialCondition(SocialCondition socialCondition ){ 
    5453                _socialConditions.add(socialCondition); 
    5554        } 
     
    7069                aux._placeCondition = (PlaceCondition)_placeCondition.clone(); 
    7170                for( int i = 0, limit = _socialConditions.size(); i != limit; ++i ) 
    72                         aux._socialConditions.add((LikeCondition)_socialConditions.get(i).clone() ); 
     71                        aux._socialConditions.add((SocialCondition)_socialConditions.get(i).clone() ); 
    7372                return aux; 
    7473        } 
     
    103102                _placeCondition.MakeGround(bindings); 
    104103                for( int i = 0, limit = _socialConditions.size(); i != limit; ++i ){ 
    105                         ((LikeCondition)_socialConditions.get(i)).MakeGround(bindings); 
     104                        ((SocialCondition)_socialConditions.get(i)).MakeGround(bindings); 
    106105                } 
    107106        //this._name.MakeGround(bindings); 
     
    114113                _placeCondition.MakeGround(subst); 
    115114                for( int i = 0, limit = _socialConditions.size(); i != limit; ++i ){ 
    116                         ((LikeCondition)_socialConditions.get(i)).MakeGround(subst); 
     115                        ((SocialCondition)_socialConditions.get(i)).MakeGround(subst); 
    117116                } 
    118117    } 
     
    122121                _placeCondition.ReplaceUnboundVariables(variableID); 
    123122                for( int i = 0, limit = _socialConditions.size(); i != limit; ++i ){ 
    124                         ((LikeCondition)_socialConditions.get(i)).ReplaceUnboundVariables(variableID); 
     123                        ((SocialCondition)_socialConditions.get(i)).ReplaceUnboundVariables(variableID); 
    125124                } 
    126125        } 
     
    131130                boolean grounded = true; 
    132131                for( int i = 0, limit = _socialConditions.size(); i != limit; ++i ){ 
    133                         if( !((LikeCondition)_socialConditions.get(i)).isGrounded() ){ 
     132                        if( !((SocialCondition)_socialConditions.get(i)).isGrounded() ){ 
    134133                                grounded = false; 
    135134                                break; 
  • AgentMind/branches/FAtiMA-Modular/FAtiMA.culture/src/FAtiMA/culture/CultureLoaderHandler.java

    r696 r709  
    363363                _contextBeingParsed.SetPlaceCondition( PlaceCondition.Parse(attributes) ); 
    364364        } 
     365 
     366        public void Social(Attributes attributes ) throws ContextParsingException{ 
     367                if( _contextBeingParsed == null ) 
     368                        throw new ContextParsingException("Trying to parse a SocialCondition outside of a Context"); 
     369 
     370                _contextBeingParsed.AddSocialCondition( SocialCondition.Parse(attributes) ); 
     371        } 
    365372} 
Note: See TracChangeset for help on using the changeset viewer.