Changes between Version 183 and Version 184 of WikiStart


Ignore:
Timestamp:
05/14/19 11:47:32 (6 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v183 v184  
    88
    99||= name =||= description =||= more information =||
    10 ||the core ||the data structures for issues, values, bids, profiles, events and actions, agents etc.||here||
     10||the core ||the data structures for issues, values, bids, profiles, events and actions, parties etc.||here||
    1111||profilesserver||a web server that provides profiles and domain descriptions||[https://tracinsy.ewi.tudelft.nl/trac/Genius2ProfilesServer profiles server]||
    1212||partiesserver||A web server that provides instances of running parties to use for negotiation||[https://tracinsy.ewi.tudelft.nl/trac/Genius2PartiesServer parties server]||
     
    2727||shared profile ||profilesserver on own server or on an existing profilesserver on the web* ||
    2828||public party with built-in private profile||Hard-code the profile in the party. Party runs as in competition. ||
    29 ||semi-private sessions/tournaments||Run your own runserver, possibly even from behind a firewall or on your local computer. Existing parties- and profilesservers are used in your runs. Negotiation results are handled only on your computer and not visible outside. Others might be able to see agents act on your behalf, but it's not trivial to determine that they are negotiating against each other, especially if these parties are on different partiesservers.||
     29||semi-private sessions/tournaments||Run your own runserver, possibly even from behind a firewall or on your local computer. Existing parties- and profilesservers are used in your runs. Negotiation results are handled only on your computer and not visible outside. Others might be able to see parties act on your behalf, but it's not trivial to determine that they are negotiating against each other, especially if these parties are on different partiesservers.||
    3030||run your own protocols||as with running semi-private sessions/tournaments||
    3131
     
    6262== Party
    6363The party module contains basic interfaces for implementing your negotiation party.
    64 The main class is Party, which defines the basic functionality required for every negotiation party. The heart of the party is that your Party implements Connectable<Inform,Action>. Connectable contains 2 main functions: connect and disconnect.  When connect is called, your party receives a Connection over which it receives Inform objects and can send Action objects. What exactly is sent and received is determined by the protocol (see the protocol section below). For example if the SAOP protocol is used, your party will receive a YourTurn message, after which it decides on its action and sends it into the Connection. See also the example agent discussed below.
     64The main class is Party, which defines the basic functionality required for every negotiation party. The heart of the party is that your Party implements Connectable<Inform,Action>. Connectable contains 2 main functions: connect and disconnect.  When connect is called, your party receives a Connection over which it receives Inform objects and can send Action objects. What exactly is sent and received is determined by the protocol (see the protocol section below). For example if the SAOP protocol is used, your party will receive a YourTurn message, after which it decides on its action and sends it into the Connection. See also the example party discussed below.
    6565
    6666The Inform objects are all available inside the inform package inside the party module.
     
    7474Parties, domains,  profiles and protocols are stored and used on remote machines.
    7575We use IRI's (internationalized resource identifier, which looks similar to the well known URLs you use in your web browser) to refer to them. These IRI's are packed inside objects like the PartyRef, ProtocolRef, ProfileRef, DomainRef so that it is clear what type of object the IRI is referring to.
    76 For example, when your party is initialized, it usually receives a Settings object that contains a ProfileRef. The intention is that the party fetches the actual profile from the web, using the IRI in the ProtocolRef. See the example agent below for an example.
     76For example, when your party is initialized, it usually receives a Settings object that contains a ProfileRef. The intention is that the party fetches the actual profile from the web, using the IRI in the ProtocolRef. See the example party below for an example.
    7777
    7878There are a number of schemes used for references:
     
    106106= Writing a party in Java
    107107
    108 Example parties can be found [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/exampleparties here]. An agent is compiled with maven. After compilation ({{{mvn package}}}) you get a {{{target/yourparty-X.Y.Z-jar-with-dependencies.jar}}} that can be copied into the parties server for deployment.
    109 
    110 The basic structure of an agent looks like this
     108Example parties can be found [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/exampleparties here]. A party is compiled with maven. After compilation ({{{mvn package}}}) you get a {{{target/yourparty-X.Y.Z-jar-with-dependencies.jar}}} that can be copied into the parties server for deployment.
     109
     110The basic structure of an party looks like this
    111111{{{
    112112public class RandomParty extends DefaultParty {
     
    156156
    157157== Preparing the jar file
    158 In order to put your agent on the [https://tracinsy.ewi.tudelft.nl/trac/Genius2PartiesServer partiesserver] for running, you need a jar file of your party.
     158In order to put your party on the [https://tracinsy.ewi.tudelft.nl/trac/Genius2PartiesServer partiesserver] for running, you need a jar file of your party.
    159159
    160160Normally the party includes all dependencies. The jar files are loaded with an isolated jar class loader that should avoid collisions with possibly identically named but possibly different packages in other jar files.
     
    163163Party jar files must have a Main-Class set in the MANIFEST.MF file. This main-class must implement Party and have a no-arg constructor.
    164164
    165 The example randomagent does this from the maven build script.
     165The example randomparty does this from the maven build script.
    166166
    167167We recommend to do initialization of the party only in the init() and not in the constructor or static code.
     
    170170
    171171= Writing a party in Python
    172 We provide a python-to-java adapter so that you can easily write your agent in python instead of Java. You can check the full working example code [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/exampleparties/randompartypy/src/main/resources/RandomParty.py here]. A python-based agent looks like this:
     172We provide a python-to-java adapter so that you can easily write your party in python instead of Java. You can check the full working example code [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/exampleparties/randompartypy/src/main/resources/RandomParty.py here]. A python-based party looks like this:
    173173{{{
    174174class RandomParty (DefaultParty):
     
    206206}}}
    207207
    208 You need to wrap your python agent into a jar wrapper to get it accepted by the parties server. To do this, check the javadoc with the [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/pythonadapter/src/main/java/genius2/pythonadapter/PythonPartyAdapter.java PythonPartyAdapter].
     208You need to wrap your python party into a jar wrapper to get it accepted by the parties server. To do this, check the javadoc with the [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/pythonadapter/src/main/java/genius2/pythonadapter/PythonPartyAdapter.java PythonPartyAdapter].
    209209
    210210
     
    363363
    364364== Running ==
    365 Make sure your agents are in the java classpath.
     365Make sure your parties are in the java classpath.
    366366
    367367A stand-alone runner can now be started as follows