Packages

package api

Provides classes associated with the NetLogo Extensions API and Controlling API.

For discussion and sample code, please see the NetLogo User Manual.

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. api
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait Action extends AnyRef
  2. trait ActionBroker[A <: Action] extends Publisher[A]
  3. class ActionBuffer[A <: Action] extends Subscriber[A, Publisher[A]]

    An ActionBuffer logs all actions generated by the supplied ActionBroker.

    An ActionBuffer logs all actions generated by the supplied ActionBroker. Actions can be grabbed (which clears the buffer) and the buffer can be cleared independently. NP 2013-01-25.

  4. trait ActionRunner[A <: Action] extends AnyRef
  5. trait Activation extends AnyRef

    A representation of the currently executing procedure

  6. trait AddableComponent extends AnyRef
  7. trait Agent extends AnyRef

    NetLogo agents include turtles, patches, links and the observer.

  8. class AgentException extends Exception
  9. trait AgentFollowingPerspective extends AnyRef
  10. trait AgentSet extends AnyRef

    Interface provides access to NetLogo agentsets.

    Interface provides access to NetLogo agentsets. NetLogo agentsets may be composed of turtles, patches, or links (but an agentset may not contain a mix of different agent types.)

    In order to perform some functions on AgentSets you may need to cast to org.nlogo.agent.AgentSet.

  11. final class AgentVariableNumbers extends AnyRef
  12. trait AggregateManagerInterface extends SourceOwner with ModelSaveable
  13. trait AnonymousCommand extends AnonymousProcedure
  14. sealed trait AnonymousProcedure extends AnyRef
  15. trait AnonymousReporter extends AnonymousProcedure
  16. trait Argument extends AnyRef

    Interface provides access to arguments passed to the perform or report methods of a primitive at run-time.

    Interface provides access to arguments passed to the perform or report methods of a primitive at run-time.

    Arguments are created by NetLogo and passed to the perform or report methods of your primitive.

    See also

    Command#perform(Argument[], Context)

    Reporter#report(Argument[], Context)

  17. trait AutoConvertable extends AnyRef
  18. trait AutoConverter extends AnyRef
  19. sealed trait BaseValueSet extends AnyRef
  20. class CSV extends AnyRef
  21. trait ClassManager extends AnyRef
  22. trait Command extends PrimitiveCommand

    Interface for NetLogo extension commands.

    Interface for NetLogo extension commands. Commands are primitives that do not return a value. All new commands must implement this interface.

  23. trait CommandLogoThunk extends AnyRef
  24. trait CommandRunnable extends AnyRef
  25. trait CompilerServices extends LiteralParser
  26. trait ComponentSerialization[A, B <: ModelFormat[A, B]] extends AnyRef
  27. class ConfigurableModelLoader extends ModelLoader
  28. trait Context extends AnyRef

    Provides access to the current execution environment.

  29. trait ControlSet extends AnyRef

    ControlSet is an abstraction over the various runtime-only parts of model state.

    ControlSet is an abstraction over the various runtime-only parts of model state. For instance, what output is shown to the user? What does the interface look like for the user. At the moment, it is likely it will only be needed for NetLogo UI, but there's a chance it could also be useful for some aspect of Headless in the future.

    Methods on this class should perform the "correct" action regardless of whether they are called from the job or swing event thread. Future is used because these computations may be asynchronous.

  30. trait Controllable extends AnyRef

    Interface provides access to the NetLogo controlling API's report and command methods found in methods independent of App.app and headless.HeadlessWorkspace.

    Interface provides access to the NetLogo controlling API's report and command methods found in methods independent of App.app and headless.HeadlessWorkspace. This is useful for making java software that can run NetLogo in both GUI and Headless mode.

  31. abstract class DefaultClassManager extends ClassManager
  32. trait DelegatingMapper extends TokenMapperInterface
  33. case class DoubleRange(start: Double, stop: Double, step: Double = 1.0, inclusive: Boolean = false) extends IndexedSeq[Double] with Product with Serializable
  34. trait Drawing3D extends AnyRef
  35. trait DrawingInterface extends AnyRef
  36. trait DrawingLine3D extends AnyRef
  37. class DummyCompilerServices extends CompilerServices
  38. trait DummyEditable extends Editable with DummyErrorHandler
  39. trait DummyErrorHandler extends AnyRef
  40. class DummyExtensionManager extends core.DummyExtensionManager with ExtensionManager
  41. class DummyLibraryManager extends LibraryManager
  42. class DummyLogoThunkFactory extends LogoThunkFactory
  43. trait Editable extends AnyRef
  44. trait EditorAreaInterface extends AnyRef
  45. sealed trait ExportPlotWarningAction extends AnyRef
  46. class ExtensionException extends Exception

    Wrapper class for exceptions thrown by NetLogo extensions.

  47. trait ExtensionManager extends core.ExtensionManager

    ExtensionManager provides some methods that can be used in runOnce

  48. class FormatterPair[A, B <: ModelFormat[A, B]] extends AnyRef
  49. class Graphics2DWrapper extends GraphicsInterface
  50. trait GraphicsInterface extends AnyRef
  51. trait HaltSignal extends AnyRef
  52. trait HubNetInterface extends ViewInterface with ModelSaveable
  53. trait HubNetWorkspaceInterface extends CompilerServices
  54. trait I18NJava extends AnyRef

    The Scala compiler won't generate a Java varargs forwarder for a Scala varargs method unless the method comes from a Java class or interface.

    The Scala compiler won't generate a Java varargs forwarder for a Scala varargs method unless the method comes from a Java class or interface. So this is in Java to be implemented from Scala by I18N.BundleKind.

  55. trait ImportErrorHandler extends AnyRef
  56. trait ImporterUser extends WorldResizer
  57. trait JobOwner extends SourceOwner

    Like source owners, job owners are usually parts of the UI.

    Like source owners, job owners are usually parts of the UI. Jobs are initiated by by buttons, by monitors, by the Command Center, and so on.

    The (assorted, disparate) methods here in JobOwner have mainly to do with runtime behavior and/or runtime error handling. (SourceOwner is more about compilation and compile-time errors.)

  58. case class LabProtocol(name: String, preExperimentCommands: String, setupCommands: String, goCommands: String, postRunCommands: String, postExperimentCommands: String, repetitions: Int, sequentialRunOrder: Boolean, runMetricsEveryStep: Boolean, runMetricsCondition: String, timeLimit: Int, exitCondition: String, metrics: List[String], constants: List[RefValueSet], subExperiments: List[List[RefValueSet]] = Nil, runsCompleted: Int = 0, runOptions: LabRunOptions = null) extends Product with Serializable
  59. case class LabRunOptions(threadCount: Int, table: String, spreadsheet: String, stats: String, lists: String, updateView: Boolean, updatePlotsAndMonitors: Boolean) extends Product with Serializable
  60. class LibraryManager extends core.LibraryManager
  61. trait Link extends Agent

    Interface provides access to NetLogo links.

  62. trait Link3D extends Link
  63. trait LinkStamp3D extends Link3D
  64. class LocalFile extends File
  65. abstract class LogoException extends RuntimeException

    A runtime error that has occurred in NetLogo code.

    A runtime error that has occurred in NetLogo code.

    As with any Exception, use the getMessage() method to get the error message. A LogoExceptions is expected to have a nice end-user-understandable message.

    LogoException is abstract because engine code is supposed to throw a concrete subclass like EngineException.

  66. class LogoHashObject extends AnyRef
  67. class LogoListBuilder extends AnyRef
  68. trait LogoThunkFactory extends AnyRef
  69. class Matrix3D extends AnyRef

    A fairly conventional 3D matrix object that can transform sets of 3D points and perform a variety of manipulations on the transform

  70. final class MersenneTwisterFast extends Random with Serializable with Cloneable

    Version 9, based on version MT199937(99/10/29) of the Mersenne Twister algorithm found at The Mersenne Twister Home Page, with the initialization improved using the new 2002/1/26 initialization algorithm By Sean Luke, October 2004.

    MersenneTwister and MersenneTwisterFast

    Version 9, based on version MT199937(99/10/29) of the Mersenne Twister algorithm found at The Mersenne Twister Home Page, with the initialization improved using the new 2002/1/26 initialization algorithm By Sean Luke, October 2004.

    MersenneTwister is a drop-in subclass replacement for java.util.Random. It is properly synchronized and can be used in a multithreaded environment. On modern VMs such as HotSpot, it is approximately 1/3 slower than java.util.Random.

    MersenneTwisterFast is not a subclass of java.util.Random. It has the same public methods as Random does, however, and it is algorithmically identical to MersenneTwister. MersenneTwisterFast has hard-code inlined all of its methods directly, and made all of them final (well, the ones of consequence anyway). Further, these methods are not synchronized, so the same MersenneTwisterFast instance cannot be shared by multiple threads. But all this helps MersenneTwisterFast achieve well over twice the speed of MersenneTwister. java.util.Random is about 1/3 slower than MersenneTwisterFast.

    About the Mersenne Twister

    This is a Java version of the C-program for MT19937: Integer version. The MT19937 algorithm was created by Makoto Matsumoto and Takuji Nishimura, who ask: "When you use this, send an email to: matumoto@math.keio.ac.jp with an appropriate reference to your work". Indicate that this is a translation of their algorithm into Java.

    Reference. Makato Matsumoto and Takuji Nishimura, "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3--30.

    About this Version

    Changes Since V8: setSeed(int) was only using the first 28 bits of the seed; it should have been 32 bits. For small-number seeds the behavior is identical.

    Changes Since V7: A documentation error in MersenneTwisterFast (but not MersenneTwister) stated that nextDouble selects uniformly from the full-open interval [0,1]. It does not. nextDouble's contract is identical across MersenneTwisterFast, MersenneTwister, and java.util.Random, namely, selection in the half-open interval [0,1). That is, 1.0 should not be returned. A similar contract exists in nextFloat.

    Changes Since V6: License has changed from LGPL to BSD. New timing information to compare against java.util.Random. Recent versions of HotSpot have helped Random increase in speed to the point where it is faster than MersenneTwister but slower than MersenneTwisterFast (which should be the case, as it's a less complex algorithm but is synchronized).

    Changes Since V5: New empty constructor made to work the same as java.util.Random -- namely, it seeds based on the current time in milliseconds.

    Changes Since V4: New initialization algorithms. See (see http://www.math.keio.ac.jp/matumoto/MT2002/emt19937ar.html)

    The MersenneTwister code is based on standard MT19937 C/C++ code by Takuji Nishimura, with suggestions from Topher Cooper and Marc Rieffel, July 1997. The code was originally translated into Java by Michael Lecuyer, January 1999, and the original code is Copyright (c) 1999 by Michael Lecuyer.

    Java notes

    This implementation implements the bug fixes made in Java 1.2's version of Random, which means it can be used with earlier versions of Java. See the JDK 1.2 java.util.Random documentation for further documentation on the random-number generation contracts made. Additionally, there's an undocumented bug in the JDK java.util.Random.nextBytes() method, which this code fixes.

    Just like java.util.Random, this generator accepts a long seed but doesn't use all of it. java.util.Random uses 48 bits. The Mersenne Twister instead uses 32 bits (int size). So it's best if your seed does not exceed the int range.

    MersenneTwister can be used reliably on JDK version 1.1.5 or above. Earlier Java versions have serious bugs in java.util.Random; only MersenneTwisterFast (and not MersenneTwister nor java.util.Random) should be used with them.

    License

    Copyright (c) 2003 by Sean Luke.
    Portions copyright (c) 1993 by Michael Lecuyer.
    All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    • Neither the name of the copyright owners, their employers, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    Version

    8

  71. class MetadataLoadingException extends RuntimeException
  72. trait ModelFormat[Section, Format <: ModelFormat[Section, Format]] extends AnyRef
  73. trait ModelLoader extends AnyRef
  74. trait ModelRun extends AnyRef
  75. sealed trait ModelSection extends AnyRef
  76. case class ModelSettings(snapToGrid: Boolean) extends Product with Serializable
  77. sealed trait ModelType extends AnyRef

    how a model was loaded.

    how a model was loaded. NEW is type for new models, NORMAL is a model opened normally (e.g. via Open on the File menu), LIBRARY a models library model.

  78. trait ModelingCommonsInterface extends AnyRef
  79. trait MultiErrorHandler extends AnyRef
  80. trait NetLogoAdapter extends NetLogoListener

    Implements NetLogoListener with empty methods, which can be overriden in subclasses.

  81. trait NetLogoListener extends EventListener

    A host application should implement this interface in order to be notified of events occurring within NetLogo.

    A host application should implement this interface in order to be notified of events occurring within NetLogo. Its methods are called by NetLogoListenerManager when these events occur. The events are typically user actions, but may also be triggered programmatically by the model.

  82. trait Observer extends Agent
  83. trait ObserverOrientation extends AnyRef
  84. class Options[T] extends AnyRef
  85. sealed trait OutputDestination extends AnyRef
  86. trait Patch extends Agent

    Provides access to NetLogo patches.

  87. trait Patch3D extends Patch
  88. sealed abstract class Perspective extends AnyRef
  89. class PerspectiveJ extends AnyRef
  90. sealed trait PlotAction extends Action
  91. sealed trait PlotCompilationErrorAction extends AnyRef

    Action to take if PlotManager.compileAllPlot returns error(s) during a call to open in HeadlessWorkspace.

    Action to take if PlotManager.compileAllPlot returns error(s) during a call to open in HeadlessWorkspace.

    Throw - Throw the first error Output - Output all errors Ignore - Do nothing

  92. trait PlotInterface extends AnyRef
  93. trait PlotManagerInterface extends AnyRef
  94. trait PlotPenInterface extends AnyRef
  95. trait PlotPointInterface extends AnyRef
  96. case class PlotState(autoPlotOn: Boolean = true, xMin: Double = 0, xMax: Double = 10, yMin: Double = 0, yMax: Double = 10) extends Product with Serializable
  97. sealed trait PreviewCommands extends ModelSaveable

    A model's "preview commands" are the commands that are used to generate the preview that appears in the Models Library dialog, the NetLogo website (http://ccl.northwestern.edu/netlogo/models/), the Modeling Commons (http://www.modelingcommons.org/) and potentially other places.

    A model's "preview commands" are the commands that are used to generate the preview that appears in the Models Library dialog, the NetLogo website (http://ccl.northwestern.edu/netlogo/models/), the Modeling Commons (http://www.modelingcommons.org/) and potentially other places. By default, they're just setup repeat 75 [ go ] but they can be customized. Some models require manually generated previews.

    Preview commands are always run in a fresh headless workspace with random-seed 0 called before opening the model. The startup procedure, if present, runs before the preview commands.

  98. trait PrimitiveManager extends AnyRef

    Ships extension primitives and associated names to NetLogo.

  99. case class Property(accessString: String, tpe: Type, name: String, notes: String = "", gridWidth: Int = GridBagConstraints.REMAINDER, optional: Boolean = false, focus: Boolean = false, setLive: Boolean = false, enabled: Boolean = true, collapsible: Boolean = false, collapseByDefault: Boolean = false, dependentPropertyNames: Set[String] = Set(), backgroundColor: Color = null, borderSize: Int = 0) extends Product with Serializable
  100. trait Protractor extends AnyRef
  101. trait Protractor3D extends Protractor
  102. trait RandomServices extends AnyRef
  103. case class RefEnumeratedValueSet(variableName: String, values: List[AnyRef]) extends RefValueSet with Product with Serializable
  104. sealed trait RefValueSet extends Iterable[AnyRef] with BaseValueSet
  105. trait Refreshable extends AnyRef

    Marker trait used to indicate that the value in this class may be stale and in need of refresh

  106. class RemoteFile extends File
  107. trait RendererInterface extends AnyRef
  108. trait Reporter extends PrimitiveReporter

    Interface for NetLogo reporters.

    Interface for NetLogo reporters. Reporters are primitives that return a value. All new reporters must implement this interface.

  109. trait ReporterLogoThunk extends AnyRef

    This is used by SliderConstraint.

    This is used by SliderConstraint. Sliders have snippets of Logo code associated with them, which need be to be evaluated to produce numbers for the min, max, and increment. But here in the org.nlogo.agent package we don't know anything about Logo code and how to run it. This interface lets other code keep us in the dark by giving us a black box that magically produces an object whenever we ask for one. (In the case of SliderConstraint the object should be a boxed double.)

  110. trait ReporterRunnable[T] extends AnyRef
  111. class SimpleChangeEventPublisher extends Publisher[SimpleChangeEvent.type]

    A most basic event publisher only warning subscribers that "something has changed" Currently used by TreeAgentSet to allow the nw extension to listen for changes and update its graph context accordingly.

    A most basic event publisher only warning subscribers that "something has changed" Currently used by TreeAgentSet to allow the nw extension to listen for changes and update its graph context accordingly. NP 2013-05-14.

  112. class SimpleJobOwner extends JobOwner
  113. trait SingleErrorHandler extends AnyRef
  114. trait SourceOwner extends AnyRef

    Source owners are usually parts of the UI.

    Source owners are usually parts of the UI. Code comes from buttons, from monitors, from the Code tab, from the Command Center, and so on.

    SourceOwner has mainly to do with compilation and with what to do if an error occurs during compilation.

    "Header source" is distinguished from "inner source" because the latter is the code the user actually wrote, while header and footer source is extra code we wrapped around it. This matters when showing code and showing positions of errors in the UI; we never want to show the user header/footer source, but error locations need to take the length of the header source into account.

    See also JobOwner, which extends SourceOwner and adds methods having to do with runtime behavior and runtime error-handling.

  115. case class SteppedValueSet(variableName: String, firstValue: BigDecimal, step: BigDecimal, lastValue: BigDecimal) extends RefValueSet with Product with Serializable
  116. class Timer extends AnyRef
  117. trait TokenizerInterface extends AnyRef
  118. trait TrailDrawerInterface extends DrawingInterface
  119. trait Turtle extends Agent

    Interface provides access to NetLogo turtles.

  120. trait Turtle3D extends Turtle
  121. trait TurtleStamp3D extends Turtle3D
  122. trait ValueConstraint extends AnyRef

    Interface for objects which provide constraints for values

  123. case class Vect(x: Double, y: Double, z: Double) extends Product with Serializable
  124. trait Version extends AnyRef
  125. trait ViewInterface extends AnyRef
  126. trait ViewSettings extends AnyRef
  127. trait Workspace extends ImporterUser with LiteralParser with RandomServices with ViewSettings with Controllable
  128. trait World extends AnyRef
  129. trait World3D extends World
  130. class WorldDimensionException extends Exception
  131. class WorldDimensions3D extends WorldDimensions
  132. trait WorldPropertiesInterface extends AnyRef
  133. trait WorldRenderable extends AnyRef
  134. trait WorldResizer extends AnyRef

    used by Importer for resizing the world during an import.

    used by Importer for resizing the world during an import. also used by BehaviorSpace when the experiment varies the world size

  135. trait WorldWithWorldRenderable extends World with WorldRenderable
  136. case class EnumeratedValueSet(variableName: String, values: List[Any]) extends ValueSet with Product with Serializable
    Annotations
    @deprecated
    Deprecated

    (Since version use RefEnumeratedValueSet instead) 6.0.2

  137. trait TokenHolder extends AnyRef
    Annotations
    @deprecated
    Deprecated

    (Since version Use core.TokenHolder instead) 6.0.3

  138. sealed trait ValueSet extends Iterable[Any] with BaseValueSet
    Annotations
    @deprecated
    Deprecated

    (Since version use RefValueSet instead) 6.0.2

Value Members

  1. object APIVersion
  2. object AgentVariables
  3. object Approximate
  4. object Color extends Color
  5. object Constants
  6. object Dump extends Dump
  7. object Equality
  8. object Exceptions
  9. object ExportPlotWarningAction
  10. object ExportPlotWarningActionJ
  11. object ExtensionManager
  12. object FileIO
  13. object HubNetInterface
  14. object JavaLibraryPath

    This code came from http://forum.java.sun.com/thread.jspa?threadID=627890&start=15

    This code came from http://forum.java.sun.com/thread.jspa?threadID=627890&start=15

    The Terms of Use for the website, in the "Content Submitted to Sun" section states: You (the author) grant Sun and all other users of the Website an irrevocable, worldwide, royalty-free, nonexclusive license to use, reproduce, modify, distribute, transmit, display, perform, adapt, resell and publish such Content (including in digital form).

    http://www.sun.com/termsofuse.jsp

    The username of the original post has no name or email associated with it.

    Adds a path to the java.library.path System property and updates the ClassLoader. Uses reflection to allow update to private system members. Will not work if JVM security policy gets in the way (like in an applet). Will not work if Sun changes the private members. This really shouldn't be used at all...

  15. object LabDefaultThreads
  16. object LabExporterType
  17. object LabExporterVersion
  18. object LabPostProcessorInputFormat
  19. object LibraryInfoDownloader
  20. object LibraryManager
  21. object LogoHashObject
  22. object ModelLoader
  23. object ModelReader
  24. object ModelSection
  25. object ModelSectionJ
  26. object ModelType
  27. object ModelTypeJ
  28. object NetLogoLegacyDialect extends Dialect
  29. object NetLogoLegacyDialectTokenMapper extends DelegatingMapper
  30. object NetLogoThreeDDialect extends Dialect
  31. object Numbers
  32. object OutputDestination
  33. object OutputDestinationJ

    Java can't (I don't think) access Scala inner objects without reflection, so we provide these convenience vals for use from Java.

  34. object PeriodicUpdateDelay
  35. object Perspective
  36. object PlotAction
  37. object PlotCompilationErrorAction
  38. object PlotCompilationErrorActionJ
  39. object PreviewCommands
  40. object Property extends Serializable
  41. object RandomSeedGenerator
  42. object RemoteFile
  43. object ScalaConversions
  44. object SimpleChangeEvent
  45. object StringUtils
  46. object ThreeDTokenMapper extends DelegatingMapper
  47. object TypeNames
  48. object ValueConstraint
  49. object Vect extends Serializable
  50. object Version extends Version
  51. object VersionHistory
  52. object WorldDimensions3D extends Serializable

    for wrapping up dimensions to resize the world using WorldResizer This class is shared between NetLogo and NetLogo-Headless.

    for wrapping up dimensions to resize the world using WorldResizer This class is shared between NetLogo and NetLogo-Headless. That *does not* mean that it is available for use in Headless. Headless *does not* support 3D at this time (and may never support 3D).

Inherited from AnyRef

Inherited from Any

Ungrouped