jadex.micro.tutorial.MainH2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-micro Show documentation
Show all versions of jadex-applications-micro Show documentation
The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.
package jadex.micro.tutorial;
import jadex.base.Starter;
import jadex.bridge.IExternalAccess;
import jadex.commons.future.IFuture;
/**
* Main class for starting the chat
* from the command line.
*/
public class MainH2
{
/**
* Main method starts the platform
* and creates a chat component.
*/
public static void main(String[] args)
{
// Merge arguments and default arguments.
String[] defargs = new String[]
{
"-gui", "false",
"-welcome", "false",
"-cli", "false",
"-printpass", "false"
};
String[] newargs = new String[defargs.length+args.length];
System.arraycopy(defargs, 0, newargs, 0, defargs.length);
System.arraycopy(args, 0, newargs, defargs.length, args.length);
// Start the platform with the arguments.
IFuture platfut = Starter.createPlatform(newargs);
// Wait until the platform has started and retrieve the platform access.
// ThreadSuspendable sus = new ThreadSuspendable();
IExternalAccess platform = platfut.get();
System.out.println("Started platform: "+platform.getComponentIdentifier());
}
}