Changeset 21 for exampleparties


Ignore:
Timestamp:
09/22/20 08:52:04 (4 years ago)
Author:
bart
Message:

Version 1.5.

Location:
exampleparties
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • exampleparties/anac2019/agentgg/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties.anac2019</groupId>
    77        <artifactId>agentgg</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.6</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    6060                        <groupId>tudelft.utilities</groupId>
    6161                        <artifactId>immutablelist</artifactId>
    62                         <version>1.1.0</version>
     62                        <version>1.1.1</version>
    6363                </dependency>
    6464
  • exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/AgentGG.java

    r19 r21  
    1919import geniusweb.actions.PartyId;
    2020import geniusweb.bidspace.AllBidsList;
     21import geniusweb.inform.ActionDone;
     22import geniusweb.inform.Finished;
     23import geniusweb.inform.Inform;
     24import geniusweb.inform.Settings;
     25import geniusweb.inform.YourTurn;
    2126import geniusweb.issuevalue.Bid;
    2227import geniusweb.issuevalue.Value;
    2328import geniusweb.party.Capabilities;
    2429import geniusweb.party.DefaultParty;
    25 import geniusweb.party.inform.ActionDone;
    26 import geniusweb.party.inform.Finished;
    27 import geniusweb.party.inform.Inform;
    28 import geniusweb.party.inform.Settings;
    29 import geniusweb.party.inform.YourTurn;
    3030import geniusweb.profile.PartialOrdering;
    3131import geniusweb.profileconnection.ProfileConnectionFactory;
  • exampleparties/anac2019/agentgg/src/test/java/geniusweb/exampleparties/agentgg/AgentGGTest.java

    r19 r21  
    3434import geniusweb.actions.PartyId;
    3535import geniusweb.connection.ConnectionEnd;
     36import geniusweb.inform.ActionDone;
     37import geniusweb.inform.Finished;
     38import geniusweb.inform.Inform;
     39import geniusweb.inform.Settings;
     40import geniusweb.inform.YourTurn;
    3641import geniusweb.issuevalue.Bid;
    3742import geniusweb.party.Capabilities;
    38 import geniusweb.party.inform.ActionDone;
    39 import geniusweb.party.inform.Finished;
    40 import geniusweb.party.inform.Inform;
    41 import geniusweb.party.inform.Settings;
    42 import geniusweb.party.inform.YourTurn;
    4343import geniusweb.profile.DefaultPartialOrdering;
    4444import geniusweb.profile.PartialOrdering;
  • exampleparties/anac2019/winkyagent/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties.anac2019</groupId>
    77        <artifactId>winkyagent</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.6</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    6060                        <groupId>tudelft.utilities</groupId>
    6161                        <artifactId>immutablelist</artifactId>
    62                         <version>1.1.0</version>
     62                        <version>1.1.1</version>
    6363                </dependency>
    6464
  • exampleparties/anac2019/winkyagent/src/main/java/geniusweb/exampleparties/anac2019/winkyagent/WinkyAgent.java

    r12 r21  
    1919import geniusweb.actions.PartyId;
    2020import geniusweb.bidspace.AllBidsList;
     21import geniusweb.inform.ActionDone;
     22import geniusweb.inform.Finished;
     23import geniusweb.inform.Inform;
     24import geniusweb.inform.Settings;
     25import geniusweb.inform.YourTurn;
    2126import geniusweb.issuevalue.Bid;
    2227import geniusweb.issuevalue.DiscreteValue;
     
    2631import geniusweb.party.Capabilities;
    2732import geniusweb.party.DefaultParty;
    28 import geniusweb.party.inform.ActionDone;
    29 import geniusweb.party.inform.Finished;
    30 import geniusweb.party.inform.Inform;
    31 import geniusweb.party.inform.Settings;
    32 import geniusweb.party.inform.YourTurn;
    3333import geniusweb.profile.PartialOrdering;
    3434import geniusweb.profileconnection.ProfileConnectionFactory;
  • exampleparties/anac2019/winkyagent/src/test/java/geniusweb/exampleparties/anac2019/winkyagent/WinkyAgentTest.java

    r12 r21  
    3434import geniusweb.actions.PartyId;
    3535import geniusweb.connection.ConnectionEnd;
     36import geniusweb.inform.ActionDone;
     37import geniusweb.inform.Finished;
     38import geniusweb.inform.Inform;
     39import geniusweb.inform.Settings;
     40import geniusweb.inform.YourTurn;
    3641import geniusweb.issuevalue.Bid;
    3742import geniusweb.party.Capabilities;
    38 import geniusweb.party.inform.ActionDone;
    39 import geniusweb.party.inform.Finished;
    40 import geniusweb.party.inform.Inform;
    41 import geniusweb.party.inform.Settings;
    42 import geniusweb.party.inform.YourTurn;
    4343import geniusweb.profile.DefaultPartialOrdering;
    4444import geniusweb.profile.PartialOrdering;
  • exampleparties/boulware/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>boulware</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.10</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
  • exampleparties/comparebids/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>comparebids</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.6</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    5555                        <groupId>tudelft.utilities</groupId>
    5656                        <artifactId>immutablelist</artifactId>
    57                         <version>1.1.0</version>
     57                        <version>1.1.1</version>
    5858                </dependency>
    5959
  • exampleparties/comparebids/src/main/java/geniusweb/exampleparties/comparebids/CompareBids.java

    r10 r21  
    1212import geniusweb.actions.ElicitComparison;
    1313import geniusweb.actions.PartyId;
     14import geniusweb.inform.ActionDone;
     15import geniusweb.inform.Finished;
     16import geniusweb.inform.Inform;
     17import geniusweb.inform.Settings;
    1418import geniusweb.issuevalue.Bid;
    1519import geniusweb.party.Capabilities;
    1620import geniusweb.party.DefaultParty;
    17 import geniusweb.party.inform.ActionDone;
    18 import geniusweb.party.inform.Finished;
    19 import geniusweb.party.inform.Inform;
    20 import geniusweb.party.inform.Settings;
    2121import geniusweb.profile.PartialOrdering;
    2222import geniusweb.profile.Profile;
  • exampleparties/comparebids/src/test/java/geniusweb/exampleparties/comparebids/CompareBidsTest.java

    r10 r21  
    2929import geniusweb.bidspace.AllBidsList;
    3030import geniusweb.connection.ConnectionEnd;
     31import geniusweb.inform.ActionDone;
     32import geniusweb.inform.Inform;
     33import geniusweb.inform.Settings;
    3134import geniusweb.issuevalue.Bid;
    3235import geniusweb.party.Capabilities;
    33 import geniusweb.party.inform.ActionDone;
    34 import geniusweb.party.inform.Inform;
    35 import geniusweb.party.inform.Settings;
    3636import geniusweb.profile.Profile;
    3737import geniusweb.profile.utilityspace.LinearAdditive;
  • exampleparties/conceder/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>conceder</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.10</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
  • exampleparties/hardliner/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>hardliner</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.10</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
  • exampleparties/humangui/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>humangui</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.6</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    4646                        <artifactId>profileconnection</artifactId>
    4747                        <version>${geniusweb.version}</version>
    48                 </dependency>
    49                 <dependency>
    50                         <groupId>tudelft.utilities</groupId>
    51                         <artifactId>immutablelist</artifactId>
    52                         <version>1.1.0</version>
    5348                </dependency>
    5449                <dependency>
  • exampleparties/humangui/src/main/java/geniusweb/exampleparties/humangui/BiddingInfo.java

    r9 r21  
    1313import geniusweb.actions.PartyId;
    1414import geniusweb.connection.ConnectionEnd;
     15import geniusweb.inform.Inform;
     16import geniusweb.inform.Settings;
    1517import geniusweb.issuevalue.Bid;
    16 import geniusweb.party.inform.Inform;
    17 import geniusweb.party.inform.Settings;
    1818import geniusweb.profile.Profile;
    1919import geniusweb.profileconnection.ProfileInterface;
  • exampleparties/humangui/src/main/java/geniusweb/exampleparties/humangui/HumanGui.java

    r10 r21  
    1111import geniusweb.actions.Action;
    1212import geniusweb.actions.Offer;
     13import geniusweb.inform.ActionDone;
     14import geniusweb.inform.Finished;
     15import geniusweb.inform.Inform;
     16import geniusweb.inform.Settings;
     17import geniusweb.inform.YourTurn;
    1318import geniusweb.party.Capabilities;
    1419import geniusweb.party.DefaultParty;
    1520import geniusweb.party.Party;
    16 import geniusweb.party.inform.ActionDone;
    17 import geniusweb.party.inform.Finished;
    18 import geniusweb.party.inform.Inform;
    19 import geniusweb.party.inform.Settings;
    20 import geniusweb.party.inform.YourTurn;
    2121import geniusweb.profileconnection.ProfileConnectionFactory;
    2222import geniusweb.profileconnection.ProfileInterface;
  • exampleparties/humangui/src/test/java/geniusweb/exampleparties/humangui/BiddingInfoTest.java

    r10 r21  
    2929import geniusweb.actions.Accept;
    3030import geniusweb.actions.PartyId;
     31import geniusweb.inform.Settings;
    3132import geniusweb.issuevalue.Bid;
    32 import geniusweb.party.inform.Settings;
    3333import geniusweb.profile.Profile;
    3434import geniusweb.profile.utilityspace.LinearAdditive;
  • exampleparties/humangui/src/test/java/geniusweb/exampleparties/humangui/HumanGuiTest.java

    r11 r21  
    2727import geniusweb.actions.PartyId;
    2828import geniusweb.bidspace.AllBidsList;
     29import geniusweb.inform.ActionDone;
     30import geniusweb.inform.Finished;
     31import geniusweb.inform.Settings;
     32import geniusweb.inform.YourTurn;
    2933import geniusweb.issuevalue.Bid;
    3034import geniusweb.party.Capabilities;
    31 import geniusweb.party.inform.ActionDone;
    32 import geniusweb.party.inform.Finished;
    33 import geniusweb.party.inform.Settings;
    34 import geniusweb.party.inform.YourTurn;
    3535import geniusweb.profile.Profile;
    3636import geniusweb.profile.utilityspace.LinearAdditive;
  • exampleparties/humangui/src/test/java/geniusweb/exampleparties/humangui/MyGUITest.java

    r9 r21  
    1919import geniusweb.actions.PartyId;
    2020import geniusweb.connection.ConnectionEnd;
    21 import geniusweb.party.inform.Inform;
    22 import geniusweb.party.inform.Settings;
     21import geniusweb.inform.Inform;
     22import geniusweb.inform.Settings;
    2323import geniusweb.profileconnection.ProfileConnectionFactory;
    2424import geniusweb.profileconnection.ProfileInterface;
  • exampleparties/humangui/src/test/java/geniusweb/exampleparties/humangui/TestConnection.java

    r9 r21  
    88import geniusweb.actions.Action;
    99import geniusweb.connection.ConnectionEnd;
    10 import geniusweb.party.inform.Inform;
     10import geniusweb.inform.Inform;
    1111import geniusweb.references.Reference;
    1212import tudelft.utilities.listener.DefaultListenable;
  • exampleparties/linear/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>linear</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.10</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
  • exampleparties/randomparty/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>randomparty</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.6</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    5555                        <groupId>tudelft.utilities</groupId>
    5656                        <artifactId>immutablelist</artifactId>
    57                         <version>1.1.0</version>
     57                        <version>1.1.1</version>
    5858                </dependency>
    5959
  • exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java

    r10 r21  
    55import java.util.Arrays;
    66import java.util.HashSet;
     7import java.util.List;
    78import java.util.Random;
    89import java.util.logging.Level;
     10import java.util.stream.Collectors;
    911
    1012import geniusweb.actions.Accept;
     
    1214import geniusweb.actions.Offer;
    1315import geniusweb.actions.PartyId;
     16import geniusweb.actions.Vote;
     17import geniusweb.actions.Votes;
    1418import geniusweb.bidspace.AllPartialBidsList;
     19import geniusweb.inform.ActionDone;
     20import geniusweb.inform.Finished;
     21import geniusweb.inform.Inform;
     22import geniusweb.inform.OptIn;
     23import geniusweb.inform.Settings;
     24import geniusweb.inform.Voting;
     25import geniusweb.inform.YourTurn;
    1526import geniusweb.issuevalue.Bid;
    1627import geniusweb.party.Capabilities;
    1728import geniusweb.party.DefaultParty;
    18 import geniusweb.party.inform.ActionDone;
    19 import geniusweb.party.inform.Finished;
    20 import geniusweb.party.inform.Inform;
    21 import geniusweb.party.inform.Settings;
    22 import geniusweb.party.inform.YourTurn;
    2329import geniusweb.profile.PartialOrdering;
    2430import geniusweb.profile.Profile;
     
    3339 * A simple party that places random bids and accepts when it receives an offer
    3440 * with sufficient utility.
     41 * <h2>voting</h2> If the party receives a parameter "minPower", it will
     42 * {@link Vote} using that minPower instead of the default value 2 if it
     43 * receives a {@link Voting} request.
    3544 */
    3645public class RandomParty extends DefaultParty {
     
    4150        protected ProfileInterface profileint;
    4251        private Progress progress;
     52        private Settings settings;
     53        private Votes lastvotes;
    4354
    4455        public RandomParty() {
     
    5869                                this.me = settings.getID();
    5970                                this.progress = settings.getProgress();
     71                                this.settings = settings;
    6072                        } else if (info instanceof ActionDone) {
    6173                                Action otheract = ((ActionDone) info).getAction();
     
    6476                                }
    6577                        } else if (info instanceof YourTurn) {
    66                                 myTurn();
    67                                 if (progress instanceof ProgressRounds) {
    68                                         progress = ((ProgressRounds) progress).advance();
    69                                 }
     78                                makeOffer();
     79                                nextRound();
    7080                        } else if (info instanceof Finished) {
    7181                                getReporter().log(Level.INFO, "Final ourcome:" + info);
     82                        } else if (info instanceof Voting) {
     83                                lastvotes = vote((Voting) info);
     84                                getConnection().send(lastvotes);
     85                                nextRound();
     86                        } else if (info instanceof OptIn) {
     87                                // just repeat our last vote.
     88                                getConnection().send(lastvotes);
     89                                nextRound();
    7290                        }
    7391                } catch (Exception e) {
     
    7694        }
    7795
     96        private void nextRound() {
     97                if (progress instanceof ProgressRounds) {
     98                        progress = ((ProgressRounds) progress).advance();
     99                }
     100
     101        }
     102
    78103        @Override
    79104        public Capabilities getCapabilities() {
    80                 return new Capabilities(new HashSet<>(Arrays.asList("SAOP")));
     105                return new Capabilities(
     106                                new HashSet<>(Arrays.asList("SAOP", "AMOP", "MOPAC")));
    81107        }
    82108
     
    86112        }
    87113
    88         private void myTurn() throws IOException {
     114        /**
     115         * send our next offer
     116         */
     117        private void makeOffer() throws IOException {
    89118                Action action;
    90                 if (isGood(lastReceivedBid)) {
     119                String protocol = settings.getProtocol().getURI().getPath();
     120                if ((protocol.equals("SAOP") || protocol.equals("SHAOP"))
     121                                && isGood(lastReceivedBid)) {
    91122                        action = new Accept(me, lastReceivedBid);
    92123                } else {
     
    105136        }
    106137
    107         private boolean isGood(Bid bid) throws IOException {
     138        /**
     139         * @param bid the bid to check
     140         * @return true iff bid is good for us.
     141         */
     142        private boolean isGood(Bid bid) {
    108143                if (bid == null)
    109144                        return false;
    110                 Profile profile = profileint.getProfile();
    111                 if (profile instanceof UtilitySpace) {
     145                Profile profile;
     146                try {
     147                        profile = profileint.getProfile();
     148                } catch (IOException e) {
     149                        throw new IllegalStateException(e);
     150                }
     151                if (profile instanceof UtilitySpace)
    112152                        return ((UtilitySpace) profile).getUtility(bid).doubleValue() > 0.6;
    113                 }
    114153                if (profile instanceof PartialOrdering) {
    115154                        return ((PartialOrdering) profile).isPreferredOrEqual(bid,
    116155                                        profile.getReservationBid());
    117156                }
    118                 throw new IllegalArgumentException(
    119                                 "Can not handle profile type " + profile.getClass());
     157                return false;
     158        }
     159
     160        /**
     161         * @param voting the {@link Voting} object containing the options
     162         *
     163         * @return our next Votes.
     164         */
     165        private Votes vote(Voting voting) throws IOException {
     166                Object val = settings.getParameters().get("minPowwer");
     167                Integer n = (val instanceof Integer) ? (Integer) val : 2;
     168                for (Bid bid : voting.getBids()) {
     169                        System.out.println("Bid " + bid + "="
     170                                        + ((UtilitySpace) profileint.getProfile()).getUtility(bid));
     171                }
     172                List<Vote> votes = voting.getBids().stream().distinct()
     173                                .filter(bid -> isGood(bid)).map(bid -> new Vote(me, bid, n))
     174                                .collect(Collectors.toList());
     175                return new Votes(me, votes);
    120176        }
    121177
  • exampleparties/randomparty/src/test/java/geniusweb/exampleparties/randomparty/RandomPartyTest.java

    r10 r21  
    1616import java.nio.file.Files;
    1717import java.nio.file.Paths;
     18import java.util.Arrays;
     19import java.util.Collections;
    1820import java.util.LinkedList;
    1921import java.util.List;
     
    3234import geniusweb.actions.Offer;
    3335import geniusweb.actions.PartyId;
     36import geniusweb.actions.Votes;
    3437import geniusweb.bidspace.AllBidsList;
    3538import geniusweb.connection.ConnectionEnd;
     39import geniusweb.inform.ActionDone;
     40import geniusweb.inform.Finished;
     41import geniusweb.inform.Inform;
     42import geniusweb.inform.Settings;
     43import geniusweb.inform.Voting;
     44import geniusweb.inform.YourTurn;
    3645import geniusweb.issuevalue.Bid;
    3746import geniusweb.party.Capabilities;
    38 import geniusweb.party.inform.ActionDone;
    39 import geniusweb.party.inform.Finished;
    40 import geniusweb.party.inform.Inform;
    41 import geniusweb.party.inform.Settings;
    42 import geniusweb.party.inform.YourTurn;
    4347import geniusweb.profile.Profile;
    4448import geniusweb.profile.utilityspace.LinearAdditive;
     
    5357public class RandomPartyTest {
    5458
     59        private static final PartyId PARTY1 = new PartyId("party1");
    5560        private static final String SAOP = "SAOP";
    5661        private static final PartyId otherparty = new PartyId("other");
     
    6065        private RandomParty party;
    6166        private final TestConnection connection = new TestConnection();
    62         private final ProtocolRef protocol = mock(ProtocolRef.class);
     67        private final ProtocolRef protocol = new ProtocolRef(SAOP);
    6368        private final ProgressRounds progress = mock(ProgressRounds.class);
    6469        private Settings settings;
     
    7075                        IOException, URISyntaxException {
    7176                party = new RandomParty();
    72                 settings = new Settings(new PartyId("party1"),
     77                settings = new Settings(PARTY1,
    7378                                new ProfileRef(new URI("file:" + PROFILE)), protocol, progress,
    7479                                parameters);
     
    189194        }
    190195
     196        @Test
     197        public void testVoting() {
     198                party.connect(connection);
     199                party.notifyChange(settings);
     200
     201                Bid bid = findGoodBid();
     202                party.notifyChange(new Voting(Arrays.asList(bid),
     203                                Collections.singletonMap(PARTY1, 1)));
     204                assertEquals(1, connection.getActions().size());
     205                Action action = connection.getActions().get(0);
     206                assertTrue(action instanceof Votes);
     207                assertEquals(1, ((Votes) action).getVotes().size());
     208                assertEquals(bid, ((Votes) action).getVotes().get(0).getBid());
     209        }
     210
    191211}
    192212
  • exampleparties/randompartypy/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>randompyparty</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.10</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    4848                        <groupId>tudelft.utilities</groupId>
    4949                        <artifactId>immutablelist</artifactId>
    50                         <version>1.1.0</version>
     50                        <version>1.1.1</version>
    5151                </dependency>
    5252
  • exampleparties/randompartypy/src/main/resources/RandomParty.py

    r10 r21  
    22import traceback
    33
    4 import geniusweb.party.inform.ActionDone as ActionDone
    5 import geniusweb.party.inform.Inform as Inform
    6 import geniusweb.party.inform.Settings as Settings
    7 import geniusweb.party.inform.YourTurn as YourTurn
     4import geniusweb.inform.ActionDone as ActionDone
     5import geniusweb.inform.Inform as Inform
     6import geniusweb.inform.Settings as Settings
     7import geniusweb.inform.YourTurn as YourTurn
    88
    99
  • exampleparties/randompartypy/src/test/java/geniusweb/exampleparties/randompartypy/RandomPartyTest.java

    r10 r21  
    3232import geniusweb.bidspace.AllBidsList;
    3333import geniusweb.connection.ConnectionEnd;
     34import geniusweb.inform.ActionDone;
     35import geniusweb.inform.Inform;
     36import geniusweb.inform.Settings;
     37import geniusweb.inform.YourTurn;
    3438import geniusweb.issuevalue.Bid;
    3539import geniusweb.party.Capabilities;
    36 import geniusweb.party.inform.ActionDone;
    37 import geniusweb.party.inform.Inform;
    38 import geniusweb.party.inform.Settings;
    39 import geniusweb.party.inform.YourTurn;
    4040import geniusweb.profile.Profile;
    4141import geniusweb.profile.utilityspace.LinearAdditive;
  • exampleparties/simpleboa/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>simpleboaparty</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.6</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
  • exampleparties/simpleboa/src/main/java/geniusweb/exampleparties/simpleboa/SimpleBoa.java

    r20 r21  
    88import geniusweb.boa.biddingstrategy.BiddingStrategy;
    99import geniusweb.boa.biddingstrategy.TimeDependentBiddingStrategy;
     10import geniusweb.inform.Settings;
    1011import geniusweb.opponentmodel.FrequencyOpponentModel;
    1112import geniusweb.opponentmodel.OpponentModel;
    1213import geniusweb.party.Party;
    13 import geniusweb.party.inform.Settings;
    1414import tudelft.utilities.logging.Reporter;
    1515
  • exampleparties/simpleboa/src/test/java/geniusweb/exampleparties/simpleboa/SimpleBoaTest.java

    r20 r21  
    3636import geniusweb.bidspace.AllBidsList;
    3737import geniusweb.connection.ConnectionEnd;
     38import geniusweb.inform.ActionDone;
     39import geniusweb.inform.Finished;
     40import geniusweb.inform.Inform;
     41import geniusweb.inform.Settings;
     42import geniusweb.inform.YourTurn;
    3843import geniusweb.issuevalue.Bid;
    3944import geniusweb.party.Capabilities;
    40 import geniusweb.party.inform.ActionDone;
    41 import geniusweb.party.inform.Finished;
    42 import geniusweb.party.inform.Inform;
    43 import geniusweb.party.inform.Settings;
    44 import geniusweb.party.inform.YourTurn;
    4545import geniusweb.profile.Profile;
    4646import geniusweb.profile.utilityspace.LinearAdditive;
  • exampleparties/simpleshaop/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>simpleshaop</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.6</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    5555                        <groupId>tudelft.utilities</groupId>
    5656                        <artifactId>immutablelist</artifactId>
    57                         <version>1.1.0</version>
     57                        <version>1.1.1</version>
    5858                </dependency>
    5959
  • exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/ShaopParty.java

    r12 r21  
    1616import geniusweb.actions.PartyId;
    1717import geniusweb.bidspace.AllBidsList;
     18import geniusweb.inform.ActionDone;
     19import geniusweb.inform.Finished;
     20import geniusweb.inform.Inform;
     21import geniusweb.inform.Settings;
     22import geniusweb.inform.YourTurn;
    1823import geniusweb.issuevalue.Bid;
    1924import geniusweb.party.Capabilities;
    2025import geniusweb.party.DefaultParty;
    21 import geniusweb.party.inform.ActionDone;
    22 import geniusweb.party.inform.Finished;
    23 import geniusweb.party.inform.Inform;
    24 import geniusweb.party.inform.Settings;
    25 import geniusweb.party.inform.YourTurn;
    2626import geniusweb.profile.PartialOrdering;
    2727import geniusweb.profileconnection.ProfileConnectionFactory;
  • exampleparties/simpleshaop/src/test/java/geniusweb/exampleparties/simpleshaop/ShaopPartyTest.java

    r10 r21  
    3636import geniusweb.actions.PartyId;
    3737import geniusweb.connection.ConnectionEnd;
     38import geniusweb.inform.ActionDone;
     39import geniusweb.inform.Finished;
     40import geniusweb.inform.Inform;
     41import geniusweb.inform.Settings;
     42import geniusweb.inform.YourTurn;
    3843import geniusweb.issuevalue.Bid;
    3944import geniusweb.issuevalue.DiscreteValue;
    4045import geniusweb.issuevalue.Value;
    4146import geniusweb.party.Capabilities;
    42 import geniusweb.party.inform.ActionDone;
    43 import geniusweb.party.inform.Finished;
    44 import geniusweb.party.inform.Inform;
    45 import geniusweb.party.inform.Settings;
    46 import geniusweb.party.inform.YourTurn;
    4747import geniusweb.profile.Profile;
    4848import geniusweb.progress.ProgressRounds;
  • exampleparties/timedependentparty/pom.xml

    r20 r21  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>timedependentparty</artifactId>
    8         <version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
     8        <version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
    99        <packaging>jar</packaging>
    1010
     
    1717                <passwd>${env.ARTIFACTORY_PASS}</passwd>
    1818                <jackson-2-version>2.9.10</jackson-2-version>
    19                 <geniusweb.version>1.4.4</geniusweb.version>
     19                <geniusweb.version>1.5.0</geniusweb.version>
    2020        </properties>
    2121
     
    5555                        <groupId>tudelft.utilities</groupId>
    5656                        <artifactId>immutablelist</artifactId>
    57                         <version>1.1.0</version>
     57                        <version>1.1.1</version>
    5858                </dependency>
    5959
  • exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java

    r20 r21  
    1313import geniusweb.actions.Offer;
    1414import geniusweb.actions.PartyId;
     15import geniusweb.inform.ActionDone;
     16import geniusweb.inform.Finished;
     17import geniusweb.inform.Inform;
     18import geniusweb.inform.Settings;
     19import geniusweb.inform.YourTurn;
    1520import geniusweb.issuevalue.Bid;
    1621import geniusweb.party.Capabilities;
    1722import geniusweb.party.DefaultParty;
    18 import geniusweb.party.inform.ActionDone;
    19 import geniusweb.party.inform.Finished;
    20 import geniusweb.party.inform.Inform;
    21 import geniusweb.party.inform.Settings;
    22 import geniusweb.party.inform.YourTurn;
    2323import geniusweb.profile.Profile;
    2424import geniusweb.profile.utilityspace.LinearAdditive;
  • exampleparties/timedependentparty/src/test/java/geniusweb/exampleparties/timedependentparty/TimeDependentPartyTest.java

    r10 r21  
    3434import geniusweb.bidspace.AllBidsList;
    3535import geniusweb.connection.ConnectionEnd;
     36import geniusweb.inform.ActionDone;
     37import geniusweb.inform.Finished;
     38import geniusweb.inform.Inform;
     39import geniusweb.inform.Settings;
     40import geniusweb.inform.YourTurn;
    3641import geniusweb.issuevalue.Bid;
    3742import geniusweb.party.Capabilities;
    38 import geniusweb.party.inform.ActionDone;
    39 import geniusweb.party.inform.Finished;
    40 import geniusweb.party.inform.Inform;
    41 import geniusweb.party.inform.Settings;
    42 import geniusweb.party.inform.YourTurn;
    4343import geniusweb.profile.Profile;
    4444import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
Note: See TracChangeset for help on using the changeset viewer.