The only thing you have to do, is to write a class which extends the class nano.compute.Simulator and to implement
the following methods:
The Constructor
The run() method.
Constructor
It is common to make use of the constructor of the superclass and add some specific statements.
For this purpose you may use an init() method. So your constructor becomes the following form:
public DemoSimulator(){
super();
init();
}
The run() method
The simulation itself, i. e. the computation of physical quantities takes place in the run method.
It typically consists of a while loop. Since the simulator runs in an independent thread, you have to let
this thread sleep from time to time. So your computer gets time to do other computations than just
simulating a physical system.
public void run(){
while(true){
your simulation code
System.out.print("I?m simulating.");
try{sleep(100);}catch (InterruptedException e){} //Sleep
}
}