Ignore:
Timestamp:
01/28/20 10:19:54 (5 years ago)
Author:
bart
Message:

Update 28 jan 2020

Location:
exampleparties/timedependentparty/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/ExtendedUtilSpace.java

    r4 r10  
    1111import geniusweb.issuevalue.Bid;
    1212import geniusweb.issuevalue.Value;
    13 import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
     13import geniusweb.profile.utilityspace.LinearAdditive;
    1414import tudelft.utilities.immutablelist.ImmutableList;
    1515
     
    2020 */
    2121public class ExtendedUtilSpace {
    22         private LinearAdditiveUtilitySpace utilspace;
     22        private LinearAdditive utilspace;
    2323        private BigDecimal tolerance; // utility tolerance for a bid.
    2424        private BidsWithUtility bidutils;
     
    2727        private BigDecimal maxUtil;
    2828
    29         public ExtendedUtilSpace(LinearAdditiveUtilitySpace space) {
     29        public ExtendedUtilSpace(LinearAdditive space) {
    3030                this.utilspace = space;
    3131                bidutils = new BidsWithUtility(utilspace);
  • exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java

    r8 r10  
    44import java.math.BigDecimal;
    55import java.math.BigInteger;
    6 import java.net.URI;
    7 import java.net.URISyntaxException;
    86import java.util.Arrays;
    97import java.util.HashSet;
     
    2422import geniusweb.party.inform.YourTurn;
    2523import geniusweb.profile.Profile;
    26 import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
     24import geniusweb.profile.utilityspace.LinearAdditive;
    2725import geniusweb.profileconnection.ProfileConnectionFactory;
    2826import geniusweb.profileconnection.ProfileInterface;
    2927import geniusweb.progress.Progress;
    3028import geniusweb.progress.ProgressRounds;
    31 import geniusweb.references.ProtocolRef;
    3229import tudelft.utilities.immutablelist.ImmutableList;
    3330import tudelft.utilities.logging.Reporter;
     
    4441        private static final BigDecimal DEC100 = new BigDecimal("100");
    4542        private ProfileInterface profileint;
    46         private LinearAdditiveUtilitySpace utilspace = null; // last received space
     43        private LinearAdditive utilspace = null; // last received space
    4744        private PartyId me;
    4845        private Progress progress;
     
    6158        @Override
    6259        public Capabilities getCapabilities() {
    63                 try {
    64                         return new Capabilities(new HashSet<>(
    65                                         Arrays.asList(new ProtocolRef(new URI("SAOP")))));
    66                 } catch (URISyntaxException e) {
    67                         getReporter().log(Level.SEVERE, "Failed to create capabilities URI",
    68                                         e);
    69                         return null;
    70                 }
     60                return new Capabilities(new HashSet<>(Arrays.asList("SAOP")));
    7161        }
    7262
     
    148138        }
    149139
    150         private LinearAdditiveUtilitySpace updateUtilSpace() {
     140        private LinearAdditive updateUtilSpace() throws IOException {
    151141                Profile newutilspace = profileint.getProfile();
    152142                if (!newutilspace.equals(utilspace)) {
    153                         utilspace = (LinearAdditiveUtilitySpace) newutilspace;
     143                        utilspace = (LinearAdditive) newutilspace;
    154144                        extendedspace = new ExtendedUtilSpace(utilspace);
    155145                }
  • exampleparties/timedependentparty/src/test/java/geniusweb/exampleparties/timedependentparty/TimeDependentPartyTest.java

    r9 r10  
    5353public class TimeDependentPartyTest {
    5454
    55         private static final ProtocolRef SAOP = new ProtocolRef("SAOP");
     55        private static final String SAOP = "SAOP";
    5656        private static final PartyId otherparty = new PartyId("other");
    5757        private static final String PROFILE = "src/test/resources/testprofile.json";
     
    105105                Capabilities capabilities = party.getCapabilities();
    106106                assertFalse("party does not define protocols",
    107                                 capabilities.getProtocols().isEmpty());
     107                                capabilities.getBehaviours().isEmpty());
    108108        }
    109109
     
    198198        @Test
    199199        public void testGetCapabilities() {
    200                 assertTrue(party.getCapabilities().getProtocols().contains(SAOP));
     200                assertTrue(party.getCapabilities().getBehaviours().contains(SAOP));
    201201        }
    202202
Note: See TracChangeset for help on using the changeset viewer.