|
From: <jom...@us...> - 2008-05-28 20:06:03
|
Revision: 1314
http://jason.svn.sourceforge.net/jason/?rev=1314&view=rev
Author: jomifred
Date: 2008-05-28 13:05:55 -0700 (Wed, 28 May 2008)
Log Message:
-----------
jason team: minor fixes
Modified Paths:
--------------
trunk/applications/jason-team/src/asl/exploration.asl
trunk/applications/jason-team/src/java/arch/ACArchitecture.java
trunk/applications/jason-team/src/java/jia/cluster.java
Modified: trunk/applications/jason-team/src/asl/exploration.asl
===================================================================
--- trunk/applications/jason-team/src/asl/exploration.asl 2008-05-27 19:28:36 UTC (rev 1313)
+++ trunk/applications/jason-team/src/asl/exploration.asl 2008-05-28 20:05:55 UTC (rev 1314)
@@ -147,9 +147,8 @@
!ask_all_cows(Leaders,LCows);
.findall(cow(ID,X,Y), cow(ID,X,Y), MyCows);
.intersection(MyCows, LCows, Common);
- .print("xxx all cows in herding groups are ",LCows," my are ",MyCows," intersection is ",Common);
+ //.print("xxx all cows in herding groups are ",LCows," my are ",MyCows," intersection is ",Common);
if ( Common == [] ) {
- .print("xxx start herding");
!!create_herding_gr
}{
!check_small_herd_grp(Leaders)
@@ -162,7 +161,7 @@
+!ask_all_cows([],[]).
+!ask_all_cows([L|Leaders],Cows)
<- .send(L,askAll,cow(_,_,_),LC);
- .print("xxx cows from ",L," are ",LC);
+ //.print("xxx cows from ",L," are ",LC);
!ask_all_cows(Leaders,RC);
.concat(LC,RC,Cows).
@@ -171,9 +170,8 @@
+!check_small_herd_grp([L|Leaders])
<- .send(L,askAll,play(_, herdboy, _), LBoys);
.send(L,askOne,current_cluster(_),current_cluster(LCluster));
- .print("xxx boys of ",L," are ",LBoys," his cluster size is ", .length(LCluster));
+ //.print("xxx boys of ",L," are ",LBoys," his cluster size is ", .length(LCluster));
if (.length(LBoys) < 2 & .length(LCluster) > 10) {
- .print("xxx start herding");
!!create_herding_gr
}{
!check_small_herd_grp(Leaders)
Modified: trunk/applications/jason-team/src/java/arch/ACArchitecture.java
===================================================================
--- trunk/applications/jason-team/src/java/arch/ACArchitecture.java 2008-05-27 19:28:36 UTC (rev 1313)
+++ trunk/applications/jason-team/src/java/arch/ACArchitecture.java 2008-05-28 20:05:55 UTC (rev 1314)
@@ -221,6 +221,7 @@
try {
lastAction = null;
waitSleep();
+
if (lastAction != null) {
lastActionInCurrentCycle = lastAction.getActionTerm().getTerm(0).toString();
proxy.sendAction(lastActionInCurrentCycle);
Modified: trunk/applications/jason-team/src/java/jia/cluster.java
===================================================================
--- trunk/applications/jason-team/src/java/jia/cluster.java 2008-05-27 19:28:36 UTC (rev 1313)
+++ trunk/applications/jason-team/src/java/jia/cluster.java 2008-05-28 20:05:55 UTC (rev 1314)
@@ -29,7 +29,7 @@
*/
public class cluster extends DefaultInternalAction {
- private static final int MAXCLUSTERSIZE = 25;
+ private static final int MAXCLUSTERSIZE = 15;
@Override
public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
@@ -81,7 +81,8 @@
for (Vec v: cows)
vs.add(v.sub(mean));
- Collections.sort(vs);
+ if (vs.size() > 4)
+ Collections.sort(vs); // sort only big clusters (for small clusters, to sort causes a kind of oscillation)
List<Vec> cs = new ArrayList<Vec>();
if (!vs.isEmpty())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|