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

Tries harder to kill parties after deadline

Location:
exampleparties/anac2019/agentgg/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/AgentGG.java

    r12 r19  
    3939 * Xu and Peihao Ren of University of Southampton. This party requires a partial
    4040 * ordering as input (notice that most profiles are also partial ordering
    41  * anyway).
     41 * anyway). Much javadoc has been added after reverse engineering, to enable the
     42 * translation.
    4243 */
    4344public class AgentGG extends DefaultParty {
     
    4748        private double offerLowerRatio = 1.0;
    4849        private double offerHigherRatio = 1.1;
    49         private double MAX_IMPORTANCE;
    50         private double MIN_IMPORTANCE;
     50        protected double MAX_IMPORTANCE;
     51        protected double MIN_IMPORTANCE;
    5152        private double MEDIAN_IMPORTANCE;
    5253        private Bid MAX_IMPORTANCE_BID;
     
    319320                                        this.reservationImportanceRatio + 0.2);
    320321                }
     322                // #1799 HACK not in original code : somethmes above computation goes
     323                // wildly off bounds.
     324                if (this.offerLowerRatio > 1)
     325                        this.offerLowerRatio = 0.9999;
    321326                this.offerHigherRatio = this.offerLowerRatio + 0.1;
    322327        }
     
    412417         * the threshold range, and return the bid with the highest opponent import.
    413418         *
    414          * @param lowerRatio Generate a lower limit for the random bid
    415          * @param upperRatio Generate random bid upper limit
     419         * @param lowerRatio Generate a lower limit for the random bid in [0,1]
     420         * @param upperRatio Generate random bid upper limit can be >1
    416421         * @return Bid
    417422         * @throws IOException
  • exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/ImpMap.java

    r12 r19  
    115115        /**
    116116         * @param bid the bid to get the importance (utility?) of.
    117          * @return the importance value of bid. CHECK is this inside [0,1]?
     117         * @return the importance value of bid. Note, this this returns possibly
     118         *         large (>1) values, as the importance is not normalized.
    118119         */
    119120        public double getImportance(Bid bid) {
  • exampleparties/anac2019/agentgg/src/test/java/geniusweb/exampleparties/agentgg/AgentGGTest.java

    r12 r19  
    8989
    9090        @Test
     91        public void testMinMaxRealistic() {
     92                assertTrue(party.MIN_IMPORTANCE >= 0);
     93                assertTrue(party.MIN_IMPORTANCE < 1);
     94                assertTrue(party.MAX_IMPORTANCE >= 0);
     95                assertTrue(party.MAX_IMPORTANCE < 1);
     96                assertTrue(party.MIN_IMPORTANCE <= party.MAX_IMPORTANCE);
     97        }
     98
     99        @Test
    91100        public void getDescriptionTest() {
    92101                assertNotNull(party.getDescription());
Note: See TracChangeset for help on using the changeset viewer.