Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bayesian-battle

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bayesian-battle - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

32

lib/bayesian-battle/bayesianBattle.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.10.0
var BayesianBattle, _;

@@ -38,22 +38,22 @@

BayesianBattle.prototype.updatePlayerSkills = function(playerAndScoreObjectsArray) {
var chanceOfPlayerOneBeatingPlayerTwo, chanceOfPlayerTwoBeatingPlayerOne, meanStrengthChangePartial, meanStrengthChangePartialSum, meanStrengthChangePartials, pairwiseGameOutcomeValue, pairwisePerformanceUncertainty, player, playerOne, playerTwo, returnArray, squaredDeviationChangePartial, squaredStandardDeviationChangePartialSum, squaredStandardDeviationChangePartials, _i, _j, _len, _len1, _ref;
var chanceOfPlayerOneBeatingPlayerTwo, chanceOfPlayerTwoBeatingPlayerOne, i, j, len, len1, meanStrengthChangePartial, meanStrengthChangePartialSum, meanStrengthChangePartials, pairwiseGameOutcomeValue, pairwisePerformanceUncertainty, player, playerOne, playerTwo, ref, returnArray, squaredDeviationChangePartial, squaredStandardDeviationChangePartialSum, squaredStandardDeviationChangePartials;
this.validateInputArray(playerAndScoreObjectsArray);
returnArray = _.cloneDeep(playerAndScoreObjectsArray);
for (_i = 0, _len = returnArray.length; _i < _len; _i++) {
playerOne = returnArray[_i];
for (i = 0, len = returnArray.length; i < len; i++) {
playerOne = returnArray[i];
meanStrengthChangePartials = [];
squaredStandardDeviationChangePartials = [];
_ref = (function() {
var _k, _len1, _results;
_results = [];
for (_k = 0, _len1 = returnArray.length; _k < _len1; _k++) {
player = returnArray[_k];
ref = (function() {
var l, len1, results;
results = [];
for (l = 0, len1 = returnArray.length; l < len1; l++) {
player = returnArray[l];
if (player !== playerOne) {
_results.push(player);
results.push(player);
}
}
return _results;
return results;
})();
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
playerTwo = _ref[_j];
for (j = 0, len1 = ref.length; j < len1; j++) {
playerTwo = ref[j];
pairwisePerformanceUncertainty = this.calculateTotalPerformanceUncertainty(playerOne.standardDeviation, playerTwo.standardDeviation);

@@ -80,6 +80,6 @@ chanceOfPlayerOneBeatingPlayerTwo = this.calculateChanceOfPlayerOneBeatingPlayerTwo(playerOne.meanStrength, playerTwo.meanStrength, pairwisePerformanceUncertainty);

BayesianBattle.prototype.validateInputArray = function(playerAndScoreObjectsArray) {
var playerAndScoreObject, _i, _len;
var i, len, playerAndScoreObject;
this.validatePlayerArrayLength(playerAndScoreObjectsArray);
for (_i = 0, _len = playerAndScoreObjectsArray.length; _i < _len; _i++) {
playerAndScoreObject = playerAndScoreObjectsArray[_i];
for (i = 0, len = playerAndScoreObjectsArray.length; i < len; i++) {
playerAndScoreObject = playerAndScoreObjectsArray[i];
this.validateRequiredProperties(playerAndScoreObject);

@@ -86,0 +86,0 @@ this.validatePlayerObjectValues(playerAndScoreObject, playerAndScoreObjectsArray.length);

{
"name": "bayesian-battle",
"version": "0.0.6",
"version": "0.0.7",
"author": "Michael Schmatz <michael@codecombat.com> (http://github.com/schmatz)",

@@ -14,3 +14,3 @@ "description":"An implementation of a Bayesian-approximation based game ranking system described by Weng and Lin and used by HackerRank.",

"dependencies": {
"lodash":""
"lodash":"~3.10.1"
},

@@ -17,0 +17,0 @@ "main":"lib/bayesian-battle/bayesianBattle",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc