How to set the runtime of JiST/SWANS within eclipse
This is my first post on the forum, hope all of you guys are well.
I've got a issue using JiST/SWANS, the ad hoc simulator in java within eclipse.
I managed to load the API, (as an external JAR ofcourse) but Im basically having a problem integrating the runtime of JiST within eclipse. After running the hello world im usually getting a stackoverflowerror exception, since it may need modifications within the runtime.
import jist.runtime.JistAPI;
public class hello implements JistAPI.Entity {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("simulation start");
hello t = new hello();
t.myEvent();
}
public void myEv开发者_如何学JAVAent()
{
JistAPI.sleep(1);
myEvent();
System.out.println("hello world, t=" + JistAPI.getTime());
}
}
the website is: http://jist.ece.cornell.edu/index.html
Thank you in advance!
Actually you need to run Main.java within jist.runtime. But before rigth click Main.java, properties, Run/Debug settings, New,Arguments and type your class name (plain name no .java needed) in Progam arguments. This will tell the jist interface to translate your code using the rewriter and run it.
Examples:
To run hello.java type "hello"
To run aodvsim.java type: "jist.swans.Main driver.aodvsim"
If there are arguments needed type them after the clas name like: "jist.swans.Main driver.aodvsim -n 25 -f 2000x2000 -a grid:5x5 -t 10,600,60"
Wilmer Arellano
How well does SWANS work? Given that the documentation and code date back to 2005, I am not sure if this is the best platform to use.
精彩评论