|
From: | Petros Petrou |
Subject: | simpleSwarmBug3 and simpleObserverBug |
Date: | Tue, 26 Mar 2002 14:26:01 +1100 |
Hi,
(I already sent this message to swarm Announce but then I realized that I
should have sent it to swarm Support. I apologize for this and I hope I haven't
created any confusion.)
I am a java programmer (and a begginer with
swarm) and I am currently working on research project related to swarm
libraries. The first part of my project is to translate the Bug tutorials from
Objective C to Java. I did this for the first 5 tutorials but I am now facing
few problems that I don't know how to approach them. (The OS I am working with
is Redhat 7.1 and the java compiler is the jdk1.3.1_02)
FIRST PROBLEM
----------------------------
As I mentioned above I managed to succesfully
translate the first 5 tutorials. In order to translate the 6th tutorial
(simpleSwarmBug3) I only have to replace one line in my Main.java source
file of the simpleSwarmBug2. The change is the following:
I REPLACED THIS LINE:
modelSwarm = new
ModelSwarm(Globals.env.globalZone);
WITH THE FOLLOWING:
ModelSwarm
modelSwarm=(ModelSwarm)Globals.env.lispAppArchiver.getWithZone$key(Globals.env.globalZone,"modelSwarm");
if(modelSwarm==null){ System.out.println("Can't find the modelSwarm parameters"); return; }
THE bug.scm FILE RESIDING IN THE SAME DIRECTORY IS
THE FOLLOWING
(list
(cons 'modelSwarm (make-instance 'ModelSwarm #:worldXSize 80 #:worldYSize 80 #:seedProb 0.9F0 #:bugDensity 0.02F0))) THE RESULT ARE:
After running the program I am getting the message
"Can't find the modelSwarm parameters" which means the lispAppArchiver did not
create the object.
SECOND PROBLEM
------------------------------
In my attempt to translate the simpleObserverBug
tutorial I am receiving the following compiler error message
(the following is the result of a call to
the printStackTrace() method of the exception thrown by the following
line of code
displayActions.createActionTo$message(foodDisplay,
new Selector(Class.forName("Value2dDisplayImpl"), "display",
false));)
/******************** Compiling simpleObserverBug
**************************/
java.lang.ClassNotFoundException: Value2dDisplayImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:299) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) at java.lang.ClassLoader.loadClass(ClassLoader.java:255) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at ObserverSwarm.buildActions(ObserverSwarm.java:102) at Main.main(Main.java:11) /*************************************************************************************/ Could you please provide me with any suggestions or
hints as to how I could approach the above problems.
Many Thanks,
Petros
Petrou |
[Prev in Thread] | Current Thread | [Next in Thread] |