我有一系列餐厅,我需要根据以下规则计算每家餐厅的排名:
到我的距离(公里)(weight=30)
喜欢(weight=10)
$restaurants = [
{name: "KFC", distance: 17, likes: 3},
{name: "Macdonalds", distance: 2, likes: 9},
{name: "Pizza Hut", distance: 9, likes: 12},
{name: "Burger King", distance: 14, likes: 17},
];
排名越高意味着这家餐厅离我很近,并且根据等式有更多的喜欢。
等式应该是什么?
喵喵时光机