Changes between Version 183 and Version 184 of WikiStart
- Timestamp:
- 05/14/19 11:47:32 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart
v183 v184 8 8 9 9 ||= 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|| 11 11 ||profilesserver||a web server that provides profiles and domain descriptions||[https://tracinsy.ewi.tudelft.nl/trac/Genius2ProfilesServer profiles server]|| 12 12 ||partiesserver||A web server that provides instances of running parties to use for negotiation||[https://tracinsy.ewi.tudelft.nl/trac/Genius2PartiesServer parties server]|| … … 27 27 ||shared profile ||profilesserver on own server or on an existing profilesserver on the web* || 28 28 ||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.|| 30 30 ||run your own protocols||as with running semi-private sessions/tournaments|| 31 31 … … 62 62 == Party 63 63 The 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 agentdiscussed below.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 party discussed below. 65 65 66 66 The Inform objects are all available inside the inform package inside the party module. … … 74 74 Parties, domains, profiles and protocols are stored and used on remote machines. 75 75 We 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 agentbelow for an example.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 party below for an example. 77 77 78 78 There are a number of schemes used for references: … … 106 106 = Writing a party in Java 107 107 108 Example parties can be found [https://tracinsy.ewi.tudelft.nl/trac/Genius2/browser/exampleparties here]. A n agentis 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 agentlooks like this108 Example 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 110 The basic structure of an party looks like this 111 111 {{{ 112 112 public class RandomParty extends DefaultParty { … … 156 156 157 157 == Preparing the jar file 158 In order to put your agenton the [https://tracinsy.ewi.tudelft.nl/trac/Genius2PartiesServer partiesserver] for running, you need a jar file of your party.158 In 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. 159 159 160 160 Normally 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. … … 163 163 Party 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. 164 164 165 The example random agentdoes this from the maven build script.165 The example randomparty does this from the maven build script. 166 166 167 167 We recommend to do initialization of the party only in the init() and not in the constructor or static code. … … 170 170 171 171 = 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 agentlooks like this:172 We 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: 173 173 {{{ 174 174 class RandomParty (DefaultParty): … … 206 206 }}} 207 207 208 You need to wrap your python agentinto 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].208 You 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]. 209 209 210 210 … … 363 363 364 364 == Running == 365 Make sure your agents are in the java classpath.365 Make sure your parties are in the java classpath. 366 366 367 367 A stand-alone runner can now be started as follows