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
AnyRef, Any
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

    Reporter#report(Argument[], Context)

    Command#perform(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 DummyLogoThunkFactory extends LogoThunkFactory
  42. trait Editable extends AnyRef
  43. trait EditorAreaInterface extends AnyRef
  44. class ExtensionException extends Exception

    Wrapper class for exceptions thrown by NetLogo extensions.

  45. trait ExtensionManager extends core.ExtensionManager

    ExtensionManager provides some methods that can be used in runOnce

  46. class FormatterPair[A, B <: ModelFormat[A, B]] extends AnyRef
  47. class Graphics2DWrapper extends GraphicsInterface
  48. trait GraphicsInterface extends AnyRef
  49. trait HaltSignal extends AnyRef
  50. trait HubNetInterface extends ViewInterface with ModelSaveable
  51. trait HubNetWorkspaceInterface extends CompilerServices
  52. 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.

  53. trait ImportErrorHandler extends AnyRef
  54. trait ImporterUser extends WorldResizer
  55. 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.)

  56. case class LabProtocol(name: String, setupCommands: String, goCommands: String, finalCommands: String, repetitions: Int, sequentialRunOrder: Boolean, runMetricsEveryStep: Boolean, timeLimit: Int, exitCondition: String, metrics: List[String], valueSets: List[RefValueSet]) extends Product with Serializable
  57. trait Link extends Agent

    Interface provides access to NetLogo links.

  58. trait Link3D extends Link
  59. trait LinkStamp3D extends Link3D
  60. class LocalFile extends File
  61. trait Logger extends AnyRef
  62. 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.

  63. class LogoHashObject extends AnyRef
  64. class LogoListBuilder extends AnyRef
  65. trait LogoThunkFactory extends AnyRef
  66. 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

  67. 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

  68. trait ModelFormat[Section, Format <: ModelFormat[Section, Format]] extends AnyRef
  69. trait ModelLoader extends AnyRef
  70. trait ModelRun extends AnyRef
  71. sealed trait ModelSection extends AnyRef
  72. case class ModelSettings(snapToGrid: Boolean) extends Product with Serializable
  73. 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.

  74. trait ModelingCommonsInterface extends AnyRef
  75. trait MultiErrorHandler extends AnyRef
  76. trait NetLogoAdapter extends NetLogoListener

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

  77. 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.

  78. trait Observer extends Agent
  79. trait ObserverOrientation extends AnyRef
  80. class Options[T] extends AnyRef
  81. sealed trait OutputDestination extends AnyRef
  82. trait Patch extends Agent

    Provides access to NetLogo patches.

  83. trait Patch3D extends Patch
  84. sealed abstract class Perspective extends AnyRef
  85. class PerspectiveJ extends AnyRef
  86. sealed trait PlotAction extends Action
  87. trait PlotInterface extends AnyRef
  88. trait PlotManagerInterface extends AnyRef
  89. case class PlotState(autoPlotOn: Boolean = true, xMin: Double = 0, xMax: Double = 10, yMin: Double = 0, yMax: Double = 10) extends Product with Serializable
  90. 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.

  91. trait PrimitiveManager extends AnyRef

    Ships extension primitives and associated names to NetLogo.

  92. case class Property(accessString: String, tpe: Type, name: String, notes: String = "", gridWidth: Int = GridBagConstraints.REMAINDER, focus: Boolean = false, setLive: Boolean = false, enabled: Boolean = true, collapsible: Boolean = false, collapseByDefault: Boolean = false) extends Product with Serializable
  93. trait Protractor extends AnyRef
  94. trait Protractor3D extends Protractor
  95. trait RandomServices extends AnyRef
  96. case class RefEnumeratedValueSet(variableName: String, values: List[AnyRef]) extends RefValueSet with Product with Serializable
  97. sealed trait RefValueSet extends Iterable[AnyRef] with BaseValueSet
  98. trait Refreshable extends AnyRef

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

  99. class RemoteFile extends File
  100. trait RendererInterface extends AnyRef
  101. 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.

  102. 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.)

  103. trait ReporterRunnable[T] extends AnyRef
  104. 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.

  105. class SimpleJobOwner extends JobOwner
  106. trait SingleErrorHandler extends AnyRef
  107. 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.

  108. case class SteppedValueSet(variableName: String, firstValue: BigDecimal, step: BigDecimal, lastValue: BigDecimal) extends RefValueSet with Product with Serializable
  109. class Timer extends AnyRef
  110. trait TokenizerInterface extends AnyRef
  111. trait TrailDrawerInterface extends DrawingInterface
  112. trait Turtle extends Agent

    Interface provides access to NetLogo turtles.

  113. trait Turtle3D extends Turtle
  114. trait TurtleStamp3D extends Turtle3D
  115. trait ValueConstraint extends AnyRef

    Interface for objects which provide constraints for values

  116. case class Vect(x: Double, y: Double, z: Double) extends Product with Serializable
  117. trait Version extends AnyRef
  118. trait ViewInterface extends AnyRef
  119. trait ViewSettings extends AnyRef
  120. trait Workspace extends ImporterUser with LiteralParser with RandomServices with ViewSettings with Controllable
  121. trait World extends AnyRef
  122. trait World3D extends World
  123. class WorldDimensionException extends Exception
  124. class WorldDimensions3D extends WorldDimensions
  125. trait WorldPropertiesInterface extends AnyRef
  126. trait WorldRenderable extends AnyRef
  127. 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

  128. trait WorldWithWorldRenderable extends World with WorldRenderable
  129. 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

  130. trait TokenHolder extends AnyRef
    Annotations
    @deprecated
    Deprecated

    (Since version Use core.TokenHolder instead) 6.0.3

  131. 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 core.Color
  5. object Constants
  6. object Dump extends core.Dump
  7. object Equality
  8. object Exceptions
  9. object FileIO
  10. object HexString
  11. object HubNetInterface
  12. 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...

  13. object LogoHashObject
  14. object ModelLoader
  15. object ModelReader
  16. object ModelSection
  17. object ModelSectionJ
  18. object ModelType
  19. object ModelTypeJ
  20. object NetLogoLegacyDialect extends Dialect
  21. object NetLogoLegacyDialectTokenMapper extends DelegatingMapper
  22. object NetLogoThreeDDialect extends Dialect
  23. object Numbers
  24. object OutputDestination
  25. 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.

  26. object PeriodicUpdateDelay
  27. object Perspective
  28. object PlotAction
  29. object PreviewCommands
  30. object Property extends Serializable
  31. object RandomSeedGenerator
  32. object RemoteFile
  33. object ScalaConversions
  34. object SimpleChangeEvent
  35. object StringUtils
  36. object ThreeDTokenMapper extends DelegatingMapper
  37. object TypeNames
  38. object ValueConstraint
  39. object Vect extends Serializable
  40. object Version extends Version
  41. object VersionHistory
  42. 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