Version 11 (modified by wouter, 6 years ago) ( diff )

--

This is the homepage of the Genius2 parties server. This server can provide running instances of specified agents.

The Genius2 main page is here.

The Parties server runs on Tomcat 8 and is developed with Eclipse EE.

Installation

  • Install your apache-tomcat 8 installation ​https://tomcat.apache.org/download-80.cgi. You can re-use an existing installation.
  • Download the parties server war file from the artifactory. Go into the latest version of the partiesserver and download (right click) the war file. NOTICE: your browser must have cookies enabled to access the artifactory.
  • Copy the downloaded war file into the tomcat webapps directory
  • (Re)start tomcat

Now your local partiesserver should be up and running.

Using

After installing and starting, go to http://localhost:8080/partiesserver to see if it works.

Example parties can be found in the general genius repository, for example the randomparty. The randomparty roughly looks like this

public class RandomParty extends DefaultParty {
	@Override
	public void notifyChange(Inform info) {
		// System.out.println("Received info:" + info);
		if (info instanceof Settings) {
			fetchProfile(((Settings) info).getProfile());
			this.me = ((Settings) info).getID();
		} else if (info instanceof ActionDone) {
			lastActor = ((ActionDone) info).getAction().getActor();
			Action otheract = ((ActionDone) info).getAction();
			if (otheract instanceof Offer) {
				lastReceivedBid = ((Offer) otheract).getBid();
			}
		} else if (info instanceof YourTurn) {
			myTurn();
		}
	}

	private void myTurn() {
		Action action;
		if (lastReceivedBid != null && profileint.getProfile()
				.getUtility(lastReceivedBid).doubleValue() > 0.6) {
			action = new Accept(lastActor, lastReceivedBid);
		} else {
			AllBidsList bidspace = new AllBidsList(getProfile().getDomain());
			long i = random.nextInt(bidspace.size().intValue());
			action = new Offer(me, bidspace.get(BigInteger.valueOf(i)));
		}
		try {
			getConnection().send(action);
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}

You can also download this source repository (you don't need this if you just want to use the parties)

svn checkout https://tracinsy.ewi.tudelft.nl/svn/Genius2PartiesServer/

Since this is a tomcat web application, you need Eclipse Enterprise edition if you want to use this from Eclipse. Also, to checkout from Eclipse, you need to prepare Eclipse for this. Check https://tracinsy.ewi.tudelft.nl/trac/Genius2/wiki/WikiStart

Create new party instance

A new instance of a party can be created by connecting to partiesserver/run/<party name>, for instance

http://localhost:8080/partiesserver/run/randomparty-1.0.0

There are two possible responses from the party server:

  1. a URL. This is the URL of the websocket behind which the newly instantiated party can be contacted.
  2. error code 503 "Service Unavailable" if there is no room on the partiesserver at this moment to instantiate another party

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.