Changeset 730
- Timestamp:
- 11/17/2010 03:18:31 PM (10 years ago)
- Location:
- AgentMind/branches/FAtiMA-Modular
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
AgentMind/branches/FAtiMA-Modular/AgentLauncher/.classpath
r724 r730 5 5 <classpathentry combineaccessrules="false" kind="src" path="/FAtiMA"/> 6 6 <classpathentry combineaccessrules="false" kind="src" path="/FAtiMA.MotivationalSystem"/> 7 <classpathentry combineaccessrules="false" kind="src" path="/FAtiMA.SocialRelations"/> 7 8 <classpathentry kind="output" path="bin"/> 8 9 </classpath> -
AgentMind/branches/FAtiMA-Modular/AgentLauncher/src/AgentLauncher.java
r724 r730 9 9 import FAtiMA.Core.exceptions.GoalLibParsingException; 10 10 import FAtiMA.Core.exceptions.UnknownGoalException; 11 import FAtiMA.socialRelations.SocialRelationsComponent; 11 12 12 13 public class AgentLauncher { … … 24 25 25 26 26 AgentCore aG = initializeAgentCore(args); 27 AgentCore aG = initializeAgentCore(args); 28 aG.addComponent(new SocialRelationsComponent()); 27 29 28 30 aG.StartAgent(); … … 39 41 String agentName = args[1]; 40 42 41 FAtiMA.Core.AgentCore agent = new AgentCore( );43 FAtiMA.Core.AgentCore agent = new AgentCore(agentName); 42 44 agent.initialize(scenarioName,agentName); 43 45 -
AgentMind/branches/FAtiMA-Modular/FAtiMA.AdvancedMemory/src/main/java/FAtiMA/advancedMemoryComponent/AdvancedMemoryComponent.java
r727 r730 45 45 import FAtiMA.Core.emotionalState.ActiveEmotion; 46 46 import FAtiMA.Core.emotionalState.AppraisalStructure; 47 import FAtiMA.Core.memory.episodicMemory.ActionDetail; 47 48 import FAtiMA.Core.memory.episodicMemory.EpisodicMemory; 48 49 import FAtiMA.Core.sensorEffector.Event; … … 201 202 @Override 202 203 public void appraisal(Event e, AppraisalStructure as, AgentModel am) { 203 // TODO Auto-generated method stub 204 204 205 Event event2; 206 207 //self evaluation 208 event2 = e.ApplyPerspective(am.getName()); 209 210 //appraisal from memory 211 ActionDetail ad = new ActionDetail(0,event2.GetSubject(), 212 event2.GetAction(), 213 event2.GetTarget(), 214 event2.GetParameters(),null,null,null,null); 215 216 _compoundCue.Match(ad,am.getMemory().getEpisodicMemory()); 217 218 ActionDetail result = _compoundCue.getStrongestResult(); 219 //float eval = _compoundCue.getEvaluation(); 220 if(result != null) 221 { 222 float desirability = result.getDesirability(); 223 if(desirability != 0) 224 { 225 as.SetAppraisalVariable(AdvancedMemoryComponent.NAME, (short)3, AppraisalStructure.DESIRABILITY, desirability); 226 } 227 } 205 228 } 206 229 -
AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/AgentCore.java
r729 r730 60 60 public static final String MIND_PATH_ANDROID = "sdcard/data/characters/minds/"; 61 61 public static final String SCENARIO_FILENAME = "LIRECScenarios.xml"; 62 62 63 private static final Name ACTION_CONTEXT = Name.ParseName("ActionContext()"); 63 64 … … 90 91 91 92 92 public AgentCore(){ 93 public AgentCore(String name){ 94 _name = name; 93 95 _shutdown = false; 94 96 _numberOfCycles = 0; … … 102 104 _memory.getEpisodicMemory().StartEpisode(_memory); 103 105 _strat = this; 106 _components = new HashMap<String,IComponent>(); 104 107 AgentSimulationTime.GetInstance(); //This call will initialize the timer for the agent's simulation time 105 108 } … … 116 119 try{ 117 120 AgentLogger.GetInstance().initialize(_name,_showStateWindow); 118 121 122 _showStateWindow = ConfigurationManager.getDisplayMode(); 123 _displayName = ConfigurationManager.getDisplayName(); 124 _role = ConfigurationManager.getRole(); 125 _sex = ConfigurationManager.getSex(); 126 127 if(_showStateWindow && !VersionChecker.runningOnAndroid()){ 128 _agentDisplay = new AgentDisplay(this); 129 } 119 130 120 131 // Load Plan Operators … … 755 766 _remoteAgent.start(); 756 767 757 if(_showStateWindow && !VersionChecker.runningOnAndroid()){758 _agentDisplay = new AgentDisplay(this);759 }760 761 768 this.Run(); 762 769 } -
AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/emotionalState/AppraisalStructure.java
r693 r730 64 64 _empty = true; 65 65 _appraisal = new ArrayList<HashMap<String,Pair>>(3); 66 _appraisal.add(new HashMap<String,Pair>()); 67 _appraisal.add(new HashMap<String,Pair>()); 68 _appraisal.add(new HashMap<String,Pair>()); 66 69 _appraisalOfOthers = new HashMap<String,AppraisalStructure>(); 67 70 } … … 162 165 boolean aux = _changed; 163 166 _changed = false; 167 for(AppraisalStructure as : _appraisalOfOthers.values()) 168 { 169 as.hasChanged(); 170 } 164 171 return aux; 165 172 } -
AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/reactiveLayer/ReactiveProcess.java
r717 r730 167 167 selfEvaluation = Evaluate(ag, event2); 168 168 169 if(selfEvaluation ._desirability!= null)169 if(selfEvaluation != null) 170 170 { 171 as.SetAppraisalVariable(NAME, (short)5, AppraisalStructure.DESIRABILITY, selfEvaluation._desirability.intValue()); 172 } 173 if(selfEvaluation._desirabilityForOther != null) 174 { 175 as.SetAppraisalVariableOfOther(selfEvaluation._other.toString(), NAME, (short)5, AppraisalStructure.DESIRABILITY, selfEvaluation._desirabilityForOther.intValue()); 176 } 177 if(selfEvaluation._praiseworthiness != null) 178 { 179 as.SetAppraisalVariable(NAME, (short)5, AppraisalStructure.PRAISEWORTHINESS, selfEvaluation._praiseworthiness.intValue()); 180 } 181 if(selfEvaluation._like != null) 182 { 183 as.SetAppraisalVariable(NAME, (short)5, AppraisalStructure.LIKE, selfEvaluation._like.intValue()); 184 } 185 186 187 //TODO move this code to the memory appraisal 188 /*if(ag.getCompoundCue() != null) 189 { 190 //appraisal from memory 191 ActionDetail ad = new ActionDetail(0,event2.GetSubject(), 192 event2.GetAction(), 193 event2.GetTarget(), 194 event2.GetParameters(),null,null,null,null); 195 196 ag.getCompoundCue().Match(ad,ag.getMemory().getEpisodicMemory()); 197 198 ActionDetail result = ag.getCompoundCue().getStrongestResult(); 199 float eval = ag.getCompoundCue().getEvaluation(); 200 if(result != null) 171 if(selfEvaluation._desirability != null) 201 172 { 202 float desirability = result.getDesirability(); 203 if(desirability != 0) 204 { 205 v = new AppraisalVector(); 206 v.setAppraisalVariable(AppraisalVector.DESIRABILITY, desirability*eval); 207 } 208 } 209 }*/ 210 211 //TODO do this in the ToM component 212 /*if(ag.getToM() != null) 213 { 214 215 // generating fortune of others emotions 216 for(String other : ag.getNearByAgents()) 173 as.SetAppraisalVariable(NAME, (short)5, AppraisalStructure.DESIRABILITY, selfEvaluation._desirability.intValue()); 174 } 175 if(selfEvaluation._desirabilityForOther != null && selfEvaluation._other != null) 217 176 { 218 event3 = event.ApplyPerspective(other); 219 ModelOfOther m = ag.getToM().get(other); 220 otherEvaluation = Evaluate(m, event3); 221 v = new AppraisalVector(); 222 if(selfEvaluation != null && selfEvaluation.getDesirability() != null) 223 { 224 v.setAppraisalVariable(AppraisalVector.DESIRABILITY, selfEvaluation.getDesirability()); 225 } 226 227 if(otherEvaluation != null && otherEvaluation.getDesirability() != null) 228 { 229 v.setAppraisalVariable(AppraisalVector.DESIRABILITY_FOR_OTHER, otherEvaluation.getDesirability()); 230 } 231 232 233 emotionForOther = FAtiMA.emotionalState.Appraisal.GenerateEmotionForOther( 234 ag, 235 event2, 236 v, 237 other); 238 if(emotionForOther != null) 239 { 240 ag.getEmotionalState().AddEmotion(emotionForOther, ag); 241 } 242 } 243 }*/ 177 as.SetAppraisalVariableOfOther(selfEvaluation._other.toString(), NAME, (short)5, AppraisalStructure.DESIRABILITY, selfEvaluation._desirabilityForOther.intValue()); 178 } 179 if(selfEvaluation._praiseworthiness != null) 180 { 181 as.SetAppraisalVariable(NAME, (short)5, AppraisalStructure.PRAISEWORTHINESS, selfEvaluation._praiseworthiness.intValue()); 182 } 183 if(selfEvaluation._like != null) 184 { 185 as.SetAppraisalVariable(NAME, (short)5, AppraisalStructure.LIKE, selfEvaluation._like.intValue()); 186 } 187 } 244 188 } 245 189 -
AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/util/ConfigurationManager.java
r667 r730 63 63 parser.parse(new File(scenarioFileName), scenHandler); 64 64 //side-effects 65 scenHandler.checkForAgent(); 66 65 67 getInstance().agentProperties = scenHandler.getAgentProperties(); 66 68 getInstance().agentConfiguration = scenHandler.getAgentConfiguration(); -
AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/util/parsers/ScenarioLoaderHandler.java
r667 r730 18 18 private HashMap<String,String> _agentProperties; 19 19 private HashMap<String,String> _agentConfiguration; 20 private boolean _foundScenario; 21 private boolean _foundAgent; 20 22 21 23 … … 25 27 this._worldSimArgs = new ArrayList<String>(); 26 28 this._agentConfiguration = new HashMap<String,String>(); 27 this._isPretendedScenario = false; 29 this._isPretendedScenario = false; 30 this._foundScenario = false; 28 31 } 29 32 … … 37 40 this._isPretendedScenario = false; 38 41 this._isPretendedCharacter = false; 42 this._foundAgent = false; 43 this._foundScenario = false; 39 44 40 45 } … … 56 61 if(_scenarioName.equalsIgnoreCase(attributes.getValue("name"))){ 57 62 this._isPretendedScenario = true; 63 this._foundScenario = true; 58 64 }else{ 59 65 this._isPretendedScenario = false; … … 73 79 } 74 80 81 public void checkForAgent() 82 { 83 checkScenario(); 84 if(_foundAgent == false) 85 { 86 throw new RuntimeException("Could not find agent: " + this._characterName); 87 } 88 } 89 90 public void checkScenario() 91 { 92 if(_foundScenario == false) 93 { 94 throw new RuntimeException("Could not find scenario: " + this._scenarioName); 95 } 96 } 97 75 98 76 99 public void Object(Attributes attributes){ … … 84 107 if(_characterName.equalsIgnoreCase(attributes.getValue("name"))){ 85 108 this._isPretendedCharacter = true; 109 this._foundAgent = true; 86 110 87 111 for(int i=0; i < attributes.getLength(); i++ ){ -
AgentMind/branches/FAtiMA-Modular/LIRECOptionsUser.txt
r394 r730 1 1 User AskLocation SarahReview Amy 2 user GreetBack Abbuk 3 user GreetBack Errep 4 user GreetBack Ikop 5 user GreetBack Evui 6 user GreetWrongly Abbuk 7 user GreetWrongly Errep 8 user GreetWrongly Ikop 9 user GreetWrongly Evui 10 user ApproachTree tree 11 user UserPickFromGround apple 12 user UserPickFromTree apple 13 user PickFromTable drink 14 user Eat apple 15 user Drink liquid 16 user AcceptInvitation Abbuk meal 17 user RejectInvitation Abbuk meal 18 user AcceptFood Abbuk apple 19 user RejectOffer Abbuk apple 20 user AcceptInvitation Ikop meal 21 user RejectInvitation Ikop meal 22 user AcceptFood Ikop apple 23 user RejectOffer Ikop apple 24 user MeteorHit Errep 25 user HealDyingSpryte Errep 26 user Apologise Abbuk 27 user Apologise Errep 28 user Apologise Ikop 29 user Apologise Evui 30 user GiveAttention Evui -
AgentMind/branches/FAtiMA-Modular/WorldTest/src/WorldTest.java
r718 r730 56 56 SAXParser parser = factory.newSAXParser(); 57 57 parser.parse(new File(SCENARIOS_PATH), scenHandler); 58 59 scenHandler.checkScenario(); 58 60 args = scenHandler.getWorldSimArguments(); 59 61 } -
AgentMind/branches/FAtiMA-Modular/data/characters/minds/roles/SarahReview/SarahReview.xml
r428 r730 41 41 <Relation target="User" like="2" respect="1"/> 42 42 </InterpersonalRelations> 43 44 <EventReactions> 45 46 <EmotionalReaction desirability="2" desirabilityForOther="5" praiseworthiness="-2" other="[Target]"> 47 <Event action="GreetBack"/> 48 </EmotionalReaction> 49 </EventReactions> 43 50 </Character>
Note: See TracChangeset
for help on using the changeset viewer.