|
From: <jom...@us...> - 2008-05-24 15:15:45
|
Revision: 1301
http://jason.svn.sourceforge.net/jason/?rev=1301&view=rev
Author: jomifred
Date: 2008-05-24 08:15:42 -0700 (Sat, 24 May 2008)
Log Message:
-----------
jason team: dump the mind of all agents
Modified Paths:
--------------
trunk/applications/jason-moise/lib/moise.jar
trunk/applications/jason-team/gauchos.xml
trunk/applications/jason-team/src/asl/exploration.asl
trunk/applications/jason-team/src/asl/gaucho.asl
trunk/applications/jason-team/src/java/arch/WriteStatusThread.java
trunk/applications/jason-team/src/team-os.xml
Modified: trunk/applications/jason-moise/lib/moise.jar
===================================================================
(Binary files differ)
Modified: trunk/applications/jason-team/gauchos.xml
===================================================================
--- trunk/applications/jason-team/gauchos.xml 2008-05-24 13:26:51 UTC (rev 1300)
+++ trunk/applications/jason-team/gauchos.xml 2008-05-24 15:15:42 UTC (rev 1301)
@@ -93,7 +93,7 @@
<target name="run" depends="compile" >
<delete failonerror="no" includeEmptyDirs="true" verbose="false">
- <fileset dir="mind-ag-gaucho1" includes="*.xml"/>
+ <fileset dir="mind-ag" includes="**/*.xml"/>
</delete>
<echo message="Running project ${ant.project.name}" />
Modified: trunk/applications/jason-team/src/asl/exploration.asl
===================================================================
--- trunk/applications/jason-team/src/asl/exploration.asl 2008-05-24 13:26:51 UTC (rev 1300)
+++ trunk/applications/jason-team/src/asl/exploration.asl 2008-05-24 15:15:42 UTC (rev 1301)
@@ -23,9 +23,7 @@
agent_id(Me,AgId) &
AgId mod 2 == 1 & // I have an odd Id and thus have to create a exploring group
not .intend(create_exploration_gr)
- <- .my_name(Me);
-
- // create the team, if necessary
+ <- // create the team, if necessary
if( Me == gaucho1 & not group(team,_) ) {
jmoise.create_group(team)
};
Modified: trunk/applications/jason-team/src/asl/gaucho.asl
===================================================================
--- trunk/applications/jason-team/src/asl/gaucho.asl 2008-05-24 13:26:51 UTC (rev 1300)
+++ trunk/applications/jason-team/src/asl/gaucho.asl 2008-05-24 15:15:42 UTC (rev 1301)
@@ -52,14 +52,14 @@
/* -- plans for the goals of all roles -- */
-+!share_seen_cows[scheme(Sch)] <- .print("ooo start sharing cows in scheme ",Sch); .suspend.
+//+!share_seen_cows[scheme(Sch)] <- .print("ooo start sharing cows in scheme ",Sch); .suspend.
// simple implementation of share_cows (see TODO above)
+cow(Id,X,Y)[source(percept)]
- : .intend(share_seen_cows) & .my_name(Me) & play(Me,_,Gr)
+ : .my_name(Me) & play(Me,_,Gr) // .intend(share_seen_cows)
<- jmoise.broadcast(Gr, tell, cow(Id,X,Y)).
-cow(Id,X,Y)[source(percept)]
- : .intend(share_seen_cows) & .my_name(Me) & play(Me,_,Gr)
+ : .my_name(Me) & play(Me,_,Gr) // .intend(share_seen_cows)
<- jmoise.broadcast(Gr, untell, cow(Id,X,Y)).
Modified: trunk/applications/jason-team/src/java/arch/WriteStatusThread.java
===================================================================
--- trunk/applications/jason-team/src/java/arch/WriteStatusThread.java 2008-05-24 13:26:51 UTC (rev 1300)
+++ trunk/applications/jason-team/src/java/arch/WriteStatusThread.java 2008-05-24 15:15:42 UTC (rev 1301)
@@ -57,16 +57,11 @@
reset();
String fileName = "world-status.txt";
- File dirmind = null;
- try {
- dirmind = new File("mind-ag-"+owner.getAgName());
- dirmind.mkdir();
- } catch (Exception e) {
- dirmind = null;
- }
PrintWriter out = null;
try {
+ asl2xml transformer = new asl2xml();
+
out = new PrintWriter(fileName);
PrintWriter map = new PrintWriter("map-status.txt");
while (true) {
@@ -111,19 +106,26 @@
out.flush();
- // store the agent'd mind
- if (dirmind != null) {
- String agmind = new asl2xml().transform(owner.getTS().getAg().getAgState());
- String filename = String.format("%5d.xml",owner.getCycle()).replaceAll(" ","0");
- FileWriter outmind = new FileWriter(new File(dirmind.getName()+"/"+filename));
- outmind.write(agmind);
- outmind.close();
+ // store the agents' mind
+ for (CowboyArch arch : agents) {
+ try {
+ File dirmind = new File("mind-ag/"+arch.getAgName());
+ if (!dirmind.exists())
+ dirmind.mkdirs();
+ String agmind = transformer.transform(arch.getTS().getAg().getAgState());
+ String filename = String.format("%5d.xml",arch.getCycle()).replaceAll(" ","0");
+ FileWriter outmind = new FileWriter(new File(dirmind+"/"+filename));
+ outmind.write(agmind);
+ outmind.close();
+ } catch (Exception e) {
+ System.out.println("error getting agent status "+e);
+ }
}
} catch (InterruptedException e) { // no problem, quit the thread
return;
} catch (Exception e) {
- System.out.println("error getting agent status "+e);
+ System.out.println("error in writing status "+e);
sleep(1000);
}
}
Modified: trunk/applications/jason-team/src/team-os.xml
===================================================================
--- trunk/applications/jason-team/src/team-os.xml 2008-05-24 13:26:51 UTC (rev 1300)
+++ trunk/applications/jason-team/src/team-os.xml 2008-05-24 15:15:42 UTC (rev 1301)
@@ -92,12 +92,12 @@
<mission id="explore" min="1">
<goal id="find_scouter" />
<goal id="goto_near_unvisited" />
- <goal id="share_seen_cows" />
+ <!--goal id="share_seen_cows" /-->
<goal id="change_to_herding" />
</mission>
<mission id="scout" >
<goal id="follow_leader" />
- <goal id="share_seen_cows" />
+ <!--goal id="share_seen_cows" /-->
</mission>
</scheme>
@@ -116,12 +116,12 @@
<goal id="recruit" />
<goal id="define_formation" />
<goal id="be_in_formation" />
- <goal id="share_seen_cows" />
+ <!--goal id="share_seen_cows" /-->
<goal id="change_to_exploring" />
</mission>
<mission id="help_herder" >
<goal id="be_in_formation" />
- <goal id="share_seen_cows" />
+ <!--goal id="share_seen_cows" /-->
</mission>
</scheme>
</functional-specification>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|