Changeset 18
- Timestamp:
- 06/11/20 16:34:40 (5 years ago)
- Files:
-
- 2 added
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
bidspace/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>bidspace</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <passwd>${env.ARTIFACTORY_PASS}</passwd> 17 17 <jackson-2-version>2.9.10</jackson-2-version> 18 <geniusweb.version>1.4.1</geniusweb.version> 18 19 </properties> 19 20 … … 36 37 <groupId>geniusweb</groupId> 37 38 <artifactId>profile</artifactId> 38 <version> 1.4.0</version>39 <version>${geniusweb.version}</version> 39 40 </dependency> 40 41 … … 42 43 <groupId>tudelft.utilities</groupId> 43 44 <artifactId>immutablelist</artifactId> 44 <version>1. 0.1</version>45 <version>1.1.0</version> 45 46 </dependency> 46 47 … … 103 104 <groupId>tudelft.utilities</groupId> 104 105 <artifactId>junit</artifactId> 105 <version>1.0. 1</version>106 <version>1.0.3</version> 106 107 <scope>test</scope> 107 108 </dependency> -
events/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>events</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 43 44 <groupId>geniusweb</groupId> 44 45 <artifactId>issuevalue</artifactId> 45 <version> 1.4.0</version>46 <version>${geniusweb.version}</version> 46 47 </dependency> 47 48 <dependency> 48 49 <groupId>geniusweb</groupId> 49 50 <artifactId>references</artifactId> 50 <version> 1.4.0</version>51 <version>${geniusweb.version}</version> 51 52 </dependency> 52 53 … … 108 109 <groupId>tudelft.utilities</groupId> 109 110 <artifactId>junit</artifactId> 110 <version>1.0. 2</version>111 <version>1.0.3</version> 111 112 <scope>test</scope> 112 113 </dependency> -
exampleparties/anac2019/agentgg/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties.anac2019</groupId> 7 7 <artifactId>agentgg</artifactId> 8 <version>1.4 ,0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 32 33 <groupId>geniusweb</groupId> 33 34 <artifactId>issuevalue</artifactId> 34 <version> 1.4.0</version>35 <version>${geniusweb.version}</version> 35 36 </dependency> 36 37 … … 38 39 <groupId>geniusweb</groupId> 39 40 <artifactId>party</artifactId> 40 <version> 1.4.0</version>41 <version>${geniusweb.version}</version> 41 42 </dependency> 42 43 … … 44 45 <groupId>geniusweb</groupId> 45 46 <artifactId>bidspace</artifactId> 46 <version> 1.4.0</version>47 <version>${geniusweb.version}</version> 47 48 </dependency> 48 49 <dependency> 49 50 <groupId>geniusweb</groupId> 50 51 <artifactId>profileconnection</artifactId> 51 <version> 1.4.0</version>52 <version>${geniusweb.version}</version> 52 53 </dependency> 53 54 <dependency> … … 59 60 <groupId>tudelft.utilities</groupId> 60 61 <artifactId>immutablelist</artifactId> 61 <version>1. 0.1</version>62 <version>1.1.0</version> 62 63 </dependency> 63 64 -
exampleparties/anac2019/winkyagent/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties.anac2019</groupId> 7 7 <artifactId>winkyagent</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 32 33 <groupId>geniusweb</groupId> 33 34 <artifactId>issuevalue</artifactId> 34 <version> 1.4.0</version>35 <version>${geniusweb.version}</version> 35 36 </dependency> 36 37 … … 38 39 <groupId>geniusweb</groupId> 39 40 <artifactId>party</artifactId> 40 <version> 1.4.0</version>41 <version>${geniusweb.version}</version> 41 42 </dependency> 42 43 … … 44 45 <groupId>geniusweb</groupId> 45 46 <artifactId>bidspace</artifactId> 46 <version> 1.4.0</version>47 <version>${geniusweb.version}</version> 47 48 </dependency> 48 49 <dependency> 49 50 <groupId>geniusweb</groupId> 50 51 <artifactId>profileconnection</artifactId> 51 <version> 1.4.0</version>52 <version>${geniusweb.version}</version> 52 53 </dependency> 53 54 <dependency> … … 59 60 <groupId>tudelft.utilities</groupId> 60 61 <artifactId>immutablelist</artifactId> 61 <version>1. 0.1</version>62 <version>1.1.0</version> 62 63 </dependency> 63 64 -
exampleparties/boulware/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>boulware</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb.exampleparties</groupId> 34 35 <artifactId>timedependentparty</artifactId> 35 <version>1.4. 0</version>36 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 36 37 </dependency> 37 38 <dependency> -
exampleparties/comparebids/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>comparebids</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb</groupId> 34 35 <artifactId>party</artifactId> 35 <version> 1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 … … 39 40 <groupId>geniusweb</groupId> 40 41 <artifactId>bidspace</artifactId> 41 <version> 1.4.0</version>42 <version>${geniusweb.version}</version> 42 43 </dependency> 43 44 <dependency> 44 45 <groupId>geniusweb</groupId> 45 46 <artifactId>profileconnection</artifactId> 46 <version> 1.4.0</version>47 <version>${geniusweb.version}</version> 47 48 </dependency> 48 49 <dependency> … … 54 55 <groupId>tudelft.utilities</groupId> 55 56 <artifactId>immutablelist</artifactId> 56 <version>1. 0.1</version>57 <version>1.1.0</version> 57 58 </dependency> 58 59 -
exampleparties/conceder/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>conceder</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb.exampleparties</groupId> 34 35 <artifactId>timedependentparty</artifactId> 35 <version> 1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 <dependency> -
exampleparties/hardliner/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>hardliner</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb.exampleparties</groupId> 34 35 <artifactId>timedependentparty</artifactId> 35 <version> 1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 <dependency> -
exampleparties/humangui/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>humangui</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb</groupId> 34 35 <artifactId>party</artifactId> 35 <version> 1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 … … 39 40 <groupId>geniusweb</groupId> 40 41 <artifactId>bidspace</artifactId> 41 <version> 1.4.0</version>42 <version>${geniusweb.version}</version> 42 43 </dependency> 43 44 <dependency> 44 45 <groupId>geniusweb</groupId> 45 46 <artifactId>profileconnection</artifactId> 46 <version> 1.4.0</version>47 <version>${geniusweb.version}</version> 47 48 </dependency> 48 49 <dependency> 49 50 <groupId>tudelft.utilities</groupId> 50 51 <artifactId>immutablelist</artifactId> 51 <version>1. 0.1</version>52 <version>1.1.0</version> 52 53 </dependency> 53 54 <dependency> -
exampleparties/linear/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>linear</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb.exampleparties</groupId> 34 35 <artifactId>timedependentparty</artifactId> 35 <version> 1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 <dependency> -
exampleparties/randomparty/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>randomparty</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb</groupId> 34 35 <artifactId>party</artifactId> 35 <version> 1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 … … 39 40 <groupId>geniusweb</groupId> 40 41 <artifactId>bidspace</artifactId> 41 <version> 1.4.0</version>42 <version>${geniusweb.version}</version> 42 43 </dependency> 43 44 <dependency> 44 45 <groupId>geniusweb</groupId> 45 46 <artifactId>profileconnection</artifactId> 46 <version> 1.4.0</version>47 <version>${geniusweb.version}</version> 47 48 </dependency> 48 49 <dependency> … … 54 55 <groupId>tudelft.utilities</groupId> 55 56 <artifactId>immutablelist</artifactId> 56 <version>1. 0.1</version>57 <version>1.1.0</version> 57 58 </dependency> 58 59 -
exampleparties/randompartypy/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>randompyparty</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>pythonadapter</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 … … 37 38 <groupId>geniusweb</groupId> 38 39 <artifactId>bidspace</artifactId> 39 <version> 1.4.0</version>40 <version>${geniusweb.version}</version> 40 41 </dependency> 41 42 <dependency> 42 43 <groupId>geniusweb</groupId> 43 44 <artifactId>profileconnection</artifactId> 44 <version> 1.4.0</version>45 <version>${geniusweb.version}</version> 45 46 </dependency> 46 47 <dependency> 47 48 <groupId>tudelft.utilities</groupId> 48 49 <artifactId>immutablelist</artifactId> 49 <version>1. 0.1</version>50 <version>1.1.0</version> 50 51 </dependency> 51 52 -
exampleparties/simpleshaop/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>simpleshaop</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.6</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb</groupId> 34 35 <artifactId>party</artifactId> 35 <version> 1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 … … 39 40 <groupId>geniusweb</groupId> 40 41 <artifactId>bidspace</artifactId> 41 <version> 1.4.0</version>42 <version>${geniusweb.version}</version> 42 43 </dependency> 43 44 <dependency> 44 45 <groupId>geniusweb</groupId> 45 46 <artifactId>profileconnection</artifactId> 46 <version> 1.4.0</version>47 <version>${geniusweb.version}</version> 47 48 </dependency> 48 49 <dependency> … … 54 55 <groupId>tudelft.utilities</groupId> 55 56 <artifactId>immutablelist</artifactId> 56 <version>1. 0.1</version>57 <version>1.1.0</version> 57 58 </dependency> 58 59 -
exampleparties/timedependentparty/pom.xml
r14 r18 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>timedependentparty</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 33 34 <groupId>geniusweb</groupId> 34 35 <artifactId>party</artifactId> 35 <version>1.4.0</version>36 <version>${geniusweb.version}</version> 36 37 </dependency> 37 38 … … 39 40 <groupId>geniusweb</groupId> 40 41 <artifactId>bidspace</artifactId> 41 <version>1.4.0</version>42 <version>${geniusweb.version}</version> 42 43 </dependency> 43 44 <dependency> 44 45 <groupId>geniusweb</groupId> 45 46 <artifactId>profileconnection</artifactId> 46 <version>1.4.0</version>47 <version>${geniusweb.version}</version> 47 48 </dependency> 48 49 <dependency> … … 54 55 <groupId>tudelft.utilities</groupId> 55 56 <artifactId>immutablelist</artifactId> 56 <version>1. 0.1</version>57 <version>1.1.0</version> 57 58 </dependency> 58 59 -
exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java
r10 r18 70 70 this.me = settings.getID(); 71 71 this.progress = settings.getProgress(); 72 Object newe = settings.getPar emeters().get("e");72 Object newe = settings.getParameters().get("e"); 73 73 if (newe != null) { 74 74 if (newe instanceof Double) { -
issuevalue/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>issuevalue</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 86 87 <groupId>tudelft.utilities</groupId> 87 88 <artifactId>junit</artifactId> 88 <version>1.0. 2</version>89 <version>1.0.3</version> 89 90 <scope>test</scope> 90 91 </dependency> … … 92 93 <groupId>tudelft.utilities</groupId> 93 94 <artifactId>immutablelist</artifactId> 94 <version>1. 0.1</version>95 <version>1.1.0</version> 95 96 </dependency> 96 97 -
opponentmodel/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>opponentmodel</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>issuevalue</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 <dependency> 36 37 <groupId>geniusweb</groupId> 37 38 <artifactId>profile</artifactId> 38 <version> 1.4.0</version>39 <version>${geniusweb.version}</version> 39 40 </dependency> 40 41 <dependency> 41 42 <groupId>geniusweb</groupId> 42 43 <artifactId>references</artifactId> 43 <version>1.4.0</version> 44 <version>${geniusweb.version}</version> 45 </dependency> 46 <dependency> 47 <groupId>geniusweb</groupId> 48 <artifactId>events</artifactId> 49 <version>${geniusweb.version}</version> 50 </dependency> 51 <dependency> 52 <groupId>geniusweb</groupId> 53 <artifactId>timeline</artifactId> 54 <version>${geniusweb.version}</version> 44 55 </dependency> 45 56 -
opponentmodel/src/main/java/geniusweb/opponentmodel/FrequencyOpponentModel.java
r14 r18 6 6 import java.util.stream.Collectors; 7 7 8 import geniusweb.actions.Action; 9 import geniusweb.actions.Offer; 8 10 import geniusweb.issuevalue.Bid; 9 11 import geniusweb.issuevalue.Domain; … … 12 14 import geniusweb.profile.utilityspace.NumberValueSetUtilities; 13 15 import geniusweb.profile.utilityspace.UtilitySpace; 16 import geniusweb.progress.Progress; 14 17 15 18 /** … … 23 26 * 24 27 */ 25 public class FrequencyOpponentModel implements OpponentModel, UtilitySpace{28 public class FrequencyOpponentModel implements UtilitySpace, OpponentModel { 26 29 27 30 private static final int DECIMALS = 4; // accuracy of our computations. … … 32 35 33 36 public FrequencyOpponentModel(Domain domain) { 34 // map with empth hashmap for each issue. 37 /* 38 * simply reset the whole model and make a new one... maybe this can be 39 * done smarter for minor changes? map with empth hashmap for each 40 * issue. 41 */ 35 42 this(domain, 36 43 domain.getIssues().stream().collect( … … 39 46 } 40 47 48 /** 49 * internal constructor. Assumes the freqs keyset is equal to the available 50 * issues. 51 * 52 * @param domain the domain 53 * @param freqs the observed frequencies for all issue values. This map is 54 * assumed to be a fresh private-access only copy. 55 * @param total the total number of bids contained in the freqs map. This 56 * must be equal to the sum of the Integer values in the 57 * {@link #bidFrequencies} for each issue (this is not 58 * checked). 59 */ 60 private FrequencyOpponentModel(Domain domain, 61 Map<String, Map<Value, Integer>> freqs, BigDecimal total) { 62 if (domain == null) { 63 throw new NullPointerException("domain=null"); 64 } 65 this.domain = domain; 66 this.bidFrequencies = freqs; 67 this.totalBids = total; 68 } 69 41 70 @Override 42 71 public BigDecimal getUtility(Bid bid) { … … 86 115 } 87 116 88 @Override 89 public FrequencyOpponentModel update(Bid bid) { 117 /** 118 * {@inheritDoc} 119 * 120 * <h1>change info</h1> This replaces update(Bid). Now you pass the entire 121 * action and the progress instead of just the bid. 122 */ 123 @Override 124 public FrequencyOpponentModel with(Action action, Progress progress) { 125 if (!(action instanceof Offer)) 126 return this; 127 128 Bid bid = ((Offer) action).getBid(); 90 129 String err = domain.isComplete(bid); 91 130 if (err != null) { … … 108 147 109 148 /** 110 * internal constructor. Assumes the freqs keyset is equal to the available111 * issues.112 *113 * @param domain the domain114 * @param freqs the observed frequencies for all issue values. This map is115 * assumed to be a fresh private-access only copy.116 * @param total the total number of bids contained in the freqs map. This117 * must be equal to the sum of the Integer values in the118 * {@link #bidFrequencies} for each issue (this is not119 * checked).120 */121 private FrequencyOpponentModel(Domain domain,122 Map<String, Map<Value, Integer>> freqs, BigDecimal total) {123 if (domain == null) {124 throw new NullPointerException("domain=null");125 }126 this.domain = domain;127 this.bidFrequencies = freqs;128 this.totalBids = total;129 }130 131 /**132 149 * 133 150 * @param freqs … … 141 158 } 142 159 return map; 160 } 161 162 @Override 163 public Bid getReservationBid() { 164 // don't throw but we really have no clue. 165 return new Bid(new HashMap<>()); 143 166 } 144 167 … … 188 211 } 189 212 190 @Override191 public Bid getReservationBid() {192 throw new UnsupportedOperationException();193 }194 195 213 } -
opponentmodel/src/main/java/geniusweb/opponentmodel/OpponentModel.java
r14 r18 1 1 package geniusweb.opponentmodel; 2 2 3 import geniusweb.issuevalue.Bid; 3 import geniusweb.actions.Action; 4 import geniusweb.issuevalue.Domain; 4 5 import geniusweb.profile.Profile; 5 6 import geniusweb.profile.utilityspace.UtilitySpace; 7 import geniusweb.progress.Progress; 6 8 7 9 /** 8 10 * An opponentmodel estimates a {@link UtilitySpace} from received opponent 9 * bids. 11 * actions. 12 * <h1>Requirement</h1> A OpponentModel must have a constructor that takes the 13 * Domain as argument. unfortunately this can not be enforced in a java 14 * interface 10 15 */ 11 16 public interface OpponentModel extends Profile { 17 12 18 /** 13 * 14 * @param bid the next bid that was received 15 * @return a new {@link OpponentModel} that takes the next bid into account. 19 * Update this with a new action that was done by the opponent that this 20 * model is modeling. {@link #with(Domain)} must be called before calling 21 * this. 22 * 23 * @param action the new incoming action. 24 * @param progress the current progress of the negotiation. Calls to this 25 * must be done with increasing progress. 26 * @return the updated {@link OpponentModel} 16 27 */ 17 OpponentModel update(Bid bid);28 OpponentModel with(Action action, Progress progress); 18 29 19 30 } -
opponentmodel/src/test/java/geniusweb/profile/opponentmodel/FrequencyOppModelTest.java
r14 r18 3 3 import static org.junit.Assert.assertEquals; 4 4 import static org.junit.Assert.assertTrue; 5 import static org.mockito.Mockito.mock; 5 6 6 7 import java.math.BigDecimal; … … 14 15 import org.junit.Test; 15 16 17 import geniusweb.actions.Offer; 18 import geniusweb.actions.PartyId; 16 19 import geniusweb.issuevalue.Bid; 17 20 import geniusweb.issuevalue.DiscreteValue; … … 23 26 import geniusweb.issuevalue.ValueSet; 24 27 import geniusweb.opponentmodel.FrequencyOpponentModel; 28 import geniusweb.progress.Progress; 25 29 import tudelft.utilities.junit.GeneralTests; 26 30 … … 32 36 private static final DiscreteValue I1V2 = new DiscreteValue("i1v2"); 33 37 private static final DiscreteValue I1V2b = new DiscreteValue("i1v2b"); 38 private static final Progress progress = mock(Progress.class); 39 private static final PartyId other = new PartyId("other"); 34 40 35 41 private static Domain domain, domain2, domain3; … … 85 91 oppModel2 = new FrequencyOpponentModel(domain2); 86 92 oppModel3 = new FrequencyOpponentModel(domain3); 87 oppModel4 = (FrequencyOpponentModel) oppModel3.update(bid1);93 oppModel4 = oppModel3.with(new Offer(other, bid1), progress); 88 94 89 95 } … … 106 112 107 113 @Test(expected = NullPointerException.class) 108 public void smoke NullTest() {114 public void smokeTestNull() { 109 115 new FrequencyOpponentModel(null); 110 116 } … … 124 130 @Test 125 131 public void testUpdate() { 126 FrequencyOpponentModel oppModel = oppModel1.update(bid1); 132 FrequencyOpponentModel oppModel = oppModel1.with(new Offer(other, bid1), 133 progress); 127 134 assertTrue(BigDecimal.ONE.compareTo(oppModel.getUtility(bid1)) == 0); 128 135 assertTrue(BigDecimal.ZERO.compareTo(oppModel.getUtility(bid3)) == 0); … … 135 142 // bid1 and bid2 both want I1V1. They differ on the number value. 136 143 // bid3 wants I1V2 but does have the number value from bid2 137 FrequencyOpponentModel oppModel = oppModel1.update(bid1).update(bid2); 144 FrequencyOpponentModel oppModel = oppModel1 145 .with(new Offer(other, bid1), progress) 146 .with(new Offer(other, bid2), progress); 138 147 assertTrue(new BigDecimal("0.75") 139 148 .compareTo(oppModel.getUtility(bid1)) == 0); -
party/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>party</artifactId> 8 <version>1.4.0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>timeline</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 <dependency> 36 37 <groupId>geniusweb</groupId> 37 38 <artifactId>profile</artifactId> 38 <version> 1.4.0</version>39 <version>${geniusweb.version}</version> 39 40 </dependency> 40 41 <dependency> 41 42 <groupId>geniusweb</groupId> 42 43 <artifactId>events</artifactId> 43 <version> 1.4.0</version>44 <version>${geniusweb.version}</version> 44 45 </dependency> 45 46 <dependency> 46 47 <groupId>geniusweb</groupId> 47 48 <artifactId>references</artifactId> 48 <version> 1.4.0</version>49 <version>${geniusweb.version}</version> 49 50 </dependency> 50 51 <dependency> … … 116 117 <groupId>tudelft.utilities</groupId> 117 118 <artifactId>junit</artifactId> 118 <version>1.0. 2</version>119 <version>1.0.3</version> 119 120 <scope>test</scope> 120 121 </dependency> -
party/src/main/java/geniusweb/party/inform/Settings.java
r8 r18 89 89 * that can be used by the party. 90 90 */ 91 public HashMap<String, Object> getPar emeters() {91 public HashMap<String, Object> getParameters() { 92 92 return parameters; 93 93 } -
profile/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>profile</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>issuevalue</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 <dependency> 36 37 <groupId>geniusweb</groupId> 37 38 <artifactId>references</artifactId> 38 <version>1.4.0</version> 39 <version>${geniusweb.version}</version> 40 </dependency> 41 <dependency> 42 <groupId>tudelft.utilities</groupId> 43 <artifactId>immutablelist</artifactId> 44 <version>1.1.0</version> 39 45 </dependency> 40 46 … … 84 90 <groupId>tudelft.utilities</groupId> 85 91 <artifactId>junit</artifactId> 86 <version>1.0. 2</version>92 <version>1.0.3</version> 87 93 <scope>test</scope> 88 94 </dependency> -
profileconnection/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>profileconnection</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>profile</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 -
protocol/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>protocol</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>profile</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 <dependency> 36 37 <groupId>geniusweb</groupId> 37 38 <artifactId>party</artifactId> 38 <version> 1.4.0</version>39 <version>${geniusweb.version}</version> 39 40 </dependency> 40 41 <dependency> 41 42 <groupId>geniusweb</groupId> 42 43 <artifactId>references</artifactId> 43 <version> 1.4.0</version>44 <version>${geniusweb.version}</version> 44 45 </dependency> 45 46 <dependency> 46 47 <groupId>geniusweb</groupId> 47 48 <artifactId>events</artifactId> 48 <version> 1.4.0</version>49 <version>${geniusweb.version}</version> 49 50 </dependency> 50 51 <dependency> 51 52 <groupId>tudelft.utilities</groupId> 52 53 <artifactId>immutablelist</artifactId> 53 <version>1. 0.1</version>54 <version>1.1.0</version> 54 55 </dependency> 55 56 <dependency> -
protocol/src/main/java/geniusweb/protocol/session/shaop/BareSHAOPState.java
r11 r18 22 22 */ 23 23 public abstract class BareSHAOPState implements SessionState { 24 24 25 protected final List<Action> actions; 25 26 … … 167 168 } 168 169 170 @Override 171 public int hashCode() { 172 final int prime = 31; 173 int result = 1; 174 result = prime * result + ((actions == null) ? 0 : actions.hashCode()); 175 result = prime * result + ((error == null) ? 0 : error.hashCode()); 176 result = prime * result 177 + ((partyNumbers == null) ? 0 : partyNumbers.hashCode()); 178 result = prime * result 179 + ((progress == null) ? 0 : progress.hashCode()); 180 result = prime * result 181 + ((settings == null) ? 0 : settings.hashCode()); 182 result = prime * result + teamNr; 183 result = prime * result 184 + ((totalSpent == null) ? 0 : totalSpent.hashCode()); 185 return result; 186 } 187 188 @Override 189 public boolean equals(Object obj) { 190 if (this == obj) 191 return true; 192 if (obj == null) 193 return false; 194 if (getClass() != obj.getClass()) 195 return false; 196 BareSHAOPState other = (BareSHAOPState) obj; 197 if (actions == null) { 198 if (other.actions != null) 199 return false; 200 } else if (!actions.equals(other.actions)) 201 return false; 202 if (error == null) { 203 if (other.error != null) 204 return false; 205 } else if (!error.equals(other.error)) 206 return false; 207 if (partyNumbers == null) { 208 if (other.partyNumbers != null) 209 return false; 210 } else if (!partyNumbers.equals(other.partyNumbers)) 211 return false; 212 if (progress == null) { 213 if (other.progress != null) 214 return false; 215 } else if (!progress.equals(other.progress)) 216 return false; 217 if (settings == null) { 218 if (other.settings != null) 219 return false; 220 } else if (!settings.equals(other.settings)) 221 return false; 222 if (teamNr != other.teamNr) 223 return false; 224 if (totalSpent == null) { 225 if (other.totalSpent != null) 226 return false; 227 } else if (!totalSpent.equals(other.totalSpent)) 228 return false; 229 return true; 230 } 231 169 232 } -
protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOP.java
r11 r18 50 50 * party of this type can execute a RequestComparison(userid) action, which 51 51 * increases the total bother with the elicitationcost. The call results in the 52 * associated COB party to execute a Comparison action. 52 * associated COB party to execute a Comparison action. If this parameter is not 53 * set, the {@link SHAOPState#DEFAULT_ELICITATATION_COST} is used. 53 54 * <p> 54 55 * A SHAOP party keeps the turn until it does an action that is not a … … 58 59 * <p> 59 60 * The Comparison/ComparisonTest actions are private between the 60 * {@link ShaopTeam}. A SHAOP party can do a {@link ElicitComparison} action 61 * a t any time. These actions are completely transparent to the other parties62 * a nd are not dependent or influencing the normal turn taking.61 * {@link ShaopTeam}. A SHAOP party can do a {@link ElicitComparison} action at 62 * any time. These actions are completely transparent to the other parties and 63 * are not dependent or influencing the normal turn taking. 63 64 */ 64 65 public class SHAOP extends DefaultListenable<ProtocolEvent> … … 162 163 ProtocolToPartyConnFactory connectionfactory) 163 164 throws InterruptedException, IOException { 164 List<PartyWithProfile> participants = state.getSettings() 165 . getTeams().stream().map(team -> team.getAllParties())165 List<PartyWithProfile> participants = state.getSettings().getTeams() 166 .stream().map(team -> team.getAllParties()) 166 167 .flatMap(List::stream).collect(Collectors.toList()); 167 168 List<Reference> parties = participants.stream() -
protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOPState.java
r11 r18 30 30 public class SHAOPState extends BareSHAOPState { 31 31 32 p rivate static final double DEFAULT_ELICITATATION_COST = 0.1d;32 public static final double DEFAULT_ELICITATATION_COST = 0.01d; 33 33 34 34 /** … … 277 277 // shaop party does real action, move to next SHAOP party. 278 278 newTeam = (teamNr + 1) % settings.getTeams().size(); 279 if (newprogress instanceof ProgressRounds) { 279 // check if we completed a round 280 if (newprogress instanceof ProgressRounds && newTeam == 0) { 280 281 newprogress = ((ProgressRounds) newprogress).advance(); 282 System.out.println("Progressed rounds " + newprogress 283 + " after action " + action + ""); 281 284 } 282 285 } -
protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java
r16 r18 1 1 package geniusweb.protocol.tournament.allpermutations; 2 2 3 import java.math.BigInteger; 3 4 import java.util.Collections; 4 5 import java.util.List; 6 import java.util.function.BiFunction; 5 7 6 8 import com.fasterxml.jackson.annotation.JsonCreator; … … 17 19 import geniusweb.references.PartyWithProfile; 18 20 import tudelft.utilities.immutablelist.FixedList; 19 import tudelft.utilities.immutablelist.Function2;20 21 import tudelft.utilities.immutablelist.ImmutableList; 21 22 import tudelft.utilities.immutablelist.MapList; … … 25 26 import tudelft.utilities.immutablelist.PermutationsWithReturn; 26 27 import tudelft.utilities.immutablelist.PermutationsWithoutReturn; 28 import tudelft.utilities.immutablelist.Repeat; 27 29 import tudelft.utilities.immutablelist.Tuple; 28 30 import tudelft.utilities.immutablelist.Tuples; … … 56 58 public class AllPermutationsSettings implements TournamentSettings { 57 59 58 public static final String COB_PARTY = "comparebids-1.2.0";59 60 private final List<Team> teams; 60 61 private final List<ProfileList> profileslists; … … 62 63 private final int teamsPerSession; 63 64 private final SessionSettings sessionsettings; 65 private final int numberTournaments; 64 66 65 67 /** 66 68 * 67 * @param teams a list of {@link Team}s. Must contain at least 68 * {@link #teamsPerSession} elements. The <teamsize> 69 * must match the protocol: (SAOP:1, SHAOP:2) 70 * @param reuseTeams if true, we use PermutationsWithReturn, if false 71 * we use PermutationsWithoutReturn to create the 72 * teams. 73 * @param plists list of available {@link ProfileList}s to be 74 * permutated over the teams. Each 75 * {@link ProfileList} must contain <teamsize> 76 * elements. 77 * @param teamsPerSession number of parties per session, must be at least 2. 78 * @param sesettings The generic {@link SessionSetting}. 79 * {@link SessionSettings#with(PartyWithProfile)} 80 * will be used to add the required 81 * {@link PartyWithProfile}s 69 * @param teams a list of {@link Team}s. Must contain at least 70 * {@link #teamsPerSession} elements. The 71 * <teamsize> must match the protocol: (SAOP:1, 72 * SHAOP:2) 73 * @param reuseTeams if true, we use PermutationsWithReturn, if false 74 * we use PermutationsWithoutReturn to create the 75 * teams. 76 * @param plists list of available {@link ProfileList}s to be 77 * permutated over the teams. Each 78 * {@link ProfileList} must contain <teamsize> 79 * elements. 80 * @param teamsPerSession number of parties per session, must be at least 81 * 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 86 * @param numberTournaments the number of times the tournament should be 87 * run. 82 88 */ 83 89 @JsonCreator … … 86 92 @JsonProperty("reuseTeams") boolean reuseTeams, 87 93 @JsonProperty("teamsPerSession") int teamsPerSession, 88 @JsonProperty("sessionsettings") SessionSettings sesettings) { 94 @JsonProperty("sessionsettings") SessionSettings sesettings, 95 @JsonProperty("numberTournaments") int nTournaments) { 89 96 if (teamsPerSession < 2) 90 97 throw new IllegalArgumentException("teamsPerSession must be >=2"); … … 96 103 "profileslist must contain at least " + teamsPerSession 97 104 + " ProfileList's"); 105 if (nTournaments <= 0) 106 throw new IllegalArgumentException("nTournaments must be >0"); 98 107 int teamsize; 99 108 if (sesettings instanceof SAOPSettings) … … 117 126 + teamsize + " but found " 118 127 + profile.getProfiles().size()); 119 120 128 } 121 129 } … … 125 133 this.profileslists = plists; 126 134 this.sessionsettings = sesettings; 135 this.numberTournaments = nTournaments; 127 136 } 128 137 … … 159 168 return "AllPermutationsSettings[" + teams + "," + reuseTeams + "," 160 169 + profileslists + "," + teamsPerSession + "," + sessionsettings 161 + " ]";170 + "," + numberTournaments + "]"; 162 171 } 163 172 … … 166 175 final int prime = 31; 167 176 int result = 1; 168 result = prime * result + ((teams == null) ? 0 : teams.hashCode()); 169 result = prime * result + teamsPerSession; 177 result = prime * result + numberTournaments; 170 178 result = prime * result 171 179 + ((profileslists == null) ? 0 : profileslists.hashCode()); … … 173 181 result = prime * result 174 182 + ((sessionsettings == null) ? 0 : sessionsettings.hashCode()); 183 result = prime * result + ((teams == null) ? 0 : teams.hashCode()); 184 result = prime * result + teamsPerSession; 175 185 return result; 176 186 } … … 185 195 return false; 186 196 AllPermutationsSettings other = (AllPermutationsSettings) obj; 197 if (numberTournaments != other.numberTournaments) 198 return false; 199 if (profileslists == null) { 200 if (other.profileslists != null) 201 return false; 202 } else if (!profileslists.equals(other.profileslists)) 203 return false; 204 if (reuseTeams != other.reuseTeams) 205 return false; 206 if (sessionsettings == null) { 207 if (other.sessionsettings != null) 208 return false; 209 } else if (!sessionsettings.equals(other.sessionsettings)) 210 return false; 187 211 if (teams == null) { 188 212 if (other.teams != null) … … 191 215 return false; 192 216 if (teamsPerSession != other.teamsPerSession) 193 return false;194 if (profileslists == null) {195 if (other.profileslists != null)196 return false;197 } else if (!profileslists.equals(other.profileslists))198 return false;199 if (reuseTeams != other.reuseTeams)200 return false;201 if (sessionsettings == null) {202 if (other.sessionsettings != null)203 return false;204 } else if (!sessionsettings.equals(other.sessionsettings))205 217 return false; 206 218 return true; … … 251 263 partiesPermutations, profilesPermutations); 252 264 253 returnnew MapList<Tuple<ImmutableList<Team>, ImmutableList<ProfileList>>, ImmutableList<TeamOfPartiesAndProfiles>>(265 MapList<Tuple<ImmutableList<Team>, ImmutableList<ProfileList>>, ImmutableList<TeamOfPartiesAndProfiles>> tournamentsettings = new MapList<Tuple<ImmutableList<Team>, ImmutableList<ProfileList>>, ImmutableList<TeamOfPartiesAndProfiles>>( 254 266 tuple -> teamlist(tuple), tuples); 267 return new Repeat<ImmutableList<TeamOfPartiesAndProfiles>>( 268 tournamentsettings, BigInteger.valueOf(numberTournaments), 269 true); 255 270 } 256 271 … … 264 279 private ImmutableList<TeamOfPartiesAndProfiles> teamlist( 265 280 Tuple<ImmutableList<Team>, ImmutableList<ProfileList>> tuple) { 266 Function2<Team, ProfileList, TeamOfPartiesAndProfiles> makeparty = new Function2<Team, ProfileList, TeamOfPartiesAndProfiles>() {281 BiFunction<Team, ProfileList, TeamOfPartiesAndProfiles> makeparty = new BiFunction<Team, ProfileList, TeamOfPartiesAndProfiles>() { 267 282 @Override 268 283 public TeamOfPartiesAndProfiles apply(Team team, … … 288 303 } 289 304 290 // /**291 // * Extract the raw URL, without the part after the question mark292 // *293 // * @param party a party reference (for another party)294 // * @param profile a profile that may have a filter like "?partial=XX"295 // * @return profile without the filter and with a cob party on the same296 // * machine. IT IS ASSUMED that there will the default297 // * "comparebids-1.0.0" party on the same machine as where the other298 // * party is299 // */300 // protected static PartyWithProfile makeCob(PartyRef party,301 // ProfileRef profile) {302 // try {303 // URI profileuri = profile.getURI();304 // URI partyuri = party.getURI();305 // ProfileRef cobprof = new ProfileRef(profileuri.getScheme() + "://"306 // + profileuri.getAuthority() + profileuri.getPath());307 // String partypath = partyuri.getPath();308 // partypath = partypath.substring(0, partypath.lastIndexOf('/'));309 // PartyWithParameters cobparty = new PartyWithParameters(new PartyRef(310 // partyuri.getScheme() + "://" + partyuri.getAuthority()311 // + partypath + "/" + COB_PARTY),312 // new Parameters());313 // return new PartyWithProfile(cobparty, cobprof);314 //315 // } catch (URISyntaxException e) {316 // throw new IllegalArgumentException(317 // "Failed making cob party with profile " + profile, e);318 // }319 // }320 321 305 } -
protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java
r14 r18 32 32 private final ObjectMapper jackson = new ObjectMapper(); 33 33 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}}}} }}";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}}}},\"numberTournaments\":1}}"; 35 35 private AllPermutationsSettings settings, settings1a, settings2, settings3, 36 settings4 ;36 settings4, settings5; 37 37 38 38 // use directly because there is some hard coding currently. … … 76 76 77 77 settings = new AllPermutationsSettings(parties, profiles, false, 2, 78 saopsettings );78 saopsettings, 1); 79 79 80 80 settings1a = new AllPermutationsSettings(parties, profiles, false, 2, 81 saopsettings );81 saopsettings, 1); 82 82 83 83 settings2 = new AllPermutationsSettings(Arrays.asList(partywithparams1, 84 84 partywithparams2, partywithparams3), profiles, false, 2, 85 saopsettings );85 saopsettings, 1); 86 86 87 87 settings3 = new AllPermutationsSettings(parties, profiles, true, 2, 88 saopsettings );88 saopsettings, 1); 89 89 90 90 settings4 = new AllPermutationsSettings(parties, 91 91 Arrays.asList(profiles1, profiles2, profiles3, profiles1), 92 false, 2, saopsettings); 92 false, 2, saopsettings, 1); 93 94 settings5 = new AllPermutationsSettings(parties, profiles, false, 2, 95 saopsettings, 2); 93 96 94 97 } … … 98 101 return Arrays.asList(Arrays.asList(settings, settings1a), 99 102 Arrays.asList(settings2), Arrays.asList(settings3), 100 Arrays.asList(settings4) );103 Arrays.asList(settings4), Arrays.asList(settings5)); 101 104 } 102 105 … … 104 107 public List<String> getGeneralTestStrings() { 105 108 return Arrays.asList( 106 "AllPermutationsSettings.*party1.*party2.*,false,.*profile1.*profile2.*profile3.*,2,SAOPSettings.*", 107 "AllPermutationsSettings.*party1.*party2.*party3.*,false,.*profile1.*profile2.*profile3.*,2,SAOPSettings.*", 108 "AllPermutationsSettings.*party1.*party2.*,true,.*profile1.*profile2.*profile3.*,2,SAOPSettings.*", 109 "AllPermutationsSettings.*party1.*party2.*,false,.*profile1.*profile2.*profile3.*profile1.*,2,SAOPSettings.*"); 109 "AllPermutationsSettings.*party1.*party2.*,false,.*profile1.*profile2.*profile3.*,2,SAOPSettings.*1.*", 110 "AllPermutationsSettings.*party1.*party2.*party3.*,false,.*profile1.*profile2.*profile3.*,2,SAOPSettings.*1.*", 111 "AllPermutationsSettings.*party1.*party2.*,true,.*profile1.*profile2.*profile3.*,2,SAOPSettings.*1.*", 112 "AllPermutationsSettings.*party1.*party2.*,false,.*profile1.*profile2.*profile3.*profile1.*,2,SAOPSettings.*1.*", 113 "AllPermutationsSettings.*party1.*party2.*,false,.*profile1.*profile2.*profile3.*,2,SAOPSettings.*2.*"); 110 114 } 111 115 … … 137 141 new AllPermutationsSettings(null, 138 142 Arrays.asList(profiles1, profiles2, profiles3, profiles1), true, 139 2, saopsettings );143 2, saopsettings, 1); 140 144 141 145 } … … 145 149 new AllPermutationsSettings(Collections.emptyList(), 146 150 Arrays.asList(profiles1, profiles2, profiles3, profiles1), true, 147 2, saopsettings );151 2, saopsettings, 1); 148 152 149 153 } … … 151 155 @Test(expected = IllegalArgumentException.class) 152 156 public void testNullProfiles() { 153 new AllPermutationsSettings(parties, null, true, 2, saopsettings );157 new AllPermutationsSettings(parties, null, true, 2, saopsettings, 1); 154 158 155 159 } … … 159 163 new AllPermutationsSettings(parties, 160 164 Arrays.asList(profiles1, profiles2, profiles3, profiles1), true, 161 4, saopsettings );165 4, saopsettings, 1); 162 166 163 167 } … … 167 171 new AllPermutationsSettings(parties, 168 172 Arrays.asList(profiles1, profiles2, profiles3, profiles1), true, 169 4, null );173 4, null, 1); 170 174 171 175 } … … 175 179 new AllPermutationsSettings(parties, 176 180 Arrays.asList(profiles1, profiles2, profiles3, profiles1), true, 177 1, saopsettings );181 1, saopsettings, 1); 178 182 179 183 } -
pythonadapter/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>pythonadapter</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>party</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 -
references/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>references</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 37 38 <groupId>tudelft.utilities</groupId> 38 39 <artifactId>repository</artifactId> 39 <version>1. 0.1</version>40 <version>1.1.0</version> 40 41 </dependency> 41 42 <!-- the core, which includes Streaming API, shared low-level abstractions … … 95 96 <groupId>tudelft.utilities</groupId> 96 97 <artifactId>junit</artifactId> 97 <version>1.0. 2</version>98 <version>1.0.3</version> 98 99 <scope>test</scope> 99 100 </dependency> -
simplerunner/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>simplerunner</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 18 <jackson-2-version>2.9.10</jackson-2-version> 19 <geniusweb.version>1.4.1</geniusweb.version> 19 20 </properties> 20 21 … … 31 32 <groupId>geniusweb</groupId> 32 33 <artifactId>protocol</artifactId> 33 <version> 1.4.0</version>34 <version>${geniusweb.version}</version> 34 35 </dependency> 35 36 <dependency> 36 37 <groupId>geniusweb</groupId> 37 38 <artifactId>party</artifactId> 38 <version> 1.4.0</version>39 <version>${geniusweb.version}</version> 39 40 </dependency> 40 41 <dependency> 41 42 <groupId>geniusweb.exampleparties</groupId> 42 43 <artifactId>randomparty</artifactId> 43 <version>1.4.0</version> 44 <scope>test</scope> 44 <version>${geniusweb.version}</version> 45 <scope> 46 test 47 </scope> 45 48 </dependency> 46 49 <dependency> 47 50 <groupId>geniusweb.exampleparties</groupId> 48 51 <artifactId>comparebids</artifactId> 49 <version>1.4.0</version> 50 <scope>test</scope> 52 <version>${geniusweb.version}</version> 53 <scope> 54 test 55 </scope> 51 56 </dependency> 52 57 <dependency> 53 58 <groupId>geniusweb.exampleparties</groupId> 54 59 <artifactId>simpleshaop</artifactId> 55 <version>1.4.0</version> 56 <scope>test</scope> 60 <version>${geniusweb.version}</version> 61 <scope> 62 test 63 </scope> 57 64 </dependency> 58 65 -
simplerunner/src/main/java/geniusweb/simplerunner/NegoRunner.java
r10 r18 7 7 import java.util.logging.Level; 8 8 9 import com.fasterxml.jackson.core.JsonProcessingException; 9 10 import com.fasterxml.jackson.databind.ObjectMapper; 10 11 … … 13 14 import geniusweb.protocol.NegoProtocol; 14 15 import geniusweb.protocol.NegoSettings; 16 import geniusweb.protocol.NegoState; 15 17 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory; 16 import tudelft.utilities.logging.ReportToLogger;17 18 import tudelft.utilities.logging.Reporter; 18 19 … … 27 28 private final NegoProtocol protocol; 28 29 private final ProtocolToPartyConnFactory connectionfactory; 29 pr ivatefinal Reporter log;30 protected final Reporter log; 30 31 private final static ObjectMapper jackson = new ObjectMapper(); 31 32 … … 55 56 56 57 protected void stop() { 57 if (protocol.getState().getError() != null) { 58 log.log(Level.WARNING, "protocol terminated abnormally", 59 protocol.getState().getError()); 60 } else { 61 log.log(Level.INFO, 62 "protocol ended normally: " + protocol.getState()); 58 Level level = protocol.getState().getError() == null ? Level.INFO 59 : Level.WARNING; 60 logFinal(level, protocol.getState()); 61 } 62 63 /** 64 * Separate so that we can intercept this when mocking, as this will crash 65 * on mocks 66 * 67 * @param level 68 * @param state 69 */ 70 protected void logFinal(Level level, NegoState state) { 71 try { 72 log.log(level, "protocol ended normally: " 73 + jackson.writeValueAsString(protocol.getState())); 74 } catch (JsonProcessingException e) { 75 e.printStackTrace(); 63 76 } 64 77 } … … 75 88 76 89 NegoRunner runner = new NegoRunner(settings, 77 new ClassPathConnectionFactory(), 78 new ReportToLogger("sessionrunner")); 90 new ClassPathConnectionFactory(), new StdOutReporter()); 79 91 runner.run(); 80 92 } … … 90 102 } 91 103 } 104 105 class StdOutReporter implements Reporter { 106 107 @Override 108 public void log(Level arg0, String arg1) { 109 System.out.println(arg0 + ":" + arg1); 110 } 111 112 @Override 113 public void log(Level arg0, String arg1, Throwable arg2) { 114 System.out.println(arg0 + ">" + arg1); 115 } 116 117 } -
simplerunner/src/test/java/geniusweb/simplerunner/SessionRunnerTest.java
r9 r18 17 17 18 18 import geniusweb.protocol.CurrentNegoState; 19 import geniusweb.protocol.NegoState; 19 20 import geniusweb.protocol.ProtocolException; 20 21 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory; … … 22 23 import geniusweb.protocol.session.SessionSettings; 23 24 import geniusweb.protocol.session.SessionState; 24 import geniusweb.simplerunner.NegoRunner;25 25 import tudelft.utilities.listener.Listener; 26 26 import tudelft.utilities.logging.ReportToLogger; … … 59 59 ProtocolToPartyConnFactory.class); 60 60 61 NegoRunner runner = spy( 62 new NegoRunner(settings, factory, logger)); 61 NegoRunner runner = spy(new NegoRunner(settings, factory, logger)); 63 62 runner.run(); 64 63 … … 82 81 ProtocolToPartyConnFactory factory = mock( 83 82 ProtocolToPartyConnFactory.class); 84 NegoRunner runner = spy( 85 new NegoRunner(settings, factory, logger)); 83 NegoRunner runner = spy(new NegoRunner(settings, factory, logger) { 84 @Override 85 protected void logFinal(Level level, NegoState state) { 86 log.log(level, state.toString()); 87 } 88 }); 86 89 ArgumentCaptor<Listener> listener = ArgumentCaptor 87 90 .forClass(Listener.class); … … 109 112 ProtocolToPartyConnFactory factory = mock( 110 113 ProtocolToPartyConnFactory.class); 111 NegoRunner runner = spy( 112 new NegoRunner(settings, factory, logger)); 114 NegoRunner runner = spy(new NegoRunner(settings, factory, logger) { 115 @Override 116 protected void logFinal(Level level, NegoState state) { 117 log.log(level, state.toString()); 118 } 119 }); 113 120 ArgumentCaptor<Listener> listener = ArgumentCaptor 114 121 .forClass(Listener.class); … … 120 127 verify(runner, times(1)).stop(); 121 128 // check that the protocol error is logged properly 122 verify(logger, times(1)).log(eq(Level.WARNING), any(String.class), 123 eq(PROTOCOL_EXC)); 129 verify(logger, times(1)).log(eq(Level.WARNING), any(String.class)); 124 130 } 125 131 -
simplerunner/src/test/resources/settings2.json
r8 r18 13 13 } 14 14 } 15 15 16 } 16 17 } -
simplerunner/src/test/resources/shaoptoursettings.json
r14 r18 59 59 } 60 60 } 61 } 61 }, 62 "numberTournaments":1 62 63 } 63 64 } -
timeline/pom.xml
r14 r18 6 6 <groupId>geniusweb</groupId> 7 7 <artifactId>timeline</artifactId> 8 <version>1.4. 0</version>8 <version>1.4.1</version> <!-- must equal ${geniusweb.version} --> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <passwd>${env.ARTIFACTORY_PASS}</passwd> 17 17 <jackson-2-version>2.9.10</jackson-2-version> 18 <geniusweb.version>1.4.1</geniusweb.version> 18 19 </properties> 19 20 -
timeline/src/main/java/geniusweb/progress/Progress.java
r1 r18 34 34 * eye on {@link #getTerminationTime()}. 35 35 */ 36 Double get( long currentTimeMs);36 Double get(Long currentTimeMs); 37 37 38 38 /** … … 51 51 * @return true iff the progress has passed the deadline. 52 52 */ 53 boolean isPastDeadline( long currentTimeMs);53 boolean isPastDeadline(Long currentTimeMs); 54 54 } -
timeline/src/main/java/geniusweb/progress/ProgressRounds.java
r12 r18 9 9 /** 10 10 * progress in terms of number of rounds. The round has to be updated by the 11 * user of this class, calling {@link #advance()}. 11 * user of this class, calling {@link #advance()}. immutable. 12 12 */ 13 13 @JsonTypeName("rounds") … … 49 49 /** 50 50 * 51 * @return the current round. First round is 0. It is not recommended to use 52 * this, as this may make your code working with rounds only. 51 * @return the current round. First round is 0. It is recommended that you 52 * use the functions in {@link Progress} instead of this, to ensure 53 * your code works with all implementations of Progress including 54 * future developments. 53 55 */ 54 56 public Integer getCurrentRound() { … … 58 60 /** 59 61 * 60 * @return total number of rounds. It is not recommended to use this, as 61 * this may make your code working with rounds only. 62 * @return total number of rounds. It is recommended that you use the 63 * functions in {@link Progress} instead of this, to ensure your 64 * code works with all implementations of Progress including future 65 * developments. 62 66 */ 63 67 public Integer getTotalRounds() { … … 66 70 67 71 @Override 68 public Double get( long currentTimeMs) {72 public Double get(Long currentTimeMs) { 69 73 // deadline and current both are limited to MAXINT is 32 bits; double 70 74 // fits 52 … … 79 83 80 84 @Override 81 public boolean isPastDeadline( long currentTimeMs) {85 public boolean isPastDeadline(Long currentTimeMs) { 82 86 return currentRound >= duration || currentTimeMs > endtime.getTime(); 83 87 } -
timeline/src/main/java/geniusweb/progress/ProgressTime.java
r1 r18 51 51 52 52 @Override 53 public Double get( long currentTimeMs) {53 public Double get(Long currentTimeMs) { 54 54 long delta = currentTimeMs - start.getTime(); 55 55 // double should have ~53 digits of precision, and we're computing … … 66 66 67 67 @Override 68 public boolean isPastDeadline( long currentTimeMs) {68 public boolean isPastDeadline(Long currentTimeMs) { 69 69 return currentTimeMs > start.getTime() + duration; 70 70 }
Note:
See TracChangeset
for help on using the changeset viewer.