Changeset 9 for exampleparties
- Timestamp:
- 11/28/19 14:40:48 (5 years ago)
- Location:
- exampleparties
- Files:
-
- 24 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/boulware/pom.xml
r6 r9 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>boulware</artifactId> 8 <version>1. 0.0</version>8 <version>1.1.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <basedir>.</basedir> 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 <jackson-2-version>2.9. 6</jackson-2-version>18 <jackson-2-version>2.9.10</jackson-2-version> 19 19 </properties> 20 20 … … 33 33 <groupId>geniusweb.exampleparties</groupId> 34 34 <artifactId>timedependentparty</artifactId> 35 <version>1. 0.0</version>35 <version>1.1.0</version> 36 36 </dependency> 37 37 <dependency> -
exampleparties/conceder/pom.xml
r6 r9 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>conceder</artifactId> 8 <version>1. 0.0</version>8 <version>1.1.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <basedir>.</basedir> 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 <jackson-2-version>2.9. 6</jackson-2-version>18 <jackson-2-version>2.9.10</jackson-2-version> 19 19 </properties> 20 20 … … 33 33 <groupId>geniusweb.exampleparties</groupId> 34 34 <artifactId>timedependentparty</artifactId> 35 <version>1. 0.0</version>35 <version>1.1.0</version> 36 36 </dependency> 37 37 <dependency> -
exampleparties/hardliner/pom.xml
r6 r9 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>hardliner</artifactId> 8 <version>1. 0.0</version>8 <version>1.1.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <basedir>.</basedir> 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 <jackson-2-version>2.9. 6</jackson-2-version>18 <jackson-2-version>2.9.10</jackson-2-version> 19 19 </properties> 20 20 … … 33 33 <groupId>geniusweb.exampleparties</groupId> 34 34 <artifactId>timedependentparty</artifactId> 35 <version>1. 0.0</version>35 <version>1.1.0</version> 36 36 </dependency> 37 37 <dependency> -
exampleparties/linear/pom.xml
r4 r9 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>linear</artifactId> 8 <version>1. 0.0</version>8 <version>1.1.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <basedir>.</basedir> 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 <jackson-2-version>2.9. 6</jackson-2-version>18 <jackson-2-version>2.9.10</jackson-2-version> 19 19 </properties> 20 20 … … 33 33 <groupId>geniusweb.exampleparties</groupId> 34 34 <artifactId>timedependentparty</artifactId> 35 <version>1. 0.0</version>35 <version>1.1.0</version> 36 36 </dependency> 37 37 <dependency> -
exampleparties/randomparty/pom.xml
r6 r9 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>randomparty</artifactId> 8 <version>1. 0.0</version>8 <version>1.1.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 33 33 <groupId>geniusweb</groupId> 34 34 <artifactId>party</artifactId> 35 <version>1. 0.0</version>35 <version>1.1.0</version> 36 36 </dependency> 37 37 … … 39 39 <groupId>geniusweb</groupId> 40 40 <artifactId>bidspace</artifactId> 41 <version>1.0.0</version> 41 <version>1.1.0</version> 42 </dependency> 43 <dependency> 44 <groupId>geniusweb</groupId> 45 <artifactId>profileconnection</artifactId> 46 <version>1.1.0</version> 42 47 </dependency> 43 48 <dependency> 44 49 <groupId>tudelft.utilities</groupId> 45 50 <artifactId>logging</artifactId> 46 <version>1.0.0</version>47 </dependency>48 <dependency>49 <groupId>geniusweb</groupId>50 <artifactId>profileconnection</artifactId>51 51 <version>1.0.0</version> 52 52 </dependency> -
exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java
r2 r9 25 25 import geniusweb.profile.PartialOrdering; 26 26 import geniusweb.profile.Profile; 27 import geniusweb.profile.utilityspace. LinearAdditiveUtilitySpace;27 import geniusweb.profile.utilityspace.UtilitySpace; 28 28 import geniusweb.profileconnection.ProfileConnectionFactory; 29 29 import geniusweb.profileconnection.ProfileInterface; … … 57 57 if (info instanceof Settings) { 58 58 Settings settings = (Settings) info; 59 this.profileint = ProfileConnectionFactory.create(settings.getProfile().getURI(), getReporter()); 59 this.profileint = ProfileConnectionFactory 60 .create(settings.getProfile().getURI(), getReporter()); 60 61 this.me = settings.getID(); 61 62 this.progress = settings.getProgress(); … … 74 75 } 75 76 } catch (Exception e) { 76 getReporter().log(Level.SEVERE,"Failed to handle info", e);77 throw new RuntimeException("Failed to handle info", e); 77 78 } 78 79 } … … 81 82 public Capabilities getCapabilities() { 82 83 try { 83 return new Capabilities(new HashSet<>(Arrays.asList(new ProtocolRef(new URI("SAOP"))))); 84 return new Capabilities(new HashSet<>( 85 Arrays.asList(new ProtocolRef(new URI("SAOP"))))); 84 86 } catch (URISyntaxException e) { 85 getReporter().log(Level.SEVERE, "Failed to create capabilities URI", e); 87 getReporter().log(Level.SEVERE, "Failed to create capabilities URI", 88 e); 86 89 return null; 87 90 } … … 99 102 } else { 100 103 // for demo. Obviously full bids have higher util in general 101 AllPartialBidsList bidspace = new AllPartialBidsList(profileint.getProfile().getDomain()); 104 AllPartialBidsList bidspace = new AllPartialBidsList( 105 profileint.getProfile().getDomain()); 102 106 Bid bid = null; 103 107 for (int attempt = 0; attempt < 20 && !isGood(bid); attempt++) { … … 115 119 return false; 116 120 Profile profile = profileint.getProfile(); 117 if (profile instanceof LinearAdditiveUtilitySpace) {118 return (( LinearAdditiveUtilitySpace) profile).getUtility(bid).doubleValue() > 0.6;121 if (profile instanceof UtilitySpace) { 122 return ((UtilitySpace) profile).getUtility(bid).doubleValue() > 0.6; 119 123 } 120 124 if (profile instanceof PartialOrdering) { 121 return ((PartialOrdering) profile).isPreferredOrEqual(bid, profile.getReservationBid()); 125 return ((PartialOrdering) profile).isPreferredOrEqual(bid, 126 profile.getReservationBid()); 122 127 } 123 throw new IllegalArgumentException("Can not handle profile type " + profile.getClass()); 128 throw new IllegalArgumentException( 129 "Can not handle profile type " + profile.getClass()); 124 130 } 125 131 -
exampleparties/randomparty/src/test/java/geniusweb/exampleparties/randomparty/RandomPartyTest.java
r8 r9 33 33 import geniusweb.actions.PartyId; 34 34 import geniusweb.bidspace.AllBidsList; 35 import geniusweb.connection.Connection ;35 import geniusweb.connection.ConnectionEnd; 36 36 import geniusweb.issuevalue.Bid; 37 37 import geniusweb.party.Capabilities; … … 107 107 public void testInformSettings() { 108 108 party.connect(connection); 109 connection.notify Change(settings);109 connection.notifyListeners(settings); 110 110 assertEquals(0, connection.getActions().size()); 111 111 } … … 199 199 */ 200 200 class TestConnection extends DefaultListenable<Inform> 201 implements Connection <Inform, Action> {201 implements ConnectionEnd<Inform, Action> { 202 202 private List<Action> actions = new LinkedList<>(); 203 203 -
exampleparties/randompartypy/pom.xml
r6 r9 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>randompyparty</artifactId> 8 <version>1. 0.0</version>8 <version>1.1.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <basedir>.</basedir> 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 <jackson-2-version>2.9. 6</jackson-2-version>18 <jackson-2-version>2.9.10</jackson-2-version> 19 19 </properties> 20 20 … … 31 31 <groupId>geniusweb</groupId> 32 32 <artifactId>pythonadapter</artifactId> 33 <version>1. 0.0</version>33 <version>1.1.0</version> 34 34 </dependency> 35 35 … … 37 37 <groupId>geniusweb</groupId> 38 38 <artifactId>bidspace</artifactId> 39 <version>1. 0.0</version>39 <version>1.1.0</version> 40 40 </dependency> 41 41 <dependency> 42 42 <groupId>geniusweb</groupId> 43 43 <artifactId>profileconnection</artifactId> 44 <version>1. 0.0</version>44 <version>1.1.0</version> 45 45 </dependency> 46 46 <dependency> -
exampleparties/randompartypy/src/main/resources/RandomParty.py
r2 r9 24 24 import geniusweb.profile.Profile as Profile 25 25 import geniusweb.profile.PartialOrdering as PartialOrdering 26 import geniusweb.profile.utilityspace. LinearAdditiveUtilitySpace as LinearAdditiveUtilitySpace26 import geniusweb.profile.utilityspace.UtilitySpace as UtilitySpace 27 27 import geniusweb.references.ProfileRef as ProfileRef 28 28 import geniusweb.references.ProtocolRef as ProtocolRef … … 97 97 return false 98 98 profile = self.profile.getProfile() 99 if isinstance(profile, LinearAdditiveUtilitySpace):99 if isinstance(profile, UtilitySpace): 100 100 return profile.getUtility(bid).doubleValue() > 0.6; 101 101 if isinstance(profile, PartialOrdering): -
exampleparties/randompartypy/src/test/java/geniusweb/exampleparties/randompartypy/RandomPartyTest.java
r8 r9 31 31 import geniusweb.actions.PartyId; 32 32 import geniusweb.bidspace.AllBidsList; 33 import geniusweb.connection.Connection ;33 import geniusweb.connection.ConnectionEnd; 34 34 import geniusweb.issuevalue.Bid; 35 35 import geniusweb.party.Capabilities; … … 111 111 public void testInformSettings() { 112 112 party.connect(connection); 113 connection.notify Change(settings);113 connection.notifyListeners(settings); 114 114 assertEquals(0, connection.getActions().size()); 115 115 } … … 190 190 */ 191 191 class TestConnection extends DefaultListenable<Inform> 192 implements Connection <Inform, Action> {192 implements ConnectionEnd<Inform, Action> { 193 193 private List<Action> actions = new LinkedList<>(); 194 194 -
exampleparties/timedependentparty/pom.xml
r8 r9 6 6 <groupId>geniusweb.exampleparties</groupId> 7 7 <artifactId>timedependentparty</artifactId> 8 <version>1. 0.0</version>8 <version>1.1.0</version> 9 9 <packaging>jar</packaging> 10 10 … … 16 16 <basedir>.</basedir> 17 17 <passwd>${env.ARTIFACTORY_PASS}</passwd> 18 <jackson-2-version>2.9. 6</jackson-2-version>18 <jackson-2-version>2.9.10</jackson-2-version> 19 19 </properties> 20 20 … … 33 33 <groupId>geniusweb</groupId> 34 34 <artifactId>party</artifactId> 35 <version>1. 0.0</version>35 <version>1.1.0</version> 36 36 </dependency> 37 37 … … 39 39 <groupId>geniusweb</groupId> 40 40 <artifactId>bidspace</artifactId> 41 <version>1.0.0</version> 41 <version>1.1.0</version> 42 </dependency> 43 <dependency> 44 <groupId>geniusweb</groupId> 45 <artifactId>profileconnection</artifactId> 46 <version>1.1.0</version> 42 47 </dependency> 43 48 <dependency> 44 49 <groupId>tudelft.utilities</groupId> 45 50 <artifactId>logging</artifactId> 46 <version>1.0.0</version>47 </dependency>48 <dependency>49 <groupId>geniusweb</groupId>50 <artifactId>profileconnection</artifactId>51 51 <version>1.0.0</version> 52 52 </dependency> -
exampleparties/timedependentparty/src/test/java/geniusweb/exampleparties/timedependentparty/TimeDependentPartyTest.java
r8 r9 33 33 import geniusweb.actions.PartyId; 34 34 import geniusweb.bidspace.AllBidsList; 35 import geniusweb.connection.Connection ;35 import geniusweb.connection.ConnectionEnd; 36 36 import geniusweb.issuevalue.Bid; 37 37 import geniusweb.party.Capabilities; … … 118 118 public void testInformSettings() { 119 119 party.connect(connection); 120 connection.notify Change(settings);120 connection.notifyListeners(settings); 121 121 assertEquals(0, connection.getActions().size()); 122 122 } … … 223 223 */ 224 224 class TestConnection extends DefaultListenable<Inform> 225 implements Connection <Inform, Action> {225 implements ConnectionEnd<Inform, Action> { 226 226 private List<Action> actions = new LinkedList<>(); 227 227
Note:
See TracChangeset
for help on using the changeset viewer.