Changeset 14


Ignore:
Timestamp:
04/28/20 12:56:46 (4 years ago)
Author:
bart
Message:

Release 1.4.0

Files:
33 added
30 edited

Legend:

Unmodified
Added
Removed
  • bidspace/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>bidspace</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3636                        <groupId>geniusweb</groupId>
    3737                        <artifactId>profile</artifactId>
    38                         <version>1.3.1</version>
     38                        <version>1.4.0</version>
    3939                </dependency>
    4040
  • events/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>events</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    4343                        <groupId>geniusweb</groupId>
    4444                        <artifactId>issuevalue</artifactId>
    45                         <version>1.3.1</version>
     45                        <version>1.4.0</version>
    4646                </dependency>
    4747                <dependency>
    4848                        <groupId>geniusweb</groupId>
    4949                        <artifactId>references</artifactId>
    50                         <version>1.3.1</version>
     50                        <version>1.4.0</version>
    5151                </dependency>
    5252
  • exampleparties/anac2019/agentgg/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties.anac2019</groupId>
    77        <artifactId>agentgg</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4,0</version>
    99        <packaging>jar</packaging>
    1010
     
    3232                        <groupId>geniusweb</groupId>
    3333                        <artifactId>issuevalue</artifactId>
    34                         <version>1.3.1</version>
     34                        <version>1.4.0</version>
    3535                </dependency>
    3636
     
    3838                        <groupId>geniusweb</groupId>
    3939                        <artifactId>party</artifactId>
    40                         <version>1.3.1</version>
     40                        <version>1.4.0</version>
    4141                </dependency>
    4242
     
    4444                        <groupId>geniusweb</groupId>
    4545                        <artifactId>bidspace</artifactId>
    46                         <version>1.3.1</version>
     46                        <version>1.4.0</version>
    4747                </dependency>
    4848                <dependency>
    4949                        <groupId>geniusweb</groupId>
    5050                        <artifactId>profileconnection</artifactId>
    51                         <version>1.3.1</version>
     51                        <version>1.4.0</version>
    5252                </dependency>
    5353                <dependency>
  • exampleparties/anac2019/winkyagent/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties.anac2019</groupId>
    77        <artifactId>winkyagent</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3232                        <groupId>geniusweb</groupId>
    3333                        <artifactId>issuevalue</artifactId>
    34                         <version>1.3.1</version>
     34                        <version>1.4.0</version>
    3535                </dependency>
    3636
     
    3838                        <groupId>geniusweb</groupId>
    3939                        <artifactId>party</artifactId>
    40                         <version>1.3.1</version>
     40                        <version>1.4.0</version>
    4141                </dependency>
    4242
     
    4444                        <groupId>geniusweb</groupId>
    4545                        <artifactId>bidspace</artifactId>
    46                         <version>1.3.1</version>
     46                        <version>1.4.0</version>
    4747                </dependency>
    4848                <dependency>
    4949                        <groupId>geniusweb</groupId>
    5050                        <artifactId>profileconnection</artifactId>
    51                         <version>1.3.1</version>
     51                        <version>1.4.0</version>
    5252                </dependency>
    5353                <dependency>
  • exampleparties/boulware/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>boulware</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb.exampleparties</groupId>
    3434                        <artifactId>timedependentparty</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737                <dependency>
  • exampleparties/comparebids/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>comparebids</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb</groupId>
    3434                        <artifactId>party</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737
     
    3939                        <groupId>geniusweb</groupId>
    4040                        <artifactId>bidspace</artifactId>
    41                         <version>1.3.1</version>
     41                        <version>1.4.0</version>
    4242                </dependency>
    4343                <dependency>
    4444                        <groupId>geniusweb</groupId>
    4545                        <artifactId>profileconnection</artifactId>
    46                         <version>1.3.1</version>
     46                        <version>1.4.0</version>
    4747                </dependency>
    4848                <dependency>
  • exampleparties/conceder/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>conceder</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb.exampleparties</groupId>
    3434                        <artifactId>timedependentparty</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737                <dependency>
  • exampleparties/hardliner/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>hardliner</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb.exampleparties</groupId>
    3434                        <artifactId>timedependentparty</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737                <dependency>
  • exampleparties/humangui/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>humangui</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb</groupId>
    3434                        <artifactId>party</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737
     
    3939                        <groupId>geniusweb</groupId>
    4040                        <artifactId>bidspace</artifactId>
    41                         <version>1.3.1</version>
     41                        <version>1.4.0</version>
    4242                </dependency>
    4343                <dependency>
    4444                        <groupId>geniusweb</groupId>
    4545                        <artifactId>profileconnection</artifactId>
    46                         <version>1.3.1</version>
     46                        <version>1.4.0</version>
    4747                </dependency>
    4848                <dependency>
  • exampleparties/linear/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>linear</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb.exampleparties</groupId>
    3434                        <artifactId>timedependentparty</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737                <dependency>
  • exampleparties/randomparty/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>randomparty</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb</groupId>
    3434                        <artifactId>party</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737
     
    3939                        <groupId>geniusweb</groupId>
    4040                        <artifactId>bidspace</artifactId>
    41                         <version>1.3.1</version>
     41                        <version>1.4.0</version>
    4242                </dependency>
    4343                <dependency>
    4444                        <groupId>geniusweb</groupId>
    4545                        <artifactId>profileconnection</artifactId>
    46                         <version>1.3.1</version>
     46                        <version>1.4.0</version>
    4747                </dependency>
    4848                <dependency>
  • exampleparties/randompartypy/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>randompyparty</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3131                        <groupId>geniusweb</groupId>
    3232                        <artifactId>pythonadapter</artifactId>
    33                         <version>1.3.1</version>
     33                        <version>1.4.0</version>
    3434                </dependency>
    3535
     
    3737                        <groupId>geniusweb</groupId>
    3838                        <artifactId>bidspace</artifactId>
    39                         <version>1.3.1</version>
     39                        <version>1.4.0</version>
    4040                </dependency>
    4141                <dependency>
    4242                        <groupId>geniusweb</groupId>
    4343                        <artifactId>profileconnection</artifactId>
    44                         <version>1.3.1</version>
     44                        <version>1.4.0</version>
    4545                </dependency>
    4646                <dependency>
  • exampleparties/simpleshaop/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>simpleshaop</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb</groupId>
    3434                        <artifactId>party</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737
     
    3939                        <groupId>geniusweb</groupId>
    4040                        <artifactId>bidspace</artifactId>
    41                         <version>1.3.1</version>
     41                        <version>1.4.0</version>
    4242                </dependency>
    4343                <dependency>
    4444                        <groupId>geniusweb</groupId>
    4545                        <artifactId>profileconnection</artifactId>
    46                         <version>1.3.1</version>
     46                        <version>1.4.0</version>
    4747                </dependency>
    4848                <dependency>
  • exampleparties/timedependentparty/pom.xml

    r13 r14  
    66        <groupId>geniusweb.exampleparties</groupId>
    77        <artifactId>timedependentparty</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3333                        <groupId>geniusweb</groupId>
    3434                        <artifactId>party</artifactId>
    35                         <version>1.3.1</version>
     35                        <version>1.4.0</version>
    3636                </dependency>
    3737
     
    3939                        <groupId>geniusweb</groupId>
    4040                        <artifactId>bidspace</artifactId>
    41                         <version>1.3.1</version>
     41                        <version>1.4.0</version>
    4242                </dependency>
    4343                <dependency>
    4444                        <groupId>geniusweb</groupId>
    4545                        <artifactId>profileconnection</artifactId>
    46                         <version>1.3.1</version>
     46                        <version>1.4.0</version>
    4747                </dependency>
    4848                <dependency>
  • issuevalue/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>issuevalue</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
  • party/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>party</artifactId>
    8                         <version>1.3.1</version>
     8                        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3131                        <groupId>geniusweb</groupId>
    3232                        <artifactId>timeline</artifactId>
    33                         <version>1.3.1</version>
     33                        <version>1.4.0</version>
    3434                </dependency>
    3535                <dependency>
    3636                        <groupId>geniusweb</groupId>
    3737                        <artifactId>profile</artifactId>
    38                         <version>1.3.1</version>
     38                        <version>1.4.0</version>
    3939                </dependency>
    4040                <dependency>
    4141                        <groupId>geniusweb</groupId>
    4242                        <artifactId>events</artifactId>
    43                         <version>1.3.1</version>
     43                        <version>1.4.0</version>
    4444                </dependency>
    4545                <dependency>
    4646                        <groupId>geniusweb</groupId>
    4747                        <artifactId>references</artifactId>
    48                         <version>1.3.1</version>
     48                        <version>1.4.0</version>
    4949                </dependency>
    5050                <dependency>
  • pom.xml

    r9 r14  
    2929                <module>exampleparties</module>
    3030                <module>simplerunner</module>
     31                <module>opponentmodel</module>
    3132        </modules>
    3233</project>
  • profile/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>profile</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3131                        <groupId>geniusweb</groupId>
    3232                        <artifactId>issuevalue</artifactId>
    33                         <version>1.3.1</version>
     33                        <version>1.4.0</version>
    3434                </dependency>
    3535                <dependency>
    3636                        <groupId>geniusweb</groupId>
    3737                        <artifactId>references</artifactId>
    38                         <version>1.3.1</version>
     38                        <version>1.4.0</version>
    3939                </dependency>
    4040
  • profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditiveUtilitySpace.java

    r10 r14  
    8484                if (utils.values().contains(null)) {
    8585                        throw new NullPointerException(
    86                                         "One of the ValueSetUtilities is null");
     86                                        "One of the ValueSetUtilities in issueUtilitiesis null:"
     87                                                        + utils);
    8788                }
    8889                if (weights.values().contains(null)) {
  • profile/src/main/java/geniusweb/profile/utilityspace/NumberValueSetUtilities.java

    r9 r14  
    5151                if (lowValue == null || highValue == null || lowUtility == null
    5252                                || highUtility == null) {
    53                         throw new NullPointerException("arguments must be non-null");
     53                        throw new NullPointerException(
     54                                        "arguments lowValue, lowUtility, highValue and highUtility must be non-null");
    5455                }
    5556                if (!isInZeroOne(lowUtility)) {
  • profileconnection/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>profileconnection</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3131                        <groupId>geniusweb</groupId>
    3232                        <artifactId>profile</artifactId>
    33                         <version>1.3.1</version>
     33                        <version>1.4.0</version>
    3434                </dependency>
    3535
  • protocol/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>protocol</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3131                        <groupId>geniusweb</groupId>
    3232                        <artifactId>profile</artifactId>
    33                         <version>1.3.1</version>
     33                        <version>1.4.0</version>
    3434                </dependency>
    3535                <dependency>
    3636                        <groupId>geniusweb</groupId>
    3737                        <artifactId>party</artifactId>
    38                         <version>1.3.1</version>
     38                        <version>1.4.0</version>
    3939                </dependency>
    4040                <dependency>
    4141                        <groupId>geniusweb</groupId>
    4242                        <artifactId>references</artifactId>
    43                         <version>1.3.1</version>
     43                        <version>1.4.0</version>
    4444                </dependency>
    4545                <dependency>
    4646                        <groupId>geniusweb</groupId>
    4747                        <artifactId>events</artifactId>
    48                         <version>1.3.1</version>
     48                        <version>1.4.0</version>
    4949                </dependency>
    5050                <dependency>
  • protocol/src/main/java/geniusweb/protocol/tournament/TournamentState.java

    r1 r14  
    77
    88/**
    9  * The current state of the tournament. Must be serializabl;e so that it can be
    10  * restarted if a crash occurs.
     9 * The current state of the tournament. Must be implement Json serialization so
     10 * that it can be used to log the state. State must contain all information to
     11 * determine the relevant info of the negotiation. It may also be used to
     12 * restart the nego if a crash occurs.
    1113 */
    1214@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
  • protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java

    r11 r14  
    11package geniusweb.protocol.tournament.allpermutations;
    22
    3 import java.net.URI;
    4 import java.net.URISyntaxException;
    53import java.util.Collections;
    64import java.util.List;
     
    97import com.fasterxml.jackson.annotation.JsonProperty;
    108
    11 import geniusweb.profile.Profile;
    129import geniusweb.protocol.session.SessionSettings;
    1310import geniusweb.protocol.session.TeamOfPartiesAndProfiles;
     
    1815import geniusweb.protocol.tournament.TournamentProtocol;
    1916import geniusweb.protocol.tournament.TournamentSettings;
    20 import geniusweb.references.Parameters;
    21 import geniusweb.references.PartyRef;
    22 import geniusweb.references.PartyWithParameters;
    2317import geniusweb.references.PartyWithProfile;
    24 import geniusweb.references.ProfileRef;
    2518import tudelft.utilities.immutablelist.FixedList;
    2619import tudelft.utilities.immutablelist.Function2;
     
    6861
    6962        public static final String COB_PARTY = "comparebids-1.2.0";
    70         private final List<PartyWithParameters> parties;
    71         private final List<ProfileRef> profiles;
    72         private final boolean reuseParties;
    73         private final int partiesPerSession;
     63        private final List<Team> teams;
     64        private final List<ProfileList> profileslists;
     65        private final boolean reuseTeams;
     66        private final int teamsPerSession;
    7467        private final SessionSettings sessionsettings;
    7568
    7669        /**
    7770         *
    78          * @param parties           a list of {@link PartyRef}s. Must contain at
    79          *                          least <partiesPerSession> elements.
    80          * @param reuseParties      if true, we use PermutationsWithReturn, if false
    81          *                          we use PermutationsWithoutReturn to create the
    82          *                          parties.
    83          * @param profiles          list of available {@link Profile}s to be
    84          *                          permutated over the parties
    85          * @param partiesPerSession number of parties per session, must be at least
    86          *                          2.
    87          * @param sesettings        The generic {@link SessionSetting}.
    88          *                          {@link SessionSettings#with(PartyWithProfile)}
    89          *                          will be used to add the required
    90          *                          {@link PartyWithProfile}s
     71         * @param teams           a list of {@link Team}s. Must contain at least
     72         *                        <partiesPerSession> elements. The <teamsize> must
     73         *                        match the protocol: (SAOP:1, SHAOP:2)
     74         * @param reuseTeams      if true, we use PermutationsWithReturn, if false
     75         *                        we use PermutationsWithoutReturn to create the
     76         *                        teams.
     77         * @param plists          list of available {@link ProfileList}s to be
     78         *                        permutated over the teams. Each
     79         *                        {@link ProfileList} must contain <teamsize>
     80         *                        elements.
     81         * @param teamsPerSession number of parties per session, must be at least 2.
     82         * @param sesettings      The generic {@link SessionSetting}.
     83         *                        {@link SessionSettings#with(PartyWithProfile)}
     84         *                        will be used to add the required
     85         *                        {@link PartyWithProfile}s
    9186         */
    9287        @JsonCreator
    93         public AllPermutationsSettings(
    94                         @JsonProperty("parties") List<PartyWithParameters> parties,
    95                         @JsonProperty("reuseParties") boolean reuseParties,
    96                         @JsonProperty("profiles") List<ProfileRef> profiles,
    97                         @JsonProperty("partiesPerSession") int partiesPerSession,
     88        public AllPermutationsSettings(@JsonProperty("teams") List<Team> teams,
     89                        @JsonProperty("profileslists") List<ProfileList> plists,
     90                        @JsonProperty("reuseTeams") boolean reuseTeams,
     91                        @JsonProperty("teamsPerSession") int teamsPerSession,
    9892                        @JsonProperty("sessionsettings") SessionSettings sesettings) {
    99                 if (partiesPerSession < 2)
    100                         throw new IllegalArgumentException("partiesPerSession must be >=2");
    101                 if (parties == null || parties.size() < partiesPerSession)
    102                         throw new IllegalArgumentException("parties must contain at least "
    103                                         + partiesPerSession + " PartyRefs");
    104                 if (profiles == null || profiles.size() < 2)
    105                         throw new IllegalArgumentException("profiles must contain at least "
    106                                         + partiesPerSession + " ProfileRefs");
    107                 this.partiesPerSession = partiesPerSession;
    108                 this.reuseParties = reuseParties;
    109                 this.parties = parties;
    110                 this.profiles = profiles;
     93                if (teamsPerSession < 2)
     94                        throw new IllegalArgumentException("teamsPerSession must be >=2");
     95                if (teams == null || teams.size() < teamsPerSession)
     96                        throw new IllegalArgumentException("teams must contain at least "
     97                                        + teamsPerSession + " teams");
     98                if (plists == null || plists.size() < 2)
     99                        throw new IllegalArgumentException(
     100                                        "profileslist must contain at least " + teamsPerSession
     101                                                        + " ProfileList's");
     102                int teamsize;
     103                if (sesettings instanceof SAOPSettings)
     104                        teamsize = 1;
     105                else if (sesettings instanceof SHAOPSettings)
     106                        teamsize = 2;
     107                else
     108                        throw new IllegalArgumentException(
     109                                        "Unsupported protocol " + sesettings.getClass());
     110
     111                for (Team team : teams) {
     112                        if (team.getParties().size() != teamsize) {
     113                                throw new IllegalArgumentException("All teams should have size "
     114                                                + teamsize + " but found " + team.getParties().size());
     115                        }
     116                }
     117                for (ProfileList profile : plists) {
     118                        if (profile.getProfiles().size() != teamsize) {
     119                                throw new IllegalArgumentException(
     120                                                "All profiles should have size equal to the team size "
     121                                                                + teamsize + " but found "
     122                                                                + profile.getProfiles().size());
     123
     124                        }
     125                }
     126                this.teamsPerSession = teamsPerSession;
     127                this.reuseTeams = reuseTeams;
     128                this.teams = teams;
     129                this.profileslists = plists;
    111130                this.sessionsettings = sesettings;
    112131        }
     
    131150        public ImmutableList<SessionSettings> permutations() {
    132151                ImmutableList<ImmutableList<TeamOfPartiesAndProfiles>> partylistlist;
    133                 ImmutableList<PartyWithParameters> partieslist = new FixedList<PartyWithParameters>(
    134                                 parties);
    135                 ImmutableList<ProfileRef> profileslist = new FixedList<ProfileRef>(
    136                                 profiles);
     152                ImmutableList<Team> partieslist = new FixedList<Team>(teams);
     153                ImmutableList<ProfileList> profileslist = new FixedList<ProfileList>(
     154                                profileslists);
    137155                partylistlist = getParticipants(partieslist, profileslist,
    138                                 partiesPerSession, reuseParties);
     156                                teamsPerSession, reuseTeams);
    139157                return new MapList<>(partyproflist -> createSetting(partyproflist),
    140158                                partylistlist);
     
    143161        @Override
    144162        public String toString() {
    145                 return "AllPermutationsSettings[" + parties + "," + reuseParties + ","
    146                                 + profiles + "," + partiesPerSession + "," + sessionsettings
     163                return "AllPermutationsSettings[" + teams + "," + reuseTeams + ","
     164                                + profileslists + "," + teamsPerSession + "," + sessionsettings
    147165                                + "]";
    148166        }
     
    152170                final int prime = 31;
    153171                int result = 1;
    154                 result = prime * result + ((parties == null) ? 0 : parties.hashCode());
    155                 result = prime * result + partiesPerSession;
     172                result = prime * result + ((teams == null) ? 0 : teams.hashCode());
     173                result = prime * result + teamsPerSession;
    156174                result = prime * result
    157                                 + ((profiles == null) ? 0 : profiles.hashCode());
    158                 result = prime * result + (reuseParties ? 1231 : 1237);
     175                                + ((profileslists == null) ? 0 : profileslists.hashCode());
     176                result = prime * result + (reuseTeams ? 1231 : 1237);
    159177                result = prime * result
    160178                                + ((sessionsettings == null) ? 0 : sessionsettings.hashCode());
     
    171189                        return false;
    172190                AllPermutationsSettings other = (AllPermutationsSettings) obj;
    173                 if (parties == null) {
    174                         if (other.parties != null)
     191                if (teams == null) {
     192                        if (other.teams != null)
    175193                                return false;
    176                 } else if (!parties.equals(other.parties))
    177                         return false;
    178                 if (partiesPerSession != other.partiesPerSession)
    179                         return false;
    180                 if (profiles == null) {
    181                         if (other.profiles != null)
     194                } else if (!teams.equals(other.teams))
     195                        return false;
     196                if (teamsPerSession != other.teamsPerSession)
     197                        return false;
     198                if (profileslists == null) {
     199                        if (other.profileslists != null)
    182200                                return false;
    183                 } else if (!profiles.equals(other.profiles))
    184                         return false;
    185                 if (reuseParties != other.reuseParties)
     201                } else if (!profileslists.equals(other.profileslists))
     202                        return false;
     203                if (reuseTeams != other.reuseTeams)
    186204                        return false;
    187205                if (sessionsettings == null) {
     
    219237         */
    220238        private ImmutableList<ImmutableList<TeamOfPartiesAndProfiles>> getParticipants(
    221                         ImmutableList<PartyWithParameters> parties,
    222                         ImmutableList<ProfileRef> profiles, int n,
    223                         boolean drawPartyWithPutback) {
    224 
    225                 Permutations<PartyWithParameters> partiesPermutations;
     239                        ImmutableList<Team> parties, ImmutableList<ProfileList> profiles,
     240                        int n, boolean drawPartyWithPutback) {
     241
     242                Permutations<Team> partiesPermutations;
    226243                if (drawPartyWithPutback) {
    227244                        partiesPermutations = new PermutationsWithReturn<>(parties, n);
     
    230247                }
    231248
    232                 Permutations<ProfileRef> profilesPermutations = new PermutationsOrderedWithoutReturn<>(
     249                Permutations<ProfileList> profilesPermutations = new PermutationsOrderedWithoutReturn<>(
    233250                                profiles, n);
    234251
    235                 // each tuple contains sesion info: a list of partyref and a list of
    236                 // profileref's.
    237                 Tuples<ImmutableList<PartyWithParameters>, ImmutableList<ProfileRef>> tuples = new Tuples<>(
     252                // each tuple contains session info: a list of Team and a list of
     253                // ProfileList.
     254                Tuples<ImmutableList<Team>, ImmutableList<ProfileList>> tuples = new Tuples<>(
    238255                                partiesPermutations, profilesPermutations);
    239256
    240                 return new MapList<Tuple<ImmutableList<PartyWithParameters>, ImmutableList<ProfileRef>>, ImmutableList<TeamOfPartiesAndProfiles>>(
     257                return new MapList<Tuple<ImmutableList<Team>, ImmutableList<ProfileList>>, ImmutableList<TeamOfPartiesAndProfiles>>(
    241258                                tuple -> teamlist(tuple), tuples);
    242259        }
     
    244261        /**
    245262         *
    246          * @param tuple a tuple with (1) ImmutableList<PartyRef> (2)
    247          *              ImmutableList<ProfileRef>
     263         * @param tuple a tuple with (1) ImmutableList<Team> (2)
     264         *              ImmutableList<Profiles>
    248265         * @return list of TeamOfPartiesAndProfiles, each picked from the two lists
    249266         *         in order.
    250267         */
    251268        private ImmutableList<TeamOfPartiesAndProfiles> teamlist(
    252                         Tuple<ImmutableList<PartyWithParameters>, ImmutableList<ProfileRef>> tuple) {
    253                 Function2<PartyWithParameters, ProfileRef, TeamOfPartiesAndProfiles> //
    254                 makeparty = new Function2<PartyWithParameters, ProfileRef, TeamOfPartiesAndProfiles>() {
     269                        Tuple<ImmutableList<Team>, ImmutableList<ProfileList>> tuple) {
     270                Function2<Team, ProfileList, TeamOfPartiesAndProfiles> makeparty = new Function2<Team, ProfileList, TeamOfPartiesAndProfiles>() {
    255271                        @Override
    256                         public TeamOfPartiesAndProfiles apply(PartyWithParameters party,
    257                                         ProfileRef profile) {
     272                        public TeamOfPartiesAndProfiles apply(Team team,
     273                                        ProfileList profilelist) {
    258274                                if (sessionsettings instanceof SAOPSettings)
    259                                         return new SaopPartyWithProfile(party, profile);
     275                                        return new SaopPartyWithProfile(team.getParties().get(0),
     276                                                        profilelist.getProfiles().get(0));
    260277                                else if (sessionsettings instanceof SHAOPSettings) {
    261                                         return new ShaopTeam(new PartyWithProfile(party, profile),
    262                                                         makeCob(party.getPartyRef(), profile));
     278                                        return new ShaopTeam(
     279                                                        new PartyWithProfile(team.getParties().get(0),
     280                                                                        profilelist.getProfiles().get(0)),
     281                                                        new PartyWithProfile(team.getParties().get(1),
     282                                                                        profilelist.getProfiles().get(1)));
    263283                                } else
    264284                                        throw new IllegalArgumentException(
     
    268288
    269289                };
    270                 return new MapThreadList<TeamOfPartiesAndProfiles, PartyWithParameters, ProfileRef>(
     290                return new MapThreadList<TeamOfPartiesAndProfiles, Team, ProfileList>(
    271291                                makeparty, tuple.get1(), tuple.get2());
    272292        }
    273293
    274         /**
    275          * Extract the raw URL, without the part after the question mark
    276          *
    277          * @param party   a party reference (for another party)
    278          * @param profile a profile that may have a filter like "?partial=XX"
    279          * @return profile without the filter and with a cob party on the same
    280          *         machine. IT IS ASSUMED that there will the default
    281          *         "comparebids-1.0.0" party on the same machine as where the other
    282          *         party is
    283          */
    284         protected static PartyWithProfile makeCob(PartyRef party,
    285                         ProfileRef profile) {
    286                 try {
    287                         URI profileuri = profile.getURI();
    288                         URI partyuri = party.getURI();
    289                         ProfileRef cobprof = new ProfileRef(profileuri.getScheme() + "://"
    290                                         + profileuri.getAuthority() + profileuri.getPath());
    291                         String partypath = partyuri.getPath();
    292                         partypath = partypath.substring(0, partypath.lastIndexOf('/'));
    293                         PartyWithParameters cobparty = new PartyWithParameters(new PartyRef(
    294                                         partyuri.getScheme() + "://" + partyuri.getAuthority()
    295                                                         + partypath + "/" + COB_PARTY),
    296                                         new Parameters());
    297                         return new PartyWithProfile(cobparty, cobprof);
    298 
    299                 } catch (URISyntaxException e) {
    300                         throw new IllegalArgumentException(
    301                                         "Failed making cob party with profile " + profile, e);
    302                 }
    303         }
     294//      /**
     295//       * Extract the raw URL, without the part after the question mark
     296//       *
     297//       * @param party   a party reference (for another party)
     298//       * @param profile a profile that may have a filter like "?partial=XX"
     299//       * @return profile without the filter and with a cob party on the same
     300//       *         machine. IT IS ASSUMED that there will the default
     301//       *         "comparebids-1.0.0" party on the same machine as where the other
     302//       *         party is
     303//       */
     304//      protected static PartyWithProfile makeCob(PartyRef party,
     305//                      ProfileRef profile) {
     306//              try {
     307//                      URI profileuri = profile.getURI();
     308//                      URI partyuri = party.getURI();
     309//                      ProfileRef cobprof = new ProfileRef(profileuri.getScheme() + "://"
     310//                                      + profileuri.getAuthority() + profileuri.getPath());
     311//                      String partypath = partyuri.getPath();
     312//                      partypath = partypath.substring(0, partypath.lastIndexOf('/'));
     313//                      PartyWithParameters cobparty = new PartyWithParameters(new PartyRef(
     314//                                      partyuri.getScheme() + "://" + partyuri.getAuthority()
     315//                                                      + partypath + "/" + COB_PARTY),
     316//                                      new Parameters());
     317//                      return new PartyWithProfile(cobparty, cobprof);
     318//
     319//              } catch (URISyntaxException e) {
     320//                      throw new IllegalArgumentException(
     321//                                      "Failed making cob party with profile " + profile, e);
     322//              }
     323//      }
    304324
    305325}
  • protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java

    r11 r14  
    2323import geniusweb.references.PartyRef;
    2424import geniusweb.references.PartyWithParameters;
    25 import geniusweb.references.PartyWithProfile;
    2625import geniusweb.references.ProfileRef;
    2726import tudelft.utilities.junit.GeneralTests;
     
    3332        private final ObjectMapper jackson = new ObjectMapper();
    3433
    35         private final String serialized = "{\"AllPermutationsSettings\":{\"parties\":[{\"partyref\":\"party1\",\"parameters\":{}},{\"partyref\":\"party2\",\"parameters\":{}}],\"reuseParties\":false,\"profiles\":[\"profile1\",\"profile2\",\"profile3\"],\"partiesPerSession\":2,\"sessionsettings\":{\"SAOPSettings\":{\"participants\":[],\"deadline\":{\"deadlinetime\":{\"durationms\":10000}}}}}}";
     34        private final String serialized = "{\"AllPermutationsSettings\":{\"teams\":[{\"Team\":[{\"partyref\":\"party1\",\"parameters\":{}}]},{\"Team\":[{\"partyref\":\"party2\",\"parameters\":{}}]}],\"profileslists\":[{\"ProfileList\":[\"profile1\"]},{\"ProfileList\":[\"profile2\"]},{\"ProfileList\":[\"profile3\"]}],\"reuseTeams\":false,\"teamsPerSession\":2,\"sessionsettings\":{\"SAOPSettings\":{\"participants\":[],\"deadline\":{\"deadlinetime\":{\"durationms\":10000}}}}}}";
    3635        private AllPermutationsSettings settings, settings1a, settings2, settings3,
    3736                        settings4;
    3837
     38        // use directly because there is some hard coding currently.
    3939        private SAOPSettings saopsettings;
    4040
    4141        private ProfileRef profile1, profile2, profile3;
    42 
    43         private List<PartyWithParameters> parties;
     42        private ProfileList profiles1, profiles2, profiles3;
     43        private List<Team> parties;
    4444
    4545        @Before
     
    5353                Parameters params3 = new Parameters();
    5454
    55                 PartyWithParameters partywithparams1 = new PartyWithParameters(
    56                                 partyref1, params1);
    57                 PartyWithParameters partywithparams2 = new PartyWithParameters(
    58                                 partyref2, params2);
    59                 PartyWithParameters partywithparams3 = new PartyWithParameters(
    60                                 partyref3, params3);
     55                Team partywithparams1 = new Team(
     56                                Arrays.asList(new PartyWithParameters(partyref1, params1)));
     57                Team partywithparams2 = new Team(
     58                                Arrays.asList(new PartyWithParameters(partyref2, params2)));
     59                Team partywithparams3 = new Team(
     60                                Arrays.asList(new PartyWithParameters(partyref3, params3)));
    6161
    6262                parties = Arrays.asList(partywithparams1, partywithparams2);
     
    6868                profile2 = new ProfileRef("profile2");
    6969                profile3 = new ProfileRef("profile3");
    70 
    71                 List<ProfileRef> profiles = Arrays.asList(profile1, profile2, profile3);
    72 
    73                 settings = new AllPermutationsSettings(parties, false, profiles, 2,
    74                                 saopsettings);
    75 
    76                 settings1a = new AllPermutationsSettings(parties, false, profiles, 2,
     70                ProfileList profiles1 = new ProfileList(Arrays.asList(profile1));
     71                ProfileList profiles2 = new ProfileList(Arrays.asList(profile2));
     72                ProfileList profiles3 = new ProfileList(Arrays.asList(profile3));
     73
     74                List<ProfileList> profiles = Arrays.asList(profiles1, profiles2,
     75                                profiles3);
     76
     77                settings = new AllPermutationsSettings(parties, profiles, false, 2,
     78                                saopsettings);
     79
     80                settings1a = new AllPermutationsSettings(parties, profiles, false, 2,
    7781                                saopsettings);
    7882
    7983                settings2 = new AllPermutationsSettings(Arrays.asList(partywithparams1,
    80                                 partywithparams2, partywithparams3), false, profiles, 2,
    81                                 saopsettings);
    82 
    83                 settings3 = new AllPermutationsSettings(parties, true, profiles, 2,
    84                                 saopsettings);
    85 
    86                 settings4 = new AllPermutationsSettings(parties, false,
    87                                 Arrays.asList(profile1, profile2, profile3, profile1), 2,
    88                                 saopsettings);
     84                                partywithparams2, partywithparams3), profiles, false, 2,
     85                                saopsettings);
     86
     87                settings3 = new AllPermutationsSettings(parties, profiles, true, 2,
     88                                saopsettings);
     89
     90                settings4 = new AllPermutationsSettings(parties,
     91                                Arrays.asList(profiles1, profiles2, profiles3, profiles1),
     92                                false, 2, saopsettings);
    8993
    9094        }
     
    131135        @Test(expected = IllegalArgumentException.class)
    132136        public void testNullParties() {
    133                 new AllPermutationsSettings(null, true,
    134                                 Arrays.asList(profile1, profile2, profile3, profile1), 2,
    135                                 saopsettings);
     137                new AllPermutationsSettings(null,
     138                                Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
     139                                2, saopsettings);
    136140
    137141        }
     
    139143        @Test(expected = IllegalArgumentException.class)
    140144        public void testNoParties() {
    141                 new AllPermutationsSettings(Collections.emptyList(), true,
    142                                 Arrays.asList(profile1, profile2, profile3, profile1), 2,
    143                                 saopsettings);
     145                new AllPermutationsSettings(Collections.emptyList(),
     146                                Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
     147                                2, saopsettings);
    144148
    145149        }
     
    147151        @Test(expected = IllegalArgumentException.class)
    148152        public void testNullProfiles() {
    149                 new AllPermutationsSettings(parties, true, null, 2, saopsettings);
     153                new AllPermutationsSettings(parties, null, true, 2, saopsettings);
    150154
    151155        }
     
    153157        @Test(expected = IllegalArgumentException.class)
    154158        public void testInsufficientProfiles() {
    155                 new AllPermutationsSettings(parties, true,
    156                                 Arrays.asList(profile1, profile2, profile3, profile1), 4,
    157                                 saopsettings);
     159                new AllPermutationsSettings(parties,
     160                                Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
     161                                4, saopsettings);
    158162
    159163        }
     
    161165        @Test(expected = IllegalArgumentException.class)
    162166        public void testNullSessionSettings() {
    163                 new AllPermutationsSettings(parties, true,
    164                                 Arrays.asList(profile1, profile2, profile3, profile1), 4, null);
     167                new AllPermutationsSettings(parties,
     168                                Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
     169                                4, null);
    165170
    166171        }
     
    168173        @Test(expected = IllegalArgumentException.class)
    169174        public void testOnePartyPerSession() {
    170                 new AllPermutationsSettings(parties, true,
    171                                 Arrays.asList(profile1, profile2, profile3, profile1), 1,
    172                                 saopsettings);
     175                new AllPermutationsSettings(parties,
     176                                Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
     177                                1, saopsettings);
    173178
    174179        }
     
    180185        }
    181186
    182         @Test
    183         public void makeCobTest() throws URISyntaxException {
    184                 // Check that the cob party gets profile without the query part
    185                 String profilebase = "ws://1.2.3.4:8080/profilesserver-a.b.c/websocket/get/someprofile";
    186                 String partybase = "http://131.180.202.213:8080/partiesserver/run/";
    187                 String query = "?a=2&partial=4";
    188                 PartyWithProfile partyprofile = AllPermutationsSettings.makeCob(
    189                                 new PartyRef(partybase + AllPermutationsSettings.COB_PARTY),
    190                                 new ProfileRef(profilebase + query));
    191                 assertEquals(profilebase,
    192                                 partyprofile.getProfile().getURI().toString());
    193                 assertEquals(partybase + AllPermutationsSettings.COB_PARTY,
    194                                 partyprofile.getParty().getPartyRef().getURI().toString());
    195         }
     187//      @Test
     188//      public void makeCobTest() throws URISyntaxException {
     189//              // Check that the cob party gets profile without the query part
     190//              String profilebase = "ws://1.2.3.4:8080/profilesserver-a.b.c/websocket/get/someprofile";
     191//              String partybase = "http://131.180.202.213:8080/partiesserver/run/";
     192//              String query = "?a=2&partial=4";
     193//              PartyWithProfile partyprofile = AllPermutationsSettings.makeCob(
     194//                              new PartyRef(partybase + AllPermutationsSettings.COB_PARTY),
     195//                              new ProfileRef(profilebase + query));
     196//              assertEquals(profilebase,
     197//                              partyprofile.getProfile().getURI().toString());
     198//              assertEquals(partybase + AllPermutationsSettings.COB_PARTY,
     199//                              partyprofile.getParty().getPartyRef().getURI().toString());
     200//      }
    196201
    197202}
  • pythonadapter/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>pythonadapter</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3131                        <groupId>geniusweb</groupId>
    3232                        <artifactId>party</artifactId>
    33                         <version>1.3.1</version>
     33                        <version>1.4.0</version>
    3434                </dependency>
    3535
  • references/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>references</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
  • simplerunner/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>simplerunner</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
     
    3131                        <groupId>geniusweb</groupId>
    3232                        <artifactId>protocol</artifactId>
    33                         <version>1.3.1</version>
     33                        <version>1.4.0</version>
    3434                </dependency>
    3535                <dependency>
    3636                        <groupId>geniusweb</groupId>
    3737                        <artifactId>party</artifactId>
    38                         <version>1.3.1</version>
     38                        <version>1.4.0</version>
    3939                </dependency>
    4040                <dependency>
    4141                        <groupId>geniusweb.exampleparties</groupId>
    4242                        <artifactId>randomparty</artifactId>
    43                         <version>1.3.1</version>
     43                        <version>1.4.0</version>
    4444                        <scope>test</scope>
    4545                </dependency>
     
    4747                        <groupId>geniusweb.exampleparties</groupId>
    4848                        <artifactId>comparebids</artifactId>
    49                         <version>1.3.1</version>
     49                        <version>1.4.0</version>
    5050                        <scope>test</scope>
    5151                </dependency>
     
    5353                        <groupId>geniusweb.exampleparties</groupId>
    5454                        <artifactId>simpleshaop</artifactId>
    55                         <version>1.3.1</version>
     55                        <version>1.4.0</version>
    5656                        <scope>test</scope>
    5757                </dependency>
  • simplerunner/src/test/resources/shaoptoursettings.json

    r10 r14  
    11{
    22        "AllPermutationsSettings": {
    3                 "parties": [
     3                "teams": [
    44                        {
    5                                 "partyref": "classpath:geniusweb.exampleparties.simpleshaop.ShaopParty",
    6                                 "parameters": {
    7                                 }
     5                                "Team": [
     6                                        {
     7                                                "partyref": "classpath:geniusweb.exampleparties.simpleshaop.ShaopParty",
     8                                                "parameters": {
     9                                                }
     10                                        },{
     11                                                "partyref": "classpath:geniusweb.exampleparties.comparebids.CompareBids",
     12                                                "parameters": {
     13                                                }
     14                                        }
     15                                       
     16                                ]
    817                        },
    918                        {
    10                                 "partyref": "classpath:geniusweb.exampleparties.randomparty.RandomParty",
    11                                 "parameters": {
    12                                 }
     19                                "Team": [
     20                                        {
     21                                                "partyref": "classpath:geniusweb.exampleparties.randomparty.RandomParty",
     22                                                "parameters": {
     23                                                }
     24                                        },{
     25                                                "partyref": "classpath:geniusweb.exampleparties.comparebids.CompareBids",
     26                                                "parameters": {
     27                                                }
     28                                        }
     29                                ]
    1330                        }
    1431                ],
    15                 "reuseParties": false,
    16                 "profiles": [
    17                         "file:src/test/resources/jobs/jobs1partial.json?partial=10",
    18                         "file:src/test/resources/jobs/jobs2.json?partial=15"
     32                "reuseTeams": false,
     33                "profileslists": [
     34                        {
     35                                "ProfileList": [
     36                                        "file:src/test/resources/jobs/jobs1partial.json?partial=10",
     37                                        "file:src/test/resources/jobs/jobs1partial.json"
     38                                       
     39                                ]
     40                        },
     41                        {
     42                                "ProfileList": [
     43                                        "file:src/test/resources/jobs/jobs2.json?partial=15",
     44                                        "file:src/test/resources/jobs/jobs2.json"
     45                                       
     46                                ]
     47                        }
    1948                ],
    20                 "partiesPerSession": 2,
     49                "teamsPerSession": 2,
    2150                "sessionsettings": {
    2251                        "SHAOPSettings": {
  • timeline/pom.xml

    r13 r14  
    66        <groupId>geniusweb</groupId>
    77        <artifactId>timeline</artifactId>
    8         <version>1.3.1</version>
     8        <version>1.4.0</version>
    99        <packaging>jar</packaging>
    1010
Note: See TracChangeset for help on using the changeset viewer.