Compile and Run an Indus program

Once implemented, the agent in the previous section can be compiled, deployed into the Indus container running on a local host, and then run either from the local or a remote host.

icompile

Indus files are compiled by the Indus compiler and converted to byte code. This is done using the command icompile

Syntax: icompile  where, agent name/component name – Name of the component / agent Indus implementation file (class file that implements an agent or component) which needs to be compiled.

An agent or component definition file can also be separately compiled. However, compiling an agent or component implementation file also automatically compiles an agent or component definition file.

In the the previous section : D:\>icompile MyTeacher where, MyTeacher is the agent implementation file that generates MyTeacher.class.

irun

Once an agent or component is implemented, it needs to be deployed into the Indus container. The container enables deployed agents and components to use and provide services across a distributed network. An agent and component become capable of instantiation once they are deployed into an Indus container.

Syntax: irun where, agent name – Name of the agent to be deployed agentID – The Id by which a User agent is instantiated

In the example in the previous section : D:\>irun MyTeacher Mary Which will execute MyTeacher and display the result on console.

The irun command behaves differently for different implementation types of agents in Indus. irun does not produce any result for components since Components lack a main in Indus. The details are available at Instantiating Agents and Components.

Next : Context, newType and main