Spec: https://github.com/lifemax/i2unet.com/issues/146
※ use calculateEloRating() function and old data to calculate new rating
$rating1 = result_singles.rating_1_pre
$rating2 = result_singles.rating_2_pre
$score1 = Set to 0 or 1 based on the win_flag of the newly edited data
$kFactor = ($win_user_point_sum - $lose_user_point_sum)
(newRating, newOrgRating) = calculateEloRating($rating1, $rating2, $score1, $kFactor)
Update for current match:
result_singles.user1_game1 〜9
result_singles.user2_game1 〜9
result_singles.game_user1
result_singles.game_user2
result_singles.flag = 9
result_singles.lock_flag = 9
result_singles.win_flag
result_singles.match_end_time
result_singles.rating_1_after = newRating
result_singles.rating_2_after = newRating
result_singles.rating_org_1_after = newOrgRating
result_singles.rating_org_2_after = newOrgRating
result_singles.swiss_score = abs( (new user1_win - new user1_lose) - (new user2_win - new user2_lose)
user_profile.rating = newRating
rating_org.rating = newOrgRating
match_league_base.wins
match_league_base.loses
match_league_base.get_game
match_league_base.lose_game
match_league_base.get_point
match_league_base.lose_point
Update other matches of 2 players of current match (flag=0,2)
result_singles.rating_1_pre = newRating
result_singles.rating_2_pre = newRating
result_singles.rating_org_1_pre = newOrgRating
result_singles.rating_org_2_pre = newOrgRating
result_singles.swiss_score = abs( (new user1_win - new user1_lose) - (new user2_win - new user2_lose)
match_league_base.wins
match_league_base.loses
match_league_base.get_game
match_league_base.lose_game
match_league_base.get_point
match_league_base.lose_point
試合終了 - Match Ended - Button - When edit a match after finished
Spec: https://github.com/lifemax/i2unet.com/issues/146
※ use calculateEloRating() function and old data to calculate new rating
$rating1 = result_singles.rating_1_pre
$rating2 = result_singles.rating_2_pre
$score1 = Set to 0 or 1 based on the win_flag of the newly edited data
$kFactor = ($win_user_point_sum - $lose_user_point_sum)
(newRating, newOrgRating) = calculateEloRating($rating1, $rating2, $score1, $kFactor)
Update current match:
result_singles.user1_game1 〜9
result_singles.user2_game1 〜9
result_singles.game_user1
result_singles.game_user2
result_singles.win_flag
result_singles.rating_1_after = newRating
result_singles.rating_2_after = newRating
result_singles.rating_org_1_after = newOrgRating
result_singles.rating_org_2_after = newOrgRating
result_singles.swiss_score = abs( (new user1_win - new user1_lose) - (new user2_win - new user2_lose)
user_profile.rating = newRating
rating_org.rating = newOrgRating
match_league_base.wins
match_league_base.loses
match_league_base.get_game
match_league_base.lose_game
match_league_base.get_point
match_league_base.lose_point
Update other matches of 2 players of current match (flag=0,2,5,9)
result_singles.rating_1_after = newRating
result_singles.rating_2_after = newRating
result_singles.rating_org_1_after = newOrgRating
result_singles.rating_org_2_after = newOrgRating
result_singles.rating_1_pre = newRating
result_singles.rating_2_pre = newRating
result_singles.rating_org_1_pre = newOrgRating
result_singles.rating_org_2_pre = newOrgRating
result_singles.swiss_score = abs( (new user1_win - new user1_lose) - (new user2_win - new user2_lose)
match_league_base.wins
match_league_base.loses
match_league_base.get_game
match_league_base.lose_game
match_league_base.get_point
match_league_base.lose_point
Note : For matches with flag=9, we update ratings based on the previous match results. For matches with flag=0, 2, 5, we use the results from the last match that has flag=9 to update the ratings.
Ex :
> result_singles 1 試合終了(flag=9) match_end_time at 10:00
> result_singles 2 試合終了(flag=9) match_end_time at 10:10
> result_singles 3 試合終了(flag=9) match_end_time at 10:20
> result_singles 4 試合終了(flag=9) match_end_time at 10:30
> result_singles 5 試合中(flag=5)
> result_singles 6 試合前(flag=2 or 0)
If organizer edit result_singles2 score
result_singles 1 → not change
result_singles 2 → rating_after = new result_singles 2.rating_after
result_singles 3 → rating_pre = result_singles 2.rating_after AND rating_after = new result_singles 3.rating_after
result_singles 4 → rating_pre = result_singles 3.rating_after AND rating_after = new result_singles 4.rating_after
result_singles 5 → rating_pre = result_singles 4.rating_after
result_singles 6 → rating_pre = result_singles 4.rating_after
不戦敗 - Lose by Default - Button
Update for current match:
result_singles.rating_1_after = current rating_pre
result_singles.rating_2_after = current rating_pre
result_singles.rating_org_1_after = current rating_org_pre
result_singles.rating_org_2_after = current rating_org_pre
result_singles.swiss_score = abs( (new user1_win - new user1_lose) - (new user2_win - new user2_lose)
user_profile.rating = newRating
rating_org.rating = newOrgRating
match_league_base.wins
match_league_base.loses
match_league_base.get_game
match_league_base.lose_game
match_league_base.get_point
match_league_base.lose_point
Update other matches of 2 players of current match (flag=0,2)
result_singles.rating_1_pre = current rating_pre
result_singles.rating_2_pre = current rating_pre
result_singles.rating_org_1_pre = current rating_org_pre
result_singles.rating_org_2_pre = current rating_org_pre
result_singles.swiss_score = abs( (new user1_win - new user1_lose) - (new user2_win - new user2_lose)
Calculate swiss_score:
abs( (user1_win - user1_lose in the event) - (user2_win - user2_lose in the event) )
Get user_id_1 player win and lose count:
win_cnt = new match_league_base.wins of user_id_1 player.
lose_cnt = new match_league_base.loses of user_id_1 player.
Search result_singles:
(user_id_1={user_id_1 of current data} OR user_id_2={user_id_1 of current data})
AND
(result_singles.flag=0 OR result_singles.flag=2)
AND
result_singles.event_id={current event.id}
AND
result_singles.event_match_category_id={current category id}
Update swiss_score:
Update swiss_score with the new win_cnt and lose_cnt.
In reference to https://github.com/lifemax/i2unet.com/issues/146
Could you tell me summary how we change them?
When finish match paring
In https://github.com/lifemax/i2unet.com/issues/114
When start match category
There are no rating changes
When start a match
There are no rating changes
When finish a match
In https://github.com/lifemax/i2unet.com/issues/146
試合終了 - Match Ended - Button
Spec: https://github.com/lifemax/i2unet.com/issues/146 ※ use calculateEloRating() function and old data to calculate new rating $rating1 = result_singles.rating_1_pre $rating2 = result_singles.rating_2_pre $score1 = Set to 0 or 1 based on the win_flag of the newly edited data $kFactor = ($win_user_point_sum - $lose_user_point_sum) (newRating, newOrgRating) = calculateEloRating($rating1, $rating2, $score1, $kFactor)
試合終了 - Match Ended - Button - When edit a match after finished
Spec: https://github.com/lifemax/i2unet.com/issues/146 ※ use calculateEloRating() function and old data to calculate new rating $rating1 = result_singles.rating_1_pre $rating2 = result_singles.rating_2_pre $score1 = Set to 0 or 1 based on the win_flag of the newly edited data $kFactor = ($win_user_point_sum - $lose_user_point_sum) (newRating, newOrgRating) = calculateEloRating($rating1, $rating2, $score1, $kFactor)
Note : For matches with flag=9, we update ratings based on the previous match results. For matches with flag=0, 2, 5, we use the results from the last match that has flag=9 to update the ratings. Ex :
不戦敗 - Lose by Default - Button
When finish match category
There are no rating changes
Note
「試合終了」ボタンを押すだけで、レーティングはuser_profile に保存されます。
swiss_score behavior
In https://github.com/lifemax/i2unet.com/issues/146
Calculate swiss_score:
abs( (user1_win - user1_lose in the event) - (user2_win - user2_lose in the event) )
Get user_id_1 player win and lose count:
Search result_singles:
Update swiss_score: