BBO Discussion Forums: New Player Definitions - BBO Discussion Forums

Jump to content

  • 8 Pages +
  • « First
  • 5
  • 6
  • 7
  • 8
  • You cannot start a new topic
  • You cannot reply to this topic

New Player Definitions Self Ranking Suggestion

#121 User is offline   Al_U_Card 

  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 6,080
  • Joined: 2005-May-16
  • Gender:Male

Posted 2006-March-03, 12:45

How about everyone carries a "dossier" with their name. When you put the cursor over their ID, you see how many smiley faces, aces, whatever, etc. have been awarded by opps and pards. There might not be room on the screen for some of our denizens but it might be interesting anyway..... :P :) B)
The Grand Design, reflected in the face of Chaos...it's a fluke!
0

#122 User is offline   DrTodd13 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,156
  • Joined: 2003-July-03
  • Location:Portland, Oregon

Posted 2006-March-03, 13:54

COPYRIGHT 2006 - Todd A. Anderson
No permission to use this code or the ideas embodied herein unless specifically granted by the author.
------------------------------------------------------------------------

The main function of interest is "ComputeReputations." Ratings are on a
scale of 0 to 10 and ratings weight maxes out after 20 boards but as you
can see this is a configurable parameter.
--------------------------------------------------------------------
#define MIN_RATING 0
#define MAX_RATING 10
#define MIN_BOARDS 1
#define MAX_BOARDS 20

using namespace std;

class Evaluation {
 protected:
    unsigned int m_num_boards;
    unsigned int m_num_days_since_epoch;
    unsigned int m_skill;
    unsigned int m_niceness;
 public:
    Evaluation(void) {}
    Evaluation(unsigned int num_boards,unsigned int days_since_epoch) :
        m_num_boards(num_boards), m_num_days_since_epoch(days_since_epoch), m_sk
ill(UINT_MAX), m_niceness(UINT_MAX) {}
    void AddBoards(unsigned int num_boards,unsigned int days_since_epoch) {
        // prevent wrap-around
        if(m_num_boards + num_boards > m_num_boards) m_num_boards += num_boards;
        m_num_days_since_epoch = days_since_epoch;
    }
    void NewEvaluation(unsigned int skill,unsigned int niceness);

    unsigned int get_num_boards(void) const { return m_num_boards; }
    unsigned int get_days_since_epoch(void) const { return m_num_days_since_epoc
h; }
    unsigned int get_skill(void) const { return m_skill; }
    unsigned int get_niceness(void) const { return m_niceness; }
};

class Reputation {
 protected:
    map<string,Evaluation> m_evals;
    double time_weight(unsigned int x) const;
 public:
    void AddBoards(const string &username,unsigned int num_boards,unsigned int d
ays_since_epoch);
    // 0 = success
    // 1 = parameter out of range
    // 2 = no boards played
    int NewEvaluation(const string &username,unsigned int skill,unsigned int nic
eness);

    void ComputeReputations(unsigned int days_since_epoch,float &skill_reputatio
n,float &niceness_reputation) const;
};

void Reputation::AddBoards(const string &username,unsigned int num_boards,unsign
ed int days_since_epoch) {
    map<string,Evaluation>::iterator eval_iter = m_evals.find(username);
    if(eval_iter == m_evals.end()) {
        m_evals.insert(pair<string,Evaluation>(username,Evaluation(num_boards,da
ys_since_epoch)));
    } else {
        eval_iter->second.AddBoards(num_boards,days_since_epoch);
    }
}

void Evaluation::NewEvaluation(unsigned int skill,unsigned int niceness) {
    m_skill                = skill;
    m_niceness             = niceness;
}

int Reputation::NewEvaluation(const string &username,unsigned int skill,unsigned
 int niceness) {
    if(skill < MIN_RATING || skill > MAX_RATING || niceness < MIN_RATING || nice
ness > MAX_RATING) return 1;

    map<string,Evaluation>::iterator eval_iter = m_evals.find(username);
    if(eval_iter == m_evals.end()) {
        return 2;
    } else {
        eval_iter->second.NewEvaluation(skill,niceness);
    }

    return 0;
}

// This is something else I haven't already mentioned.
// Ratings degrade in weight over time.  If you played with someone
// a year ago then your rating counts less than someone who played
// with them 2 days ago.  There is a lot of time for improvement over
// a year but not 2 days.  The following piecewise formula is complex
// but basically it is relatively flat for up to 80 days and then drops
// pretty linearly for another 80 days and then has a relatively long
// flat tail.
double Reputation::time_weight(unsigned int x) const {
    double val;
    if(x<120) {
        val = 1.5 - 0.5 * exp(x*x/20775.0);
    }
    else {
        val = 0.5 * exp((x-120)/-173.0);
    }
    return val;
}

void Reputation::ComputeReputations(unsigned int days_since_epoch,float &skill_r
eputation,float &niceness_reputation) const {
    map<string,Evaluation>::const_iterator eval_iter;
    double sum_skill    = 0.0;
    double sum_niceness = 0.0;
    double sum_weight   = 0.0;

    cout << "ComputeReputations" << endl;
    for(eval_iter  = m_evals.begin();
        eval_iter != m_evals.end();
        ++eval_iter) {
        unsigned int num_boards = eval_iter->second.get_num_boards();
        num_boards = num_boards > MAX_BOARDS ? MAX_BOARDS : num_boards;
        cout << "ComputeReputations " << num_boards << endl;
        if(num_boards >= MIN_BOARDS) {
            double weight = time_weight(days_since_epoch - eval_iter->second.get
_days_since_epoch()) * (num_boards / MAX_BOARDS);
            sum_skill    += weight * eval_iter->second.get_skill();
            sum_niceness += weight * eval_iter->second.get_niceness();
            sum_weight   += weight;
        }
    }
    if(sum_weight == 0.0) {
        skill_reputation    = -1.0;
        niceness_reputation = -1.0;
    } else {
        skill_reputation    = sum_skill    / sum_weight;
        niceness_reputation = sum_niceness / sum_weight;
    }
}

0

#123 User is offline   ArcLight 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,341
  • Joined: 2004-July-02
  • Location:Millburn, New Jersey
  • Interests:Rowing. Wargaming. Military history.

Posted 2006-March-03, 15:47

Wow, its been years since I've programmed in C++. I much prefer the naming convention you use:
m_num_boards to the other style numBoards
I find it more readable. What is the m_ for, is that your cenvention for unsigned int?


// This is something else I haven't already mentioned.
// Ratings degrade in weight over time. If you played with someone
// a year ago then your rating counts less than someone who played
// with them 2 days ago. There is a lot of time for improvement over
// a year but not 2 days. The following piecewise formula is complex
// but basically it is relatively flat for up to 80 days and then drops
// pretty linearly for another 80 days and then has a relatively long
// flat tail.

I like this idea.


Lets add some more complexity! :P
If someone gives out lots of negative ratings, then their weighting should probably be reduced. That way on crab doesn't ding scores of others.
0

#124 User is offline   uday 

  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 5,808
  • Joined: 2003-January-15
  • Gender:Male
  • Location:USA

Posted 2006-March-03, 15:54

Quote

No permission to use this code


Does this mean i can browse it with an eye towards implementing a variant in C if i like it and it isnt too hard ?
0

#125 User is offline   DrTodd13 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,156
  • Joined: 2003-July-03
  • Location:Portland, Oregon

Posted 2006-March-03, 16:49

m_var_name is meant to indicate that this is a member variable of a class (struct) rather than a local or global variable. I picked this up as part of a coding standard on some project I was working on and have kept it. g_variable would mean that the variable is global. Variables without prefixes would be local.

To Uday, you can create a C version and tinker with the idea. My only request is that nothing go into active use unless I give additional permission.

The idea of lowering the weight of people's ratings who themselves are poorly rated is an appealing one but in my experience, such modifications can potentially lead to instability. I'd have to do some studies to find out what effect such a decreased weight would have.
0

#126 User is offline   Sigi_BC84 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 470
  • Joined: 2006-January-20

Posted 2006-March-04, 19:39

DrTodd13, on Mar 3 2006, 08:54 PM, said:

COPYRIGHT 2006 - Todd A. Anderson
No permission to use this code or the ideas embodied herein unless specifically granted by the author.

No offense Todd, but I don't think it's legally possible to restrain anybody from using ideas you have published unless you have a patent on these ideas. Furthermore, software ideas are not patentable everywhere (e.g. not in Europe, fortunately).

--Sigi
0

#127 User is offline   Brandal 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 366
  • Joined: 2004-July-22

Posted 2006-March-07, 03:06

DrTodd13, on Mar 3 2006, 12:30 PM, said:

So let me get this straight, there is some jerk on BBO that nobody would want to play with or against. Your "efficient" method is for everyone on BBO to play with this jerk, then realize he is a jerk, then mark him as an enemy? It seems a lot more efficient to me for 5 or 10 poor souls to have to suffer through the jerk and be able to tell the rest of us "watch our for the jerk."

Hi Todd

I've been debating the skill part,or at least think I have,mostly :)

I don't play with pickup partners much,but to answer your question,
yes that's my efficient system :blink:

-----------------

I'm still trying to get my head around the skill system of yours.

Will a vote have less weight if the player voting has lower skill level?
"Never argue with fools, they'll drag you down to their level, and then, beat you with experience"
0

#128 User is offline   EarlPurple 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 439
  • Joined: 2003-December-30
  • Location:London

Posted 2006-March-13, 03:53

DrTodd13, on Mar 3 2006, 07:54 PM, said:

COPYRIGHT 2006 - Todd A. Anderson
No permission to use this code or the ideas embodied herein unless specifically granted by the author.
------------------------------------------------------------------------

The main function of interest is "ComputeReputations."  Ratings are on a
scale of 0 to 10 and ratings weight maxes out after 20 boards but as you
can see this is a configurable parameter.
--------------------------------------------------------------------
#define MIN_RATING 0
#define MAX_RATING 10
#define MIN_BOARDS 1
#define MAX_BOARDS 20

using namespace std;

class Evaluation {
 protected:
    unsigned int m_num_boards;
    unsigned int m_num_days_since_epoch;
    unsigned int m_skill;
    unsigned int m_niceness;
 public:
    Evaluation(void) {}
    Evaluation(unsigned int num_boards,unsigned int days_since_epoch) :
        m_num_boards(num_boards), m_num_days_since_epoch(days_since_epoch), m_sk
ill(UINT_MAX), m_niceness(UINT_MAX) {}
    void AddBoards(unsigned int num_boards,unsigned int days_since_epoch) {
        // prevent wrap-around
        if(m_num_boards + num_boards > m_num_boards) m_num_boards += num_boards;
        m_num_days_since_epoch = days_since_epoch;
    }
    void NewEvaluation(unsigned int skill,unsigned int niceness);

    unsigned int get_num_boards(void) const { return m_num_boards; }
    unsigned int get_days_since_epoch(void) const { return m_num_days_since_epoc
h; }
    unsigned int get_skill(void) const { return m_skill; }
    unsigned int get_niceness(void) const { return m_niceness; }
};

class Reputation {
 protected:
    map<string,Evaluation> m_evals;
    double time_weight(unsigned int x) const;
 public:
    void AddBoards(const string &username,unsigned int num_boards,unsigned int d
ays_since_epoch);
    // 0 = success
    // 1 = parameter out of range
    // 2 = no boards played
    int NewEvaluation(const string &username,unsigned int skill,unsigned int nic
eness);

    void ComputeReputations(unsigned int days_since_epoch,float &skill_reputatio
n,float &niceness_reputation) const;
};

void Reputation::AddBoards(const string &username,unsigned int num_boards,unsign
ed int days_since_epoch) {
    map<string,Evaluation>::iterator eval_iter = m_evals.find(username);
    if(eval_iter == m_evals.end()) {
        m_evals.insert(pair<string,Evaluation>(username,Evaluation(num_boards,da
ys_since_epoch)));
    } else {
        eval_iter->second.AddBoards(num_boards,days_since_epoch);
    }
}

void Evaluation::NewEvaluation(unsigned int skill,unsigned int niceness) {
    m_skill                = skill;
    m_niceness             = niceness;
}

int Reputation::NewEvaluation(const string &username,unsigned int skill,unsigned
 int niceness) {
    if(skill < MIN_RATING || skill > MAX_RATING || niceness < MIN_RATING || nice
ness > MAX_RATING) return 1;

    map<string,Evaluation>::iterator eval_iter = m_evals.find(username);
    if(eval_iter == m_evals.end()) {
        return 2;
    } else {
        eval_iter->second.NewEvaluation(skill,niceness);
    }

    return 0;
}

// This is something else I haven't already mentioned.
// Ratings degrade in weight over time.  If you played with someone
// a year ago then your rating counts less than someone who played
// with them 2 days ago.  There is a lot of time for improvement over
// a year but not 2 days.  The following piecewise formula is complex
// but basically it is relatively flat for up to 80 days and then drops
// pretty linearly for another 80 days and then has a relatively long
// flat tail.
double Reputation::time_weight(unsigned int x) const {
    double val;
    if(x<120) {
        val = 1.5 - 0.5 * exp(x*x/20775.0);
    }
    else {
        val = 0.5 * exp((x-120)/-173.0);
    }
    return val;
}

void Reputation::ComputeReputations(unsigned int days_since_epoch,float &skill_r
eputation,float &niceness_reputation) const {
    map<string,Evaluation>::const_iterator eval_iter;
    double sum_skill    = 0.0;
    double sum_niceness = 0.0;
    double sum_weight   = 0.0;

    cout << "ComputeReputations" << endl;
    for(eval_iter  = m_evals.begin();
        eval_iter != m_evals.end();
        ++eval_iter) {
        unsigned int num_boards = eval_iter->second.get_num_boards();
        num_boards = num_boards > MAX_BOARDS ? MAX_BOARDS : num_boards;
        cout << "ComputeReputations " << num_boards << endl;
        if(num_boards >= MIN_BOARDS) {
            double weight = time_weight(days_since_epoch - eval_iter->second.get
_days_since_epoch()) * (num_boards / MAX_BOARDS);
            sum_skill    += weight * eval_iter->second.get_skill();
            sum_niceness += weight * eval_iter->second.get_niceness();
            sum_weight   += weight;
        }
    }
    if(sum_weight == 0.0) {
        skill_reputation    = -1.0;
        niceness_reputation = -1.0;
    } else {
        skill_reputation    = sum_skill    / sum_weight;
        niceness_reputation = sum_niceness / sum_weight;
    }
}

1. Use enums or const ints inside a namespace, not #defines.
2. Don't put using namespace std in a header file. (Although you've put all the implementation into the one file and I see no file-scope guards).
3. Member variables should be private, not protected. (As you don't have virtual destructors you're not going to derive from these classes anyway).
4. I hate K&R bracing style.
5. cout - is this a console app?
6. Ever heard of std::for_each ?
You can't keep a good man down
0

#129 User is offline   Sigi_BC84 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 470
  • Joined: 2006-January-20

Posted 2006-March-13, 09:08

Hey, it's getting interesting.

EarlPurple, on Mar 13 2006, 10:53 AM, said:

4. I hate K&R bracing style.

Blasphemy. What do you use (please don't say GNU style)?

Quote

5. cout - is this a console app?

Yes.

--Sigi
0

#130 User is offline   EarlPurple 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 439
  • Joined: 2003-December-30
  • Location:London

Posted 2006-March-13, 10:51

I use block-style bracing, thank you. Makes the code nice and clear to read.

The only exception where I use K&R is opening a namespace, and that's because I generally don't indent either.
You can't keep a good man down
0

#131 User is offline   jdulmage 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 191
  • Joined: 2004-January-28

Posted 2006-March-14, 21:29

Nobody takes ranking seriously online anyway. People rank themselves experts, but are no better than my local newcomers.
Visit our website today at http://www.reginabridge.com for information on loads of conventions, our local club, and bridge hands.
0

#132 User is offline   Sigi_BC84 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 470
  • Joined: 2006-January-20

Posted 2006-March-16, 20:44

EarlPurple, on Mar 13 2006, 10:53 AM, said:

6. Ever heard of std::for_each ?

After wondering for a few days why you would want to use for_each() in this case, I can only say that I find no reason to do so. It would only make the code less readable and maintainable.

See also: http://www.awprofessional.com/articles/art...345948&seqNum=3

--Sigi
0

#133 User is offline   DrTodd13 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,156
  • Joined: 2003-July-03
  • Location:Portland, Oregon

Posted 2006-March-17, 00:57

I totally agree. I don't like for_each because it makes the code look ugly.
0

#134 User is offline   igormally 

  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 2006-April-04

Posted 2006-April-04, 20:01

Has anyone ever considered creating an ELO rating system for bridge similar to that used in chess ?

Some info here http://en.wikipedia....o_rating_system

There are more variables to consider but I would have thought some such system could be built particularly for an online environment where all the comparison data is readily available.
0

#135 User is offline   pigpenz 

  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,554
  • Joined: 2005-April-25

Posted 2006-April-05, 09:50

having never played on OKBridge, why is it that people dont like their rating system?
Steve Picketts Bridgebrowser gives ratings for players on BBO also its just not public. It interesting when you see peoples ratings and from what i have seen they tend to be right on from what i have seen :ph34r:
0

#136 User is offline   Codo 

  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 6,373
  • Joined: 2003-March-15
  • Location:Hamburg, Germany
  • Interests:games and sports, esp. bridge,chess and (beach-)volleyball

Posted 2006-April-10, 03:26

People don?t like their rating system, because any systems tends to show, that you are worse then you believe you are.
This happens with ELo in chess (I had been better, but bad luck, bla bla bla) and to the ok-bridge system. (I played too many pickup parts/late at night/with too good/too bad opponents, Too good/too bad parts..)

I liked the system, because it was- besides all flaws- better then anything else.
Kind Regards

Roland


Sanity Check: Failure (Fluffy)
More system is not the answer...
0

#137 User is offline   bradd 

  • PipPip
  • Group: Members
  • Posts: 17
  • Joined: 2004-May-30

Posted 2006-April-12, 22:25

I can't remember where, but I came across a self rating system, which didn't have selectable options - you just input anything you liked. So, for instance, one (that I thought quite cute), was "watchable".

Obviously this is open to abuse, but I think most people would welcome the opportunity to enter something original and descriptive (and maybe amusing) for their skill level, rather than a pre-determined set of responses.
0

#138 User is offline   zasanya 

  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 747
  • Joined: 2003-December-24
  • Gender:Male
  • Location:Thane,Mumbai,Maharashtra,India
  • Interests:Chess,Scrabble,Bridge

Posted 2006-April-15, 06:39

Codo, on Apr 10 2006, 04:26 AM, said:

People don?t like their rating system, because any systems tends to show, that you are worse then you believe you are.
This happens with ELo in chess (I had been better, but bad luck, bla bla bla)

Beg to differ.There is no luck in chess.ELO rating gives an accurate description of an active players skill level.Moreover in chess if anyone claims he/she is better then all you have to do is to play a few games with each other.
In bridge even 100 deals will not prove anything if the lesser player doesn't keep an open mind.
Last but not the least the ' unit' to be examined in bridge should be a pair and not a player.Wonder if Meck or Well would have an expert performance if I am the partner. :)
Aniruddha
Do unto others as you would have others do unto you.
"Mediocrity knows nothing higher than itself, but talent instantly recognizes genius".
0

#139 User is offline   igormally 

  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 2006-April-04

Posted 2006-April-15, 10:17

In my experience there is very little dispute in chess about ratings. It is the accepted measure of any player's skill. The other widely used measures are the titles such as International Master or Grandmaster and ratings are also the basis for gaining one of these titles.

Those titles are awarded based on achieving a minimum result in several tournaments. The minimum result needed is calculated based on the strength of the opposition as determined by the ratings of the opponents.
0

#140 User is offline   hotShot 

  • Axxx Axx Axx Axx
  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,976
  • Joined: 2003-August-31
  • Gender:Male

Posted 2006-April-15, 12:08

Well chess is an individual sport, rating is much simpler there.
Compare this with rating in e.g. the NHL.
I wonder how many goals and assist points a goalie usually gets, i bet almost everybody in the defence and the offence has a better rating.
0

  • 8 Pages +
  • « First
  • 5
  • 6
  • 7
  • 8
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users