changeset 180:481dab56c3dc working

aquarium can execute on mountain lion (with java 1.6)
author e095732
date Thu, 07 Feb 2013 20:07:39 +0900
parents 8d3cb7e5fa57
children 52dcead81b90
files build.xml scripts/aquarium.sh src/alice/codesegment/CodeSegmentManager.java
diffstat 3 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/build.xml	Sun Feb 03 18:29:45 2013 +0900
+++ b/build.xml	Thu Feb 07 20:07:39 2013 +0900
@@ -34,7 +34,7 @@
   <!-- コンパイル -->
   <target name="compile">
     <mkdir dir="${classes}" />
-    <javac encoding="UTF-8" srcdir="src" destdir="${classes}" fork="yes" source="1.6" target="1.6" includeantruntime="false">
+  	<javac encoding="UTF-8" srcdir="src" destdir="${classes}" fork="yes" includeantruntime="false">
       <compilerarg value="-J-Dfile.encoding=UTF8"/>
       <classpath>
 	<pathelement path="lib/junit.jar" />
--- a/scripts/aquarium.sh	Sun Feb 03 18:29:45 2013 +0900
+++ b/scripts/aquarium.sh	Thu Feb 07 20:07:39 2013 +0900
@@ -1,25 +1,17 @@
 #!/bin/bash
-# java="java -version:1.6"
-java="java"
-# export JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.jdk/Contents/Home"
 max=$1
 child_num=$2
-echo 1
+java=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
 ruby ./topology/treen.rb $1 $2 > ./topology/tree.dot
-echo 2
 dot -Tpng ./topology/tree.dot > ./topology/tree.png
 #open ./topology/tree.png
-echo 3
+$java -version
 $java -cp ../Alice.jar alice.topology.manager.TopologyManager -p 10000 -conf ./topology/tree.dot -log ./output/manager.log -level debug > ./output/std_manager.log &
-sleep 3
 
 cnt=0
-#max=`expr $max - 1`
 while [ $cnt -lt $max ]
 do
-     echo 4 $cnt
-    $java -cp  ../Alice.jar alice.test.topology.aquarium.FishMovementTopology -host 192.168.128.41 -port 10000 -p `expr 20000 + $cnt` -log ./output/aquarium${cnt}.log -level debug > ./output/std_aquarium${cnt}.log &
+    $java -cp  ../Alice.jar alice.test.topology.aquarium.FishMovementTopology -host `hostname` -port 10000 -p `expr 20000 + $cnt` -log ./output/aquarium${cnt}.log -level debug > ./output/std_aquarium${cnt}.log &
     cnt=`expr $cnt + 1`
-    sleep 3
 done
 wait
--- a/src/alice/codesegment/CodeSegmentManager.java	Sun Feb 03 18:29:45 2013 +0900
+++ b/src/alice/codesegment/CodeSegmentManager.java	Thu Feb 07 20:07:39 2013 +0900
@@ -11,7 +11,7 @@
 	private static CodeSegmentManager instance = new CodeSegmentManager();
 	public LinkedBlockingQueue<CodeSegment> readyQueue = new LinkedBlockingQueue<CodeSegment>();
 	private ThreadPoolExecutor codeSegmentExecutor = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), // initial number of threads
-												Runtime.getRuntime().availableProcessors(),
+				                                Runtime.getRuntime().availableProcessors(),
 												Integer.MAX_VALUE, // keepAliveTime
 												TimeUnit.SECONDS,
 												new LinkedBlockingQueue<Runnable>());