|
From: <jom...@us...> - 2008-04-27 18:25:32
|
Revision: 1275
http://jason.svn.sourceforge.net/jason/?rev=1275&view=rev
Author: jomifred
Date: 2008-04-27 11:25:28 -0700 (Sun, 27 Apr 2008)
Log Message:
-----------
add a constant to define the distance between agents in a formation
Modified Paths:
--------------
trunk/applications/jason-team/src/java/jia/herd_position.java
trunk/src/jason/stdlib/wait.java
Modified: trunk/applications/jason-team/src/java/jia/herd_position.java
===================================================================
--- trunk/applications/jason-team/src/java/jia/herd_position.java 2008-04-27 18:11:57 UTC (rev 1274)
+++ trunk/applications/jason-team/src/java/jia/herd_position.java 2008-04-27 18:25:28 UTC (rev 1275)
@@ -33,15 +33,18 @@
public class herd_position extends DefaultInternalAction {
public static final double maxStdDev = 3;
+ public static final int agDistanceInFormation = 4;
public enum Formation {
one { int[] getDistances() { return new int[] { 0 }; } },
- two { int[] getDistances() { return new int[] { 2, -2 }; } },
- three { int[] getDistances() { return new int[] { 0, 4, -4 }; } },
- four { int[] getDistances() { return new int[] { 2, -2, 6, -6 }; } },
- five { int[] getDistances() { return new int[] { 0, 4, -4, 8, -8 }; } },
- six { int[] getDistances() { return new int[] { 2, -2, 6, -6, 10, -10 }; } };
+ two { int[] getDistances() { return new int[] { sd, -sd }; } },
+ three { int[] getDistances() { return new int[] { 0, d, -d }; } },
+ four { int[] getDistances() { return new int[] { sd, -sd, d+sd, -(d+sd) }; } },
+ five { int[] getDistances() { return new int[] { 0, d, -d, d*2, -d*2 }; } },
+ six { int[] getDistances() { return new int[] { sd, -sd, d+sd, -(d+sd), d*2+sd, -(d*2+sd) }; } };
abstract int[] getDistances();
+ private static final int d = agDistanceInFormation;
+ private static final int sd = agDistanceInFormation/2;
};
@Override
Modified: trunk/src/jason/stdlib/wait.java
===================================================================
--- trunk/src/jason/stdlib/wait.java 2008-04-27 18:11:57 UTC (rev 1274)
+++ trunk/src/jason/stdlib/wait.java 2008-04-27 18:25:28 UTC (rev 1275)
@@ -54,7 +54,7 @@
<code>"+!go(X,Y)"</code>.
Although the argument is a string, the variables
- in the string will be unified with the event, i.e., the unifier have
+ in the string will be unified with the event, i.e., the unifier might have
values for X and Y after the execution of <code>.wait("+!go(X,Y)")</code>.
<p>Parameters:<ul>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|