RoboTigers / FRCScout2020

MIT License
1 stars 8 forks source link

Simple Alliance Ranking #33

Open srzambito opened 4 years ago

srzambito commented 4 years ago

General Idea

  1. Rank each robot by skill (using a point system) - don't forget to rank our own!
  2. With this in mind, list all combinations of 3 robots (which will always include our R1 robot)
    • group1: R1 R2 R3
    • group2: R1 R2 R 4
    • group3: R1 R3 R4
  3. For each group/combination, sum the skill points. Do this across all skill categories.
    • For example: Considering Skill_1 sum the skill points for group1: R1 R2 R3, group2: R1 R2 R4, and group3: R1 R3 R4
  4. Finally, sum over the row to create a total score column
    • This will be used to determine your best alliance group
  5. Because there can be a tie and because we want skills to be varied, consider summing the top two (as opposed to all three skills within a group)
    • For example: For Skill_1 sum up the two highest scorers in group1: R1 R2 R3 (which ends up being the points from R1 and R3)
    • I've recorded this number in parenthesis in the table below
    • Notice how this may change what is considered to be the best alliance team

Rankings by Skill

Where R1 is RoboTigers

Skill_1 Skill_2 Skill_3 Skill_4
R1: 10 R4: 10 R3: 10 R1: 10
R3: 9 R3: 9 R1: 9 R2: 9
R2: 8 R1: 8 R2: 8 R3: 9
R4: 7 R2: 6 R4: 7 R4: 7

Combination Rankings

This is based on the skill points recorded in the chart above

Combinations Skill_1 Skill_2 Skill_3 Skill_4 TOTAL SCORES (takes top 2)
R1 R2 R3 27 (19) 23 (17) 27 (19) 27 (19) 104 (101)
R1 R2 R4 25 (18) 24 (18) 24 (17) 26 (19) 99 (72)
R1 R3 R4 26 (19) 27 (19) 26 (19) 25 (18) 104 (75)

Best Alliance

R1 R2 R3

Remove Robots that Already have an Alliance

Have a button that allows you to easily delete robots that get picked As robots are chosen, any combinations including them should be dropped from the pick list

Weighting Specific Skills

In our algorithm, allow for a weighted skill factor for each category. As default, this weight should be 1. At competition, you may realize that Skill 2 is really really important. To account for let's configure that throw the app, so you can change the value as needed. This will of course generate new potential new alliance groups.


Suggestions Getting Started

Initial Steps: 1) Pull back all collected data (query your postgres table) 2) Load data into pandas dataframe

Ranking Chart:

1) Header columns: one column per skill (ie, Skill_1, etc) 2) Data cells: robot team: number of points earned (ie, {R1: 10}) 3) Sort by points in descending order (so that the highest points appear at the top) 4) When displaying, color code our ranking so we are easy to find

Alliance Chart:

1) Header columns: one column per skill (ie, Skill_1, etc) 2) Header rows: each group/combination (ie, R1 R2 R3, etc) 3) Data cells: sum of points earned for each skill by the robots in that combination 4) Sort by the last column 'TOTAL SCORES' in descending order so that the best team appears at the top

This would come together like this:

For combination in combinations,
    For skill in skills:
        group points = sum the skill points earned from each robot in the combination

Store the data as a pandas series so that the final chart can be easily constructed

Example:

for R1 R2 R3: 
    for Skill_1:
        group_skill_points = 10 + 8 + 9 

Once, this has been generated for all combinations, you can calculate the final sum to get the TOTAL SCORES column

In addition, to set yourselves up for arbitrary weights, you'll have something like this:

c1 * Skill_1 + c2 * Skill_2 + c3 * Skill_3 + c4 * Skill_4 = TOTAL_SCORES

Where c1, c2, c3, c4 are initially set to 1 and would be configurable in the app so that you can change the weights as needed

However, this will not make any sense if we don't NORMALIZE this data. Do this in the ranking chart since the data from the alliance chart will come from there.

Meaning that for each column in the ranking chart: 1) find the maximum value 2) divide all cells in that column by that max value 3) this will provide values between 0-1 (where 1 is the best and 0 is the worst case)

For example, using the ranking table above this will now look like this:

Skill_1 Skill_2 Skill_3 Skill_4
R1: 1 R4: 1 R3: 1 R1: 1
R3: 0.9 R3: 0.9 R1: 0.9 R2: 0.9
R2: 0.8 R1: 0.8 R2: 0.8 R3: 0.9
R4: 0.7 R2: 0.6 R4: 0.7 R4: 0.7
srzambito commented 4 years ago

Please share your feedback! (I can't seem to assign for this issue)

@sharonkass @DanielLaszczych