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
- Alphabetic
- By Inheritance
- api
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- trait Action extends AnyRef
- trait ActionBroker[A <: Action] extends Publisher[A]
-
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.
- trait ActionRunner[A <: Action] extends AnyRef
-
trait
Activation extends AnyRef
A representation of the currently executing procedure
- trait AddableComponent extends AnyRef
-
trait
Agent extends AnyRef
NetLogo agents include turtles, patches, links and the observer.
- class AgentException extends Exception
- trait AgentFollowingPerspective extends AnyRef
-
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.
- final class AgentVariableNumbers extends AnyRef
- trait AggregateManagerInterface extends SourceOwner with ModelSaveable
- trait AnonymousCommand extends AnonymousProcedure
- sealed trait AnonymousProcedure extends AnyRef
- trait AnonymousReporter extends AnonymousProcedure
-
trait
Argument extends AnyRef
Interface provides access to arguments passed to the
perform
orreport
methods of a primitive at run-time.Interface provides access to arguments passed to the
perform
orreport
methods of a primitive at run-time.Arguments
are created by NetLogo and passed to theperform
orreport
methods of your primitive.- See also
Reporter#report(Argument[], Context)
Command#perform(Argument[], Context)
- trait AutoConvertable extends AnyRef
- trait AutoConverter extends AnyRef
- sealed trait BaseValueSet extends AnyRef
- class CSV extends AnyRef
- trait ClassManager extends AnyRef
-
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.
- trait CommandLogoThunk extends AnyRef
- trait CommandRunnable extends AnyRef
- trait CompilerServices extends LiteralParser
- trait ComponentSerialization[A, B <: ModelFormat[A, B]] extends AnyRef
- class ConfigurableModelLoader extends ModelLoader
-
trait
Context extends AnyRef
Provides access to the current execution environment.
-
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. -
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.
- abstract class DefaultClassManager extends ClassManager
- trait DelegatingMapper extends TokenMapperInterface
- case class DoubleRange(start: Double, stop: Double, step: Double = 1.0, inclusive: Boolean = false) extends IndexedSeq[Double] with Product with Serializable
- trait Drawing3D extends AnyRef
- trait DrawingInterface extends AnyRef
- trait DrawingLine3D extends AnyRef
- class DummyCompilerServices extends CompilerServices
- trait DummyEditable extends Editable with DummyErrorHandler
- trait DummyErrorHandler extends AnyRef
- class DummyExtensionManager extends core.DummyExtensionManager with ExtensionManager
- class DummyLogoThunkFactory extends LogoThunkFactory
- trait Editable extends AnyRef
- trait EditorAreaInterface extends AnyRef
-
class
ExtensionException extends Exception
Wrapper class for exceptions thrown by NetLogo extensions.
-
trait
ExtensionManager extends core.ExtensionManager
ExtensionManager
provides some methods that can be used in runOnce - class FormatterPair[A, B <: ModelFormat[A, B]] extends AnyRef
- class Graphics2DWrapper extends GraphicsInterface
- trait GraphicsInterface extends AnyRef
- trait HaltSignal extends AnyRef
- trait HubNetInterface extends ViewInterface with ModelSaveable
- trait HubNetWorkspaceInterface extends CompilerServices
-
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.
- trait ImportErrorHandler extends AnyRef
- trait ImporterUser extends WorldResizer
-
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.)
- 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
-
trait
Link extends Agent
Interface provides access to NetLogo links.
- trait Link3D extends Link
- trait LinkStamp3D extends Link3D
- class LocalFile extends File
- trait Logger extends AnyRef
-
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.
- class LogoHashObject extends AnyRef
- class LogoListBuilder extends AnyRef
- trait LogoThunkFactory extends AnyRef
-
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
-
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
- trait ModelFormat[Section, Format <: ModelFormat[Section, Format]] extends AnyRef
- trait ModelLoader extends AnyRef
- trait ModelRun extends AnyRef
- sealed trait ModelSection extends AnyRef
- case class ModelSettings(snapToGrid: Boolean) extends Product with Serializable
-
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.
- trait ModelingCommonsInterface extends AnyRef
- trait MultiErrorHandler extends AnyRef
-
trait
NetLogoAdapter extends NetLogoListener
Implements NetLogoListener with empty methods, which can be overriden in subclasses.
-
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.
- trait Observer extends Agent
- trait ObserverOrientation extends AnyRef
- class Options[T] extends AnyRef
- sealed trait OutputDestination extends AnyRef
-
trait
Patch extends Agent
Provides access to NetLogo patches.
- trait Patch3D extends Patch
- sealed abstract class Perspective extends AnyRef
- class PerspectiveJ extends AnyRef
- sealed trait PlotAction extends Action
- trait PlotInterface extends AnyRef
- trait PlotManagerInterface extends AnyRef
- case class PlotState(autoPlotOn: Boolean = true, xMin: Double = 0, xMax: Double = 10, yMin: Double = 0, yMax: Double = 10) extends Product with Serializable
-
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. Thestartup
procedure, if present, runs before the preview commands. -
trait
PrimitiveManager extends AnyRef
Ships extension primitives and associated names to NetLogo.
- 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
- trait Protractor extends AnyRef
- trait Protractor3D extends Protractor
- trait RandomServices extends AnyRef
- case class RefEnumeratedValueSet(variableName: String, values: List[AnyRef]) extends RefValueSet with Product with Serializable
- sealed trait RefValueSet extends Iterable[AnyRef] with BaseValueSet
-
trait
Refreshable extends AnyRef
Marker trait used to indicate that the value in this class may be stale and in need of refresh
- class RemoteFile extends File
- trait RendererInterface extends AnyRef
-
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.
-
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.)
- trait ReporterRunnable[T] extends AnyRef
-
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.
- class SimpleJobOwner extends JobOwner
- trait SingleErrorHandler extends AnyRef
-
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.
- case class SteppedValueSet(variableName: String, firstValue: BigDecimal, step: BigDecimal, lastValue: BigDecimal) extends RefValueSet with Product with Serializable
- class Timer extends AnyRef
- trait TokenizerInterface extends AnyRef
- trait TrailDrawerInterface extends DrawingInterface
-
trait
Turtle extends Agent
Interface provides access to NetLogo turtles.
- trait Turtle3D extends Turtle
- trait TurtleStamp3D extends Turtle3D
-
trait
ValueConstraint extends AnyRef
Interface for objects which provide constraints for values
- case class Vect(x: Double, y: Double, z: Double) extends Product with Serializable
- trait Version extends AnyRef
- trait ViewInterface extends AnyRef
- trait ViewSettings extends AnyRef
- trait Workspace extends ImporterUser with LiteralParser with RandomServices with ViewSettings with Controllable
- trait World extends AnyRef
- trait World3D extends World
- class WorldDimensionException extends Exception
- class WorldDimensions3D extends WorldDimensions
- trait WorldPropertiesInterface extends AnyRef
- trait WorldRenderable extends AnyRef
-
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
- trait WorldWithWorldRenderable extends World with WorldRenderable
-
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
-
trait
TokenHolder extends AnyRef
- Annotations
- @deprecated
- Deprecated
(Since version Use core.TokenHolder instead) 6.0.3
-
sealed
trait
ValueSet extends Iterable[Any] with BaseValueSet
- Annotations
- @deprecated
- Deprecated
(Since version use RefValueSet instead) 6.0.2
Value Members
- object APIVersion
- object AgentVariables
- object Approximate
- object Color extends core.Color
- object Constants
- object Dump extends core.Dump
- object Equality
- object Exceptions
- object FileIO
- object HexString
- object HubNetInterface
-
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...
- object LogoHashObject
- object ModelLoader
- object ModelReader
- object ModelSection
- object ModelSectionJ
- object ModelType
- object ModelTypeJ
- object NetLogoLegacyDialect extends Dialect
- object NetLogoLegacyDialectTokenMapper extends DelegatingMapper
- object NetLogoThreeDDialect extends Dialect
- object Numbers
- object OutputDestination
-
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.
- object PeriodicUpdateDelay
- object Perspective
- object PlotAction
- object PreviewCommands
- object Property extends Serializable
- object RandomSeedGenerator
- object RemoteFile
- object ScalaConversions
- object SimpleChangeEvent
- object StringUtils
- object ThreeDTokenMapper extends DelegatingMapper
- object TypeNames
- object ValueConstraint
- object Vect extends Serializable
- object Version extends Version
- object VersionHistory
-
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).