java.lang.Objectorg.nlogo.workspace.AbstractWorkspace
public abstract class AbstractWorkspace
| Nested Class Summary | |
|---|---|
static interface |
AbstractWorkspace.HubNetManagerFactory
|
| Nested classes/interfaces inherited from interface org.nlogo.nvm.Workspace |
|---|
Workspace.BehaviorSpaceFormat, Workspace.OutputDestination, Workspace.UpdateMode |
| Field Summary | |
|---|---|
WeakHashMap<String,Procedure> |
codeBits
|
static String |
DEFAULT_PREVIEW_COMMANDS
previewCommands used by make-preview and model test |
JobManagerInterface |
jobManager
|
String |
previewCommands
|
World |
world
|
| Method Summary | |
|---|---|
void |
addJobFromJobThread(Job job)
|
String |
attachModelDir(String filePath)
attaches the current model directory to a relative path, if necessary. |
String |
autoConvert(String source,
boolean subprogram,
boolean reporter,
String modelVersion)
|
org.nlogo.util.MersenneTwisterFast |
auxRNG()
|
int |
behaviorSpaceRunNumber()
|
void |
behaviorSpaceRunNumber(int n)
|
void |
checkCommandSyntax(String source)
|
void |
checkReporterSyntax(String source)
|
void |
clearAll()
|
abstract void |
clearDrawing()
|
void |
clearLastLogoException()
|
Procedure |
compileCommands(String source)
|
Procedure |
compileCommands(String source,
Class<? extends Agent> agentClass)
|
Procedure |
compileForRun(String source,
Context context,
boolean reporter)
|
abstract CompilerInterface |
compiler()
|
Procedure |
compileReporter(String source)
|
boolean |
computerHubNetRunning()
|
void |
computerHubNetRunning(boolean computerHubNetRunning)
|
void |
convertToNormal()
instantly converts the current model to ModelType.NORMAL. |
void |
currentPlot(String plot)
|
void |
dispose()
Shuts down the background thread associated with this workspace, allowing resources to be freed. |
void |
evaluateCommands(String source)
|
void |
evaluateCommands(String source,
Agent agent,
boolean waitForCompletion)
|
void |
evaluateCommands(String source,
Class<? extends Agent> agentClass,
boolean waitForCompletion)
|
Object |
evaluateReporter(String source)
|
Object |
evaluateReporter(String source,
Agent agent)
|
void |
exportAllPlots(String filename)
|
File |
exportBehaviors(String filename,
String experimentName,
boolean includeHeader)
|
abstract void |
exportDrawingToCSV(PrintWriter writer)
|
abstract void |
exportOutputAreaToCSV(PrintWriter writer)
|
void |
exportPlot(String plotName,
String filename)
|
void |
exportWorld(PrintWriter writer)
|
void |
exportWorld(String filename)
|
FileManager |
fileManager()
|
Map<String,List<Object>> |
findProcedurePositions(String source)
|
boolean |
forceSaveAs()
whether the user needs to enter a new filename to save this model. |
ExtensionManager |
getExtensionManager()
|
HubNetInterface |
getHubNetManager()
|
boolean |
getIsApplet()
|
String |
getModelDir()
returns the full path to the directory from which the current model was loaded. |
String |
getModelFileName()
returns the name of the file from which the current model was loaded. |
String |
getModelPath()
returns the full pathname of the currently loaded model, if any. |
ModelType |
getModelType()
|
PlotInterface |
getPlot(String plot)
|
Map<String,Procedure> |
getProcedures()
|
WorldPropertiesInterface |
getPropertiesInterface()
|
String |
getSource(String filename)
|
org.nlogo.api.Token |
getTokenAtPosition(String s,
int pos)
|
String |
guessExportName(String defaultName)
|
void |
halt()
|
HubNetInterface |
hubnetManager()
|
void |
importDrawing(String filename)
|
void |
importExtensionData(String name,
List<String[]> data,
ImportErrorHandler handler)
|
void |
importWorld(String filename)
|
void |
init()
|
static boolean |
isApp()
|
static void |
isApp(boolean isApp)
|
static boolean |
isApplet()
|
static void |
isApplet(boolean isApplet)
|
boolean |
isCompilerTestingMode()
Internal use only. |
boolean |
isConstant(String string)
|
boolean |
isExtensionName(String name)
|
abstract boolean |
isHeadless()
|
boolean |
isValidIdentifier(String s)
|
void |
joinForeverButtons(Agent agent)
|
LogoException |
lastLogoException()
|
WeakHashMap<Job,WeakHashMap<Agent,WeakHashMap<Command,MutableLong>>> |
lastRunTimes()
|
void |
loadWorld(String[] strings,
String version,
WorldLoaderInterface worldInterface)
|
abstract void |
magicOpen(String name)
|
org.nlogo.util.MersenneTwisterFast |
mainRNG()
|
Thunk |
makeThunk(String source,
Agent agent,
Object owner)
|
String |
modelNameForDisplay()
|
abstract void |
open(String path)
|
abstract void |
openString(String modelContents)
|
void |
outputObject(Object object,
Object owner,
boolean addNewline,
boolean readable,
Workspace.OutputDestination destination)
|
abstract void |
perhapsUpdateDisplay()
|
org.nlogo.plot.PlotManager |
plotManager()
|
Object |
readFromString(String string)
|
Object |
readNumberFromString(String source)
|
abstract void |
requestDisplayUpdate(boolean force)
|
boolean |
runCompiledCommands(Procedure procedure)
|
Object |
runCompiledReporter(Procedure procedure)
|
Object |
runCompiledReporter(Procedure procedure,
org.nlogo.util.MersenneTwisterFast rng)
|
void |
setModelPath(String modelPath)
|
void |
setOutputAreaContents(String text)
|
void |
setProcedures(Map<String,Procedure> procedures)
|
org.nlogo.api.Token[] |
tokenizeForColorization(String s)
|
Workspace.UpdateMode |
updateMode()
|
void |
updateMode(Workspace.UpdateMode updateMode)
|
boolean |
warningMessage(String message)
Displays a warning to the user, and determine whether to continue. |
World |
world()
|
abstract void |
writeGraphicsData(PrintWriter writer)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.nlogo.nvm.Workspace |
|---|
aggregateManager, changeTopology, clearOutput, deleteLogFiles, exportDrawing, exportInterface, exportOutput, exportView, exportView, getAndCreateDrawing, inspectAgent, inspectAgent, openIndex, openNext, openPrevious, patchSize, startLogging, waitFor, waitForQueuedEvents, waitForResult, zipLogFiles |
| Methods inherited from interface org.nlogo.api.WorldResizer |
|---|
patchSize, resizeView, setDimensions, setDimensions |
| Methods inherited from interface org.nlogo.nvm.JobManagerOwner |
|---|
ownerFinished, periodicUpdate, runtimeError, updateDisplay |
| Field Detail |
|---|
public final World world
public final JobManagerInterface jobManager
public static final String DEFAULT_PREVIEW_COMMANDS
public String previewCommands
public WeakHashMap<String,Procedure> codeBits
| Method Detail |
|---|
public World world()
world in interface Workspacepublic FileManager fileManager()
fileManager in interface Workspacepublic org.nlogo.plot.PlotManager plotManager()
plotManager in interface Workspacepublic WeakHashMap<Job,WeakHashMap<Agent,WeakHashMap<Command,MutableLong>>> lastRunTimes()
lastRunTimes in interface Workspacepublic ExtensionManager getExtensionManager()
getExtensionManager in interface Workspacepublic boolean isExtensionName(String name)
isExtensionName in interface ImporterUser
public void importExtensionData(String name,
List<String[]> data,
ImportErrorHandler handler)
throws ExtensionException
importExtensionData in interface ImporterUserExtensionExceptionpublic boolean isCompilerTestingMode()
public void dispose()
throws InterruptedException
dispose in interface WorkspaceInterruptedExceptionpublic abstract boolean isHeadless()
isHeadless in interface Workspacepublic boolean warningMessage(String message)
public static boolean isApp()
public static void isApp(boolean isApp)
public static boolean isApplet()
public static void isApplet(boolean isApplet)
public boolean getIsApplet()
getIsApplet in interface Workspacepublic HubNetInterface getHubNetManager()
getHubNetManager in interface Workspacepublic HubNetInterface hubnetManager()
public boolean computerHubNetRunning()
public void computerHubNetRunning(boolean computerHubNetRunning)
computerHubNetRunning in interface HubNetWorkspaceInterfacepublic WorldPropertiesInterface getPropertiesInterface()
getPropertiesInterface in interface HubNetWorkspaceInterfacepublic void setModelPath(String modelPath)
setModelPath in interface Workspace
public String attachModelDir(String filePath)
throws MalformedURLException
attachModelDir in interface WorkspaceMalformedURLException
public void convertToNormal()
throws IOException
convertToNormal in interface WorkspaceIOExceptionpublic String getModelPath()
getModelPath in interface Workspacepublic String getModelFileName()
getModelFileName in interface Workspacepublic String getModelDir()
getModelDir in interface Workspacepublic ModelType getModelType()
public boolean forceSaveAs()
public String modelNameForDisplay()
modelNameForDisplay in interface HubNetWorkspaceInterfacepublic Map<String,Procedure> getProcedures()
getProcedures in interface Workspacepublic void setProcedures(Map<String,Procedure> procedures)
setProcedures in interface Workspacepublic void init()
public void clearAll()
clearAll in interface Workspacepublic void joinForeverButtons(Agent agent)
joinForeverButtons in interface Workspacepublic void addJobFromJobThread(Job job)
addJobFromJobThread in interface Workspacepublic abstract void magicOpen(String name)
magicOpen in interface Workspace
public Procedure compileForRun(String source,
Context context,
boolean reporter)
throws CompilerException
compileForRun in interface WorkspaceCompilerExceptionpublic Workspace.UpdateMode updateMode()
public void updateMode(Workspace.UpdateMode updateMode)
public abstract void open(String path)
throws IOException,
CompilerException,
LogoException
open in interface WorkspaceIOException
CompilerException
LogoException
public abstract void openString(String modelContents)
throws CompilerException,
LogoException
openString in interface WorkspaceCompilerException
LogoExceptionpublic void halt()
public abstract void requestDisplayUpdate(boolean force)
requestDisplayUpdate in interface Workspacepublic abstract void perhapsUpdateDisplay()
perhapsUpdateDisplay in interface Workspace
public void outputObject(Object object,
Object owner,
boolean addNewline,
boolean readable,
Workspace.OutputDestination destination)
throws LogoException
outputObject in interface WorkspaceLogoExceptionpublic void setOutputAreaContents(String text)
setOutputAreaContents in interface ImporterUserpublic abstract void clearDrawing()
clearDrawing in interface Workspace
public void exportPlot(String plotName,
String filename)
throws IOException
exportPlot in interface WorkspaceIOException
public void exportAllPlots(String filename)
throws IOException
exportAllPlots in interface WorkspaceIOException
public void exportWorld(String filename)
throws IOException
exportWorld in interface WorkspaceIOExceptionpublic void exportWorld(PrintWriter writer)
public abstract void exportDrawingToCSV(PrintWriter writer)
public abstract void exportOutputAreaToCSV(PrintWriter writer)
public abstract void writeGraphicsData(PrintWriter writer)
public void importWorld(String filename)
throws IOException
importWorld in interface WorkspaceIOException
public void importDrawing(String filename)
throws IOException
importDrawing in interface WorkspaceIOExceptionpublic void currentPlot(String plot)
currentPlot in interface ImporterUserpublic PlotInterface getPlot(String plot)
getPlot in interface ImporterUserpublic String guessExportName(String defaultName)
public File exportBehaviors(String filename,
String experimentName,
boolean includeHeader)
throws IOException
IOExceptionpublic int behaviorSpaceRunNumber()
behaviorSpaceRunNumber in interface Workspacepublic void behaviorSpaceRunNumber(int n)
behaviorSpaceRunNumber in interface Workspace
public Thunk makeThunk(String source,
Agent agent,
Object owner)
throws CompilerException
makeThunk in interface EvaluatorCompilerException
public void evaluateCommands(String source)
throws CompilerException
evaluateCommands in interface WorkspaceCompilerException
public void evaluateCommands(String source,
Agent agent,
boolean waitForCompletion)
throws CompilerException
evaluateCommands in interface WorkspaceCompilerException
public void evaluateCommands(String source,
Class<? extends Agent> agentClass,
boolean waitForCompletion)
throws CompilerException
evaluateCommands in interface WorkspaceCompilerException
public Object evaluateReporter(String source)
throws CompilerException
evaluateReporter in interface WorkspaceCompilerException
public Object evaluateReporter(String source,
Agent agent)
throws CompilerException
evaluateReporter in interface WorkspaceCompilerException
public Procedure compileCommands(String source)
throws CompilerException
compileCommands in interface WorkspaceCompilerException
public Procedure compileCommands(String source,
Class<? extends Agent> agentClass)
throws CompilerException
compileCommands in interface WorkspaceCompilerException
public Procedure compileReporter(String source)
throws CompilerException
compileReporter in interface WorkspaceCompilerExceptionpublic boolean runCompiledCommands(Procedure procedure)
runCompiledCommands in interface Workspacepublic Object runCompiledReporter(Procedure procedure)
runCompiledReporter in interface Workspace
public Object runCompiledReporter(Procedure procedure,
org.nlogo.util.MersenneTwisterFast rng)
runCompiledReporter in interface Workspacepublic boolean isConstant(String string)
isConstant in interface Evaluator
public Object readFromString(String string)
throws CompilerException
readFromString in interface EvaluatorreadFromString in interface org.nlogo.api.CompilerServicesCompilerException
public String getSource(String filename)
throws IOException
IOException
public String autoConvert(String source,
boolean subprogram,
boolean reporter,
String modelVersion)
autoConvert in interface org.nlogo.api.CompilerServices
public void loadWorld(String[] strings,
String version,
WorldLoaderInterface worldInterface)
public org.nlogo.util.MersenneTwisterFast auxRNG()
auxRNG in interface RandomServicespublic org.nlogo.util.MersenneTwisterFast mainRNG()
mainRNG in interface RandomServices
public Object readNumberFromString(String source)
throws CompilerException
readNumberFromString in interface org.nlogo.api.CompilerServicesCompilerException
public void checkReporterSyntax(String source)
throws CompilerException
checkReporterSyntax in interface org.nlogo.api.CompilerServicesCompilerException
public void checkCommandSyntax(String source)
throws CompilerException
checkCommandSyntax in interface org.nlogo.api.CompilerServicesCompilerExceptionpublic boolean isValidIdentifier(String s)
isValidIdentifier in interface org.nlogo.api.CompilerServicespublic org.nlogo.api.Token[] tokenizeForColorization(String s)
tokenizeForColorization in interface org.nlogo.api.CompilerServices
public org.nlogo.api.Token getTokenAtPosition(String s,
int pos)
getTokenAtPosition in interface org.nlogo.api.CompilerServicespublic Map<String,List<Object>> findProcedurePositions(String source)
findProcedurePositions in interface org.nlogo.api.CompilerServicespublic abstract CompilerInterface compiler()
compiler in interface Workspacepublic LogoException lastLogoException()
lastLogoException in interface Workspacepublic void clearLastLogoException()
clearLastLogoException in interface Workspace