|
NetLogo API version 2.1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.nlogo.workspace.Workspace
org.nlogo.workspace.HeadlessWorkspace
The main class for headless (no GUI) operation of NetLogo.
You may create more than one HeadlessWorkspace object. Multiple instances can operate separately and independently. (Behind the scenes, this is supported by creating a separate thread for each instance.)
When you are done using a HeadlessWorkspace, you should call its dispose() method. This will shut down the thread associated with the workspace and allow resources to be freed.
See the "Controlling" section of the NetLogo User Manual for example code.
Nested Class Summary |
Nested classes inherited from class org.nlogo.workspace.Workspace |
org.nlogo.workspace.Workspace.HubNetManagerFactory |
Field Summary | |
LogoException |
lastLogoException
Internal use only. |
static String |
TEST_DECLARATIONS
Internal use only. |
Fields inherited from class org.nlogo.workspace.Workspace |
evaluator, fileManager, jobManager, OUTPUT_NORMAL, OUTPUT_TO_FILE, OUTPUT_TO_OUTPUT_AREA, profilingTracer, TYPE_CONVERTED, TYPE_LIBRARY, TYPE_NEW, TYPE_NORMAL, world |
Constructor Summary | |
HeadlessWorkspace()
Makes a new instance of NetLogo capable of running a model "headless", with no GUI. |
Method Summary | |
void |
clearOutput()
Internal use only. |
void |
command(String source)
Runs NetLogo commands and waits for them to complete. |
void |
createPatchesNotify()
Internal use only. |
void |
dispose()
Shuts down the background thread associated with this workspace, allowing resources to be freed. |
void |
exportGraphics(String filename,
String format)
Not implemented. |
void |
exportInterface(String filename)
Not implemented. |
boolean |
headless()
Internal use only. |
void |
initForTesting(int sex,
int sey)
Internal use only. |
void |
initForTesting(int sex,
int sey,
String source)
Internal use only. |
void |
inspectAgent(Class agentClass,
org.nlogo.agent.Agent agent)
Internal use only. |
void |
magicOpen(String name)
Internal use only. |
void |
open(String path)
Opens a model stored in a file. |
void |
openFromSource(String source)
Opens a model stored in a string. |
void |
ownerFinished(org.nlogo.nvm.JobOwner owner)
Internal use only. |
void |
periodicUpdate()
Internal use only. |
Object |
report(String source)
Runs a NetLogo reporter. |
void |
resizeWorld(int screenEdgeX,
int screenEdgeY)
Not implemented. |
void |
runtimeError(org.nlogo.nvm.JobOwner owner,
org.nlogo.nvm.Context context,
org.nlogo.command.Instruction instruction,
Exception ex)
Internal use only. |
void |
setModelPath(String path)
Internal use only. |
void |
setModelType(int modelType)
Internal use only. |
void |
updateDisplay(boolean force)
Internal use only. |
Methods inherited from class org.nlogo.workspace.Workspace |
attachModelDir, clearAll, computerHubNetRunning, computerHubNetRunning, convertToNormal, exportBehaviors, exportWorld, forceSaveAs, getDefaultShape, getExtensionManager, getHubNetManager, getModelDir, getModelFileName, getModelPath, getModelType, importWorld, init, isApp, isApp, isApplet, isApplet, modelNameForDisplay, outputObject, resetTimer, warningMessage |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String TEST_DECLARATIONS
public LogoException lastLogoException
Constructor Detail |
public HeadlessWorkspace()
Method Detail |
public void dispose() throws InterruptedException
InterruptedException
public boolean headless()
public void initForTesting(int sex, int sey)
public void initForTesting(int sex, int sey, String source) throws CompilerException
CompilerException
public void resizeWorld(int screenEdgeX, int screenEdgeY)
public void setModelPath(String path)
public void setModelType(int modelType)
public void createPatchesNotify()
public void inspectAgent(Class agentClass, org.nlogo.agent.Agent agent)
public void clearOutput()
public void exportGraphics(String filename, String format)
public void exportInterface(String filename)
public void ownerFinished(org.nlogo.nvm.JobOwner owner)
public void updateDisplay(boolean force)
public void periodicUpdate()
public void magicOpen(String name)
public void runtimeError(org.nlogo.nvm.JobOwner owner, org.nlogo.nvm.Context context, org.nlogo.command.Instruction instruction, Exception ex)
public void open(String path) throws IOException, CompilerException, LogoException
path
- the path (absolute or relative) of the NetLogo model to open.
IOException
CompilerException
LogoException
public void openFromSource(String source) throws CompilerException, LogoException
source
- The complete model, including widgets and so forth,
in the same format as it would be stored in a file.
CompilerException
LogoException
public void command(String source) throws CompilerException, LogoException
source
- The command or commands to run
CompilerException
- if the code fails to compile
LogoException
- if the code fails to runpublic Object report(String source) throws CompilerException, LogoException
source
- The reporter to run
LogoList
,
Agent
, AgentSet, or Nobody
CompilerException
- if the code fails to compile
LogoException
- if the code fails to run
|
NetLogo API version 2.1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |