views:

237

answers:

1

Hello StackOverFlowians

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 myEvent()
 {
  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!

A: 

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

Wilmer Arellano
hey Wilmer thank you for your response, though it turned out to be a problem with my environment variables. its all working well now. though i still have a question for you, do you have any idea where i could obtain an example of ZRP protocol for jist/swans
Nervous_cat