You are here: start » solenopsis

Back

Solenopsis

Solenopsis is a platform for the development and deployment of distributed (ant-based) algorithms.

Download

Java source code: SolenopsisII_20100728.tar.gz (Rev. 20100728)

License: GPL3

Requirements: Java JRE 6

Publications

Brocco, Amos, Hirsbrunner, Béat and Courant, Michèle, Solenopsis: A Framework for the Development of Ant Algorithms, in: Swarm Intelligence Symposium, pages 316-323, IEEE, SIS, Honolulu, Hawaii, April, 2007.

Ping Pong Ant

In this example two nodes are created and executed. The first node, alpha, sends an ant of type pingant to the second node, beta. On each node, the ant prints a message.

Node initialization

Nodes are initialized by means of a script, that is passed upon execution, i.e. :
java shell.Shell --script [scriptfile]
The script file for node alpha, saved as alpha.dlisp is as follows:
(platform::init {
	"codepath" : "path where the ant code is found",
	"port"	   : 56335 })
	
(var d (platform::addDaemon "alpha"))

(platform::call d 
	"ants::new" 
	"pingpong.ant" { "$target" : "bebop://localhost:56336/beta" })

(platform::run)
The call to the platform::init function initializes the execution platform. The dictionary parameter is used to define some options like the codepath, which sets the path where the ant code is to be found, and port, which defines the listening port for the platform's mail server (where incoming ant are received).

By means of the platform::addDaemon function a node is created on the network. The node is assigned a name (alpha in this case), and the function returns the full address of the node (which has the form bebop://localhost:56335/alpha). Subsequently, platform::call is used to invoke the function ants::new on the previously created node, so that an ant of type pingpong.ant is instantiated on it. The last parameter, a dictionary, is used to define variables inside the ant: in this example the $target variable is assigned the address of the beta node.

Finally, calling the platform::run function results in the execution of nodes.

The script file for node beta, saved as beta.dlisp, is as follows:
(platform::init {
	"codepath" : "path where the ant code is found",
	"port"	   : 56336 })
	
(var d (platform::addDaemon "beta"))

(platform::run)
The code for the ant itself, saved as pingpong.ant, is:
(virtual $target)

(while 1 (begin
	(var source (migrate $target))
	(print "Hello beta!")
	(migrate source)
	(print "Hello alpha!")))
To run the example do:
java shell.Shell --script beta.dlisp

java shell.Shell --script alpha.dlisp

Towers of hanoi

(TODO)

BlåtAnt-S

(TODO)

solenopsis.txt · Last modified: 2012/07/04 10:54 by attila
Kleine Websites, die ein Wiki als CMS verwenden.de