|
From: <jom...@us...> - 2008-05-07 08:15:40
|
Revision: 1293
http://jason.svn.sourceforge.net/jason/?rev=1293&view=rev
Author: jomifred
Date: 2008-05-07 01:15:38 -0700 (Wed, 07 May 2008)
Log Message:
-----------
fix bug in desire (related to source(self) in goals)
Modified Paths:
--------------
trunk/applications/jason-team/src/asl/exploration.asl
trunk/applications/jason-team/src/asl/gaucho.asl
trunk/applications/jason-team/src/asl/herding.asl
trunk/src/jason/asSemantics/Agent.java
trunk/src/jason/stdlib/desire.java
trunk/src/jason/stdlib/wait.java
Modified: trunk/applications/jason-team/src/asl/exploration.asl
===================================================================
--- trunk/applications/jason-team/src/asl/exploration.asl 2008-05-06 22:06:56 UTC (rev 1292)
+++ trunk/applications/jason-team/src/asl/exploration.asl 2008-05-07 08:15:38 UTC (rev 1293)
@@ -38,7 +38,7 @@
agent_id(Me,AgId) &
AgId mod 2 == 1 // I have an odd Id
<- !create_exploration_gr.
-
+
+!create_exploration_gr
<- .my_name(Me);
@@ -61,8 +61,8 @@
// wait others pos
.while( .count(ally_pos(_,_,_), N) & N < 5 ) {
- .print("ooo waiting others pos ");
- .wait("+ally_pos(_,_,_)", 500, nofail)
+ .print("ooo waiting others pos ");
+ .wait("+ally_pos(_,_,_)", 500, _)
};
// find distance to even agents
Modified: trunk/applications/jason-team/src/asl/gaucho.asl
===================================================================
--- trunk/applications/jason-team/src/asl/gaucho.asl 2008-05-06 22:06:56 UTC (rev 1292)
+++ trunk/applications/jason-team/src/asl/gaucho.asl 2008-05-07 08:15:38 UTC (rev 1293)
@@ -101,7 +101,7 @@
+!change_role(R,G)
- : .my_name(Me) & play(Me, R,G).
+ : .my_name(Me) & play(Me,R,G).
+!change_role(NewRole,GT)[source(S)]
: not .desire(change_role(_,_)) // to not trigger two change of role
Modified: trunk/applications/jason-team/src/asl/herding.asl
===================================================================
--- trunk/applications/jason-team/src/asl/herding.asl 2008-05-06 22:06:56 UTC (rev 1292)
+++ trunk/applications/jason-team/src/asl/herding.asl 2008-05-07 08:15:38 UTC (rev 1293)
@@ -81,6 +81,7 @@
}.
+!check_merge.
+
{ begin maintenance_goal("+pos(_,_,_)") }
+!define_formation[scheme(Sch),mission(Mission)]
Modified: trunk/src/jason/asSemantics/Agent.java
===================================================================
--- trunk/src/jason/asSemantics/Agent.java 2008-05-06 22:06:56 UTC (rev 1292)
+++ trunk/src/jason/asSemantics/Agent.java 2008-05-07 08:15:38 UTC (rev 1293)
@@ -353,6 +353,8 @@
public void addInitialGoalsInTS() {
for (Literal g: initialGoals) {
g.makeVarsAnnon();
+ if (! g.hasSource())
+ g.addAnnot(BeliefBase.TSelf);
getTS().getC().addAchvGoal(g,Intention.EmptyInt);
}
}
Modified: trunk/src/jason/stdlib/desire.java
===================================================================
--- trunk/src/jason/stdlib/desire.java 2008-05-06 22:06:56 UTC (rev 1292)
+++ trunk/src/jason/stdlib/desire.java 2008-05-07 08:15:38 UTC (rev 1293)
@@ -79,7 +79,7 @@
public boolean desires(Circumstance C, Literal l, Unifier un) {
Trigger teFromL = new Trigger(TEOperator.add, TEType.achieve, l);
- // we need to check the slected event in this cycle (already removed from E)
+ // we need to check the selected event in this cycle (already removed from E)
if (C.getSelectedEvent() != null) {
Trigger t = C.getSelectedEvent().getTrigger();
Intention i = C.getSelectedEvent().getIntention();
@@ -87,7 +87,7 @@
t = (Trigger) t.clone();
t.apply(i.peek().getUnif());
}
- if (un.unifies(t, teFromL)) {
+ if (un.unifies(teFromL, t)) {
return true;
}
}
@@ -99,7 +99,7 @@
t = (Trigger) t.clone();
t.apply(i.peek().getUnif());
}
- if (un.unifies(t, teFromL)) {
+ if (un.unifies(teFromL, t)) {
return true;
}
}
Modified: trunk/src/jason/stdlib/wait.java
===================================================================
--- trunk/src/jason/stdlib/wait.java 2008-05-06 22:06:56 UTC (rev 1292)
+++ trunk/src/jason/stdlib/wait.java 2008-05-07 08:15:38 UTC (rev 1293)
@@ -237,7 +237,6 @@
e.printStackTrace();
}
}
- //elapseTime = System.currentTimeMillis() - init;
}
synchronized public void eventAdded(Event e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|