承接 viaductmedia/roundrobin-scheduler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

viaductmedia/roundrobin-scheduler

Composer 安装命令:

composer require viaductmedia/roundrobin-scheduler

包简介

Utils for round-robin tournaments. Laravel ready.

README 文档

README

You can easily create round-robin rounds for a tournament.

Laravel ready.

There are two methods. One is BergerAlgorithm($teams) which takes an array of teams as argument and returns the set of matches.

Given an array of teams like:

['Juventus', 'Milan', 'Roma', 'Napoli', 'Inter']    

the method returns a multilevel array, in which the first level is the game day:

[
    [
        ['REST', 'Juventus'], ['Inter', 'Milan'],  ['Napoli', 'Roma']
    ],
    [
        ['Juventus', 'Milan'], ['Roma', 'REST'], ['Napoli', 'Inter']
    ],
    [
        ['Roma', 'Juventus'], ['Milan', 'Napoli'], ['REST', 'Inter']
    ],
    [
        ['Juventus', 'Napoli'], ['Inter', 'Roma'], ['REST', 'Milan']
    ],
    [
        ['Inter', 'Juventus'], ['Napoli', 'REST'], ['Roma', 'Milan']
    ]
]

If the team count is odd, it adds a dummy team.

The other one is distributeAmongRounds($teams, $rounds) which takes as arguments an array of teams and the desired amount of rounds. I suggest you to shuffle() your team dataset before providing it to the function.

Given an array of teams like this and '3' as a desired amount of rounds:

['Milan', 'Roma', 'Juventus', 'Napoli', 'Inter', 'Lazio', 'Fiorentina', 'Udinese', 'Sampdoria', 'Genoa'],

the method returns a multilevel array:

[
    ['Genoa', 'Fiorentina', 'Napoli', 'Milan'],
    ['Sampdoria', 'Lazio', 'Juventus'],
    ['Udinese', 'Inter', 'Roma']
]

Installation

composer require lucagentile\roundrobin-scheduler

Laravel:

add the ServiceProvider class name under 'providers' in config/app.php https://laravel.com/docs/5.4/providers#registering-providers

Gautile\RoundRobin\RoundRobinSchedulerServiceProvider::class

then add the alias under 'aliases' for the Facade

'RoundRobinScheduler' => Gautile\RoundRobin\Facades\RoundRobinScheduler::class,

License

MIT

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固