经理人游戏:如何计算市值? [英] Manager game: How to calculate market values?

查看:26
本文介绍了经理人游戏:如何计算市值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

足球经理比赛中的球员通常具有市场价值.经理根据这些市场价值出售他们的球员.他们会想:哦,这个球员值 3,000,000 美元,所以我会尝试以 3,500,000 美元的价格卖掉他".

Usually players in a soccer manager game have market values. The managers sell their players in accordance with these market values. They think: "Oh, the player is worth 3,000,00 so I'll try to sell him for 3,500,000".

所有球员都具备三个基本素质:

All players have three basic qualities:

  • 强度值 (1-99)
  • 他们所能达到的最大力量 (1-99)
  • 动机 (1-5)
  • 当前年龄(16-40 岁)

根据这些值,我计算了当前的市场价值.但是我想根据最近一段时间的球员转会动态计算市场价值.我怎么能这样做?

Based on these values, I calculate the market values at the moment. But I would like to calculate the market values dynamically according to the player transfers in the last period of time. How could I do this?

我有上面提到的素质和最近一段时间的球员转会可以计算.

I have the above named qualities and the player transfers of the last period of time available for calculation.

我怎么计算呢?我是否必须按质量对最后转会的球员进行分组,然后简单地取平均转会价格?

How could I calculate it? Do I have to group the last transferred players by the qualities and simply take the average transfer price?

希望你能帮我.

注意:玩家=物品/商品,经理=用户

Note: players=items/goods, managers=users

推荐答案

我的建议:定义一个距离函数 需要两个球员的统计数据并返回一个距离值.现在你有两者之间的距离(对应于它们之间的相似性)你可以使用 K-means 算法来寻找相似玩家的集群.

My suggestion: define a distance function that takes two players stats and return a distance value. Now that you have a distance between the two (that corresponds to the similarity between them) you can use the K-means algorithm to find clusters of similar players.

对于每个集群,您可以采用多个值来帮助您计算所谓的市场价格"(例如平均值或中值).

For each cluster you can take a number of values that can help you calculate the so called 'market price' (like the average or median value).

这是一个非常简单的示例,说明如何计算两个玩家之间的距离函数:

Here's a very simple example of how you could compute the distance function between two players:

float distance(Player player1, Player player2){
    float distance = 0.0;

    distance += abs(player1.strength - player2.strength) / strengthRange;
    distance += abs(player1.maxStrength - player2.maxStrength) / maxStrength;
    distance += abs(player1.motivation - player2.motivation) / motivationRange;
    distance += abs(player1.age - player2.age) / ageRange;

    return distance;
}

既然你有了距离函数,你就可以应用 k-means 算法了:

Now that you have the distance function you can apply the k-means algorithm:

  1. 将每个玩家随机分配到一个集群中.

  1. Assign each player randomly to a cluster.

现在计算每个簇的质心.在您的情况下,质心坐标将为(强度、最大强度、动机、年龄).例如,要计算质心强度坐标,只需平均集群中所有玩家的强度即可.

Now compute the centroid of each cluster. In your case the centroid coordinates will be (strength, maxStrength, motivation, age). To compute the centroid strength coordinate, for example, just average the strengths for the all players in the cluster.

现在将每个玩家分配到最近的质心.请注意,在此步骤中,某些玩家可能会更改其集群.

Now assign each player to the nearest centroid. Note that in this step some players may have its cluster changed.

重复第 2 步和第 3 步,直到收敛,或者换句话说,直到没有玩家在第 3 步中更改其集群.

Repeat steps 2 and 3 until you have convergence or, in other words, until no player have its cluster changed in step 3.

现在您有了集群,您可以计算类似玩家的平均价格.

Now that you have the clusters, you can calculate the average price fore similar players.

这篇关于经理人游戏:如何计算市值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆