NetLogo allows users to write new commands and reporters in Java and other languages and use them in their models. This section of the User Manual introduces this facility and shows how to use an extension in your model once you have obtained or made one.
NetLogoでは、ユーザーがJavaやその他の言語を用いて新しいコマンドやレポーターを書き、モデルで使うことができます。ユーザーマニュアルのこの節では、拡張機能の紹介と、拡張機能を取得したり自作したときにモデルでどのように使うのかを説明します。
Extensions created by members of the NetLogo community are available from https://github.com/NetLogo/NetLogo/wiki/Extensions.
NetLogoコミュニティのメンバーが作成した拡張機能はhttps://github.com/NetLogo/NetLogo/wiki/Extensionsに掲載されています。
For information on creating your own extensions, go here.
あなた自身が拡張機能を作成する場合の情報はこちらをご覧ください。
To use an extension in a model, add the extensions keyword at the beginning of the Code tab, before declaring any breeds or variables.
モデルで拡張機能を使用するには、品種や変数を宣言する前のコードタブの最初の位置に予約語extensionsを記載します。
After extensions comes a list of extension names in square brackets. For example:
extensionsに続いて、角括弧内に拡張機能名のリストを記載します。例えば:
extensions [sound speech]
Using extensions tells NetLogo to find and open the specified extension and makes the custom commands and reporters found in the extension available to the current model. You can use these commands and reporters just as if they were built-in NetLogo primitives.
extensionsを使うことで、NetLogoは特定の拡張機能を見つけてオープンし、拡張機能が持っているカスタムコマンドとレポーターをカレントモデルで使用できるようになります。ユーザーはこれらのコマンドとレポーターをNetLogoに元からビルトインされていたものであるかのように使用することができます。
NetLogo will look for extensions in several places:
NetLogoは拡張機能を次の場所で探します:
extensions
folder in the same location as the NetLogo application.extensions
フォルダEach NetLogo extension consists of a folder with the same name as the extension, entirely in lower case. This folder must contain a JAR file with the same name as the folder. For example the sound extension is stored in a folder called sound with a file inside called sound.jar.
それぞれのNetLogo拡張機能は、拡張機能と同じ名前のすべて小文字からなるフォルダから構成されています。このフォルダはフォルダと同じ名前のJARファイルを含む必要があります。例えばsound拡張機能はsound.jarファイルを内部に持つsoundフォルダに格納されています。
To install a NetLogo extension for use by any model, put the extension's folder in the extensions
directory in the NetLogo directory. Or, you can just keep the extension's folder in the same folder as the model that uses it.
NetLogo拡張機能をインストールするには、どのモデルでも使えるようにするためには、NetLogoディレクトリ内のextensions
ディレクトリに拡張機能のフォルダを置きます。あるいは、モデルが使用しているフォルダに拡張機能のフォルダを置くこともできます。
Some extensions depend on additional files. These files will be in the extension's folder along with the JAR file. The folder may also contain other files such as documentation and example models.
拡張機能によっては追加のファイルを使うものがあります。これらのファイルはJARファイルと一緒に拡張機能のフォルダに置きます。フォルダはまた文書やモデル例などの他のファイルを含むこともあります。