Skip to content

Commit

Permalink
[docs] Add links to the cli tool documentation.
Browse files Browse the repository at this point in the history
close #670

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed May 11, 2017
1 parent bb822f3 commit 5881e4a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 283 deletions.
Expand Up @@ -14,9 +14,9 @@ Three methods could be used for launching an agent with Janus:



## Use the janus command-line tool
## Use the [:januscmd!] command-line tool

The SARL project provides a command-line tool for launching agents on the Janus runtime environment.
The SARL project provides a [command-line tool for launching agents](../tools/Janus.md) on the Janus runtime environment.


### Download the janus command-line tool
Expand All @@ -29,13 +29,13 @@ For launching an agent, you must launch the command-line tool with the fully-qua
name of the agent as parameter, [:janusagent:] in the following example.


janus [:janusagent](myapp.MyAgent)
[:januscmd](janus) [:janusagent](myapp.MyAgent)


The janus command-line tool provides options that will enable you to tune the launching configuration:


janus --help
[:januscmd!] --help


## Use the standard java method
Expand Down
Expand Up @@ -25,8 +25,9 @@ external contexts and inner contexts is not implemented.
Before reading this document, it is recommended reading the
[General Syntax Reference](../reference/GeneralSyntax.md).


<div class="bt-download">
<a href="https://github.com/gallandarakhneorg/tinymas"><img alt="Download the Source Code" src="[:sarlUrl!]/images/download-icon.png"/></a>
<a href="https://github.com/gallandarakhneorg/tinymas"><img alt="See the source" src="[:sarlUrl!]/images/download-icon.png"/></a>
</div>
The elements that are explained in this tutorial are:

Expand Down
Expand Up @@ -779,64 +779,5 @@ to stop its execution.
[:End:]


## Compile and Launch the agents

The last step of this tutorial is the definition of the launching process.
In the rest of this section, we discuss the use of the
[Janus runtime environment](http://www.janusproject.io) for running the agents.

The Janus platform is designed to launch a single agent at start-up.
Then, this launched agent must spawn the other agents in the system.
This is typically the case in the auction application.

<importantnote>In this section, we explain how to launch the agents from the command line interface.
For launching the agents from the Eclipse IDE, please read
[Run SARL Agent in the Eclipse IDE](../gettingstarted/RunSARLAgentEclipse.md).</importantnote>


### Compile the code
You must have a file that contains the compiled files of the tutorial, the Janus platform,
and all the needed libraries by SARL and Janus.

You could directly download this file by clicking on
the download icon at the top of this page; or by compiling the source code yourself.

If you download the source code of the [SARL demos](https://github.com/sarl/sarl-demos/), and
compile them with [Maven](http://maven.apache.org), you will obtain a JAR file with all
the mandatory elements inside. This file is located in the `target` folder,
and it has a name similar to `sarl-demos-0.1.0-with-dependencies.jar`.


### Execute with a runnable JAR

Here, there is two assumptions:

1. The file `sarl-demos-0.1.0-with-dependencies.jar` is execuable, i.e. it can be directly launched by the Java Virtual Machine.
2. From this file, the JVM is launching the Janus bootstrap automatically, i.e. it has a Main-Class set to `io.janusproject.Boot`.

On the command line, you must launch Janus with:

java -jar sarl-demos-0.1.0-with-dependencies.jar
io.sarl.docs.tutorials.holonicauction.Auctioneer

The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The third argument is the qualified name of the agent to launch.


### Execute without a runnable JAR

In opposite to the previous section, we assume that the file `sarl-demos-0.1.0-with-dependencies.jar`
is not executable. On the command line, you must launch Janus with:

java -cp sarl-demos-0.1.0-with-dependencies.jar
io.janusproject.Boot
io.sarl.docs.tutorials.holonicauction.Auctioneer

The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The string `io.janusproject.Boot` specifies the Java class to launch: the Janus bootstrap.
The first argument after the bootstrap is the qualified name of the agent to launch.


[:Include:](../legal.inc)

Expand Up @@ -385,101 +385,21 @@ one agent belonging to the default space. If not, the agent is sending the initi
[:End:]


## Compile and Launch the agents
## Launch the agents

The fourth step of this tutorial is the definition of the launching process.
In the rest of this section, we discuss the use of the
[Janus runtime environment](http://www.janusproject.io) for running the agents.

The Janus platform is designed to launch a single agent at start-up.
Then, this launched agent must spawn the other agents in the system.

<importantnote> In this section, we explain how to launch the agents from the command line interface.
For launching the agents from the Eclipse IDE, please read
[Run SARL Agent in the Eclipse IDE](../gettingstarted/RunSARLAgentEclipse.md).
</importantnote>


### Compile the code

You must have a file that contains the compiled files of the tutorial, the Janus platform,
and all the needed libraries by SARL and Janus.

You could directly download this file by clicking on the download icon at the top of this page; or by compiling
the source code yourself.

If you download the source code of the [SARL demos](https://github.com/sarl/sarl-demos), and
compile them with [Maven](http://maven.apache.org), you will obtain a JAR file with all the
mandatory elements inside. This file is located in the `target` folder,
and it has a name similar to `sarl-demos-0.1.0-with-dependencies.jar`.


### Method 1: Execute each agent in their own instance of Janus

The principle is to run each agent is a different instance of the Janus platform.

#### Execute with a runnable JAR

Here, there is two assumptions:

1. The file `sarl-demos-0.1.0-with-dependencies.jar` is executable, i.e. it can be directly launched by the Java Virtual Machine.
2. From this file, the JVM is launching the Janus bootstrap automatically, i.e. it has a Main-Class set to `io.janusproject.Boot`.


On the command line, you must launch the Janus instances with:


java -jar sarl-demos-0.1.0-with-dependencies.jar
io.sarl.docs.tutorials.pingpong.PongAgent


and:


java -jar sarl-demos-0.1.0-with-dependencies.jar
io.sarl.docs.tutorials.pingpong.PingAgent


The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The third arguments are the qualified names of the agents to launch.


#### Execute without a runnable JAR

In opposite to the previous section, we assume that the file
`sarl-demos-0.1.0-with-dependencies.jar` is not executable.
On the command line, you must launch Janus with:


java -cp sarl-demos-0.1.0-with-dependencies.jar
io.janusproject.Boot
io.sarl.docs.tutorials.pingpong.PongAgent


and:


java -cp sarl-demos-0.1.0-with-dependencies.jar
io.janusproject.Boot
io.sarl.docs.tutorials.pingpong.PingAgent



The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The string `io.janusproject.Boot` specify the Java class to launch: the Janus bootstrap.
The first arguments after the bootstraps are the qualified name of the agents to launch.


### Method 2: Execute all the agents in a single instance of Janus

The principle is to launch a single instance of Janus, and run all the agents inside.
Because of the design of the Janus platform, we must define an
agent that will launch the other agents. This agent is named
[:bootagent:]. It is defined below.


#### Defining the Boot agent

The boot agent uses the [:lifecyclecap:] capacity for launching agents in the default context.
This capacity provides the function `spawn(Class<? extends Agent>)`
for launching an agent of the given type.
Expand All @@ -506,39 +426,4 @@ function, which is provided by the [:lifecyclecap:] capacity too.
[:End:]


#### Execute with a runnable JAR

Here, there are two assumptions:

1. The file `sarl-demos-0.1.0-with-dependencies.jar` is runnable, i.e. it can be directly launched by the Java Virtual Machine.
2. From this file, the JVM is launching the Janus bootstrap automatically, i.e. it has a Main-Class set to `io.janusproject.Boot`.

On the command line, you must launch the Janus instance with:


java -jar sarl-demos-0.1.0-with-dependencies.jar
io.sarl.docs.tutorials.pingpong.BootAgent


The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above. The third argument
is the qualified name of the agent to launch.


#### Execute without a runnable JAR

In opposite to the previous section, we assume that the file `sarl-demos-0.1.0-with-dependencies.jar`
is not executable.
On the command line, you must launch Janus with:


java -cp sarl-demos-0.1.0-with-dependencies.jar
io.janusproject.Boot
io.sarl.docs.tutorials.pingpong.BootAgent


The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The string `io.janusproject.Boot` specifies the Java class to launch: the Janus bootstrap.
The first argument after the bootstrap is the qualified name of the agent to launch.


[:Include:](../legal.inc)
Expand Up @@ -564,93 +564,21 @@ one agent belonging to the default space. If not, the agent is sending the initi
[:End:]


## Compile and Launch the agents
## Launch the agents

The fourth step of this tutorial is the definition of the launching process.
In the rest of this section, we discuss the use of the
[Janus runtime environment](http://www.janusproject.io)
for running the agents.

The Janus platform is designed to launch a single agent at start-up.
Then, this launched agent must spawn the other agents in the system.

<importantnote> In this section, we explain how to launch the agents from the command line interface.
For launching the agents from the Eclipse IDE, please read
["Run SARL Agent in the Eclipse IDE"](../gettingstarted/RunSARLAgentEclipse.md).
</importantnote>


### Compile the code

You must have a file that contains the compiled files of the tutorial, the Janus platform,
and all the needed libraries by SARL and Janus.

You could directly download this file by clicking on the download icon at the top of this
page; or by compiling the source code yourself.

If you download the source code of the [SARL demos](https://github.com/sarl/sarl-demos), and
compile them with [Maven](http://maven.apache.org), you will obtain a JAR file with all
the mandatory elements inside. This file is located in the `target` folder,
and it has a name similar to `sarl-demos-0.1.0-with-dependencies.jar`.


### Method 1: Execute each agent in their own instance of Janus

The principle is to run each agent is a different instance of the Janus platform.


#### Execute with a runnable JAR

Here, there are two assumptions:

1. The file `sarl-demos-0.1.0-with-dependencies.jar` is executable, i.e. it can be directly launched by the Java Virtual Machine.
2. From this file, the JVM is launching the Janus bootstrap automatically, i.e. it has a Main-Class set to `io.janusproject.Boot`.

On the command line, you must launch the Janus instances with:

java -jar sarl-demos-0.1.0-with-dependencies.jar
io.sarl.docs.tutorials.pingpongspace.PongAgent


and:

java -jar sarl-demos-0.1.0-with-dependencies.jar
io.sarl.docs.tutorials.pingpongspace.PingAgent


The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The third arguments are the qualified names of the agents to launch.


#### Execute without a runnable JAR

In opposite to the previous section, we assume that the file `sarl-demos-0.1.0-with-dependencies.jar`
is not executable. On the command line, you must launch Janus with:

java -cp sarl-demos-0.1.0-with-dependencies.jar
io.janusproject.Boot
io.sarl.docs.tutorials.pingpongspace.PongAgent

and:

java -cp sarl-demos-0.1.0-with-dependencies.jar
io.janusproject.Boot
io.sarl.docs.tutorials.pingpongspace.PingAgent

The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The string `io.janusproject.Boot` specifies the Java class to launch: the Janus bootstrap.
The first arguments after the bootstraps are the qualified name of the agents to launch.


### Method 2: Execute all the agents in a single instance of Janus

The principle is to launch a single instance of Janus, and run all the agents inside.
Because of the design of the Janus platform, we must define an agent that will launch
the other agents. This agent is named [:bootagent:]. It is defined below.


#### Defining the Boot agent

The boot agent uses the [:lifecyclecap:] capacity for launching agents in the default context.
This capacity provides the function `spawn(Class<? extends Agent>)` for launching an
agent of the given type. When the boot agent has launched the two expected agents,
Expand All @@ -674,35 +602,5 @@ by the [:lifecyclecap:] capacity too.
[:End:]


#### Execute with a runnable JAR

Here, there are two assumptions:

1. The file `sarl-demos-0.1.0-with-dependencies.jar` is executable, i.e. it can be directly launched by the Java Virtual Machine.
2. From this file, the JVM is launching the Janus bootstrap automatically, i.e. it has a Main-Class set to `io.janusproject.Boot`.

On the command line, you must launch the Janus instance with:

java -jar sarl-demos-0.1.0-with-dependencies.jar
io.sarl.docs.tutorials.pingpongspace.BootAgent

The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The third argument is the qualified name of the agent to launch.


#### Execute without a runnable JAR

In opposite to the previous section, we assume that the file `sarl-demos-0.1.0-with-dependencies.jar`
is not executable. On the command line, you must launch Janus with:

java -cp sarl-demos-0.1.0-with-dependencies.jar
io.janusproject.Boot
io.sarl.docs.tutorials.pingpongspace.BootAgent

The file `sarl-demos-0.1.0-with-dependencies.jar` is explained above.
The string `io.janusproject.Boot` specifies the Java class to launch: the Janus bootstrap.
The first argument after the bootstrap is the qualified name of the agent to launch.


[:Include:](../legal.inc)

0 comments on commit 5881e4a

Please sign in to comment.