|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.tinyos.sim.script.reflect.SimReflect | +--net.tinyos.sim.script.reflect.Sim
The Sim class controls high-level operations on the simulation, including pause/resume and execution control.
The class is bound into the simcore module as the sim global instance.
Field Summary | |
---|---|
net.tinyos.sim.SimDriver |
__driver
Backdoor handle on the SimDriver internal object. |
java.lang.String[] |
argv
Array version of the arguments passed in the -scriptargs command line argument. |
Constructor Summary | |
---|---|
Sim(net.tinyos.sim.script.ScriptInterpreter interp,
net.tinyos.sim.SimDriver driver)
Constructor for the Sim object. |
Method Summary | |
---|---|
void |
dumpDBG(java.lang.String filename)
Starts dumping debug messages to the given file. |
void |
exec(java.lang.String executable,
int numMotes)
Run the simulator and block until the driver connects. |
void |
exec(java.lang.String executable,
int numMotes,
java.lang.String args)
Run the simulator and block until the driver connects. |
void |
exit()
Exits the simulator environment with an error code of 0. |
void |
exit(int errcode)
Exits the simulator environment with the given error code. |
long |
getTossimTime()
Returns the current simulator time. |
int |
getWorldHeight()
Returns the height of the simulator 'world' in logical space units. |
int |
getWorldWidth()
Returns the width of the simulator 'world' in logical space units. |
boolean |
isPaused()
Indicates whether or not the simulator is paused. |
void |
loadPlugin(java.lang.String pluginName)
Load the requested plugin. |
net.tinyos.sim.script.reflect.SimObject |
newSimObject()
Create a new generic SimObject. |
net.tinyos.sim.script.reflect.SimObject |
newSimObject(int size,
double x,
double y)
Create a new generic SimObject. |
void |
pause()
Pauses the simulation. |
void |
reset()
Reset the simulator, stopping the current simulation process and clearing out all internal state. |
void |
resume()
Resumes the simulation. |
void |
setSimDelay(long delay_ms)
Sets the logical simulator delay. |
void |
stop()
Stops the simulator execution. |
void |
stopDBGDump()
Stops dumping debug messages. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public net.tinyos.sim.SimDriver __driver
public java.lang.String[] argv
Constructor Detail |
public Sim(net.tinyos.sim.script.ScriptInterpreter interp, net.tinyos.sim.SimDriver driver)
Method Detail |
public void pause()
public void resume()
public boolean isPaused()
public void stop()
public int getWorldWidth()
public int getWorldHeight()
public long getTossimTime()
public void exit(int errcode)
errcode
- the exit status codepublic void exit()
public void setSimDelay(long delay_ms)
delay_ms
- delay in millisecondspublic void dumpDBG(java.lang.String filename) throws java.io.IOException
filename
- path to the file for debug output
java.io.IOException
public void stopDBGDump() throws java.io.IOException
java.io.IOException
public void exec(java.lang.String executable, int numMotes, java.lang.String args) throws java.io.IOException
executable
- path to the executablenumMotes
- number of motes to runargs
- argument string
java.io.IOException
public void exec(java.lang.String executable, int numMotes) throws java.io.IOException
executable
- path to the executablenumMotes
- number of motes to run
java.io.IOException
public void reset()
public net.tinyos.sim.script.reflect.SimObject newSimObject(int size, double x, double y)
public net.tinyos.sim.script.reflect.SimObject newSimObject()
public void loadPlugin(java.lang.String pluginName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |