Giter Club home page Giter Club logo

footballmanager.simulator's Introduction

BCH compliance

FootballManager.Simulator

Simulates a football competition of 4 teams based on strength.

Pre-requisites

Be sure to install .Net Core 2.0 Runtime.

Use

Clone the repository and run the console application via this command

dotnet .\App\FM.Simulator.dll

Answer the question and it will run x simulations of a competition. The competition consists of 4 teams:

Team Strength Agggression
Ajax 100 10
Feyenoord 100 40
PSV 100 30
FC Utrecht 100 20

The followoing result is shown for each simulation:

  • Match events
  • Final results of all 6 matches
  • Final standing

The final result show:

  • Match with the highest scoring.
  • Number of times each team became champion
  • Top 10 of most occuring score.

Explanation

The simulator takes the team strength into account when calculating a match. The team aggression is used which team will get a yellow/ red card. The following steps are executed per simulation

  • Create a new competition

  • Add 4 teams to the competition

  • Generate a single schedule that produces 6 matches. Teams play 3 matches, the home/ away team is random.

  • Simulate each match

    • Determine match length: 90 minutes + 2-5 minutes of injury time
    • For each minute pick a random 'match event' based on this table and the team strength or aggression (3rd column):
    Event Probability Based on
    Yellow card 3 Team agression
    Red card 1 Team agression
    Goal 2 Team strength
    Injury 1 Team strength (todo: move to opponent agression)
    Nothing 93 -

    Example: In the 4rd minute a goal event is simulated. Both team strengths are taken into account to determine which teams scores.

    • After the match is finished, the competition standing is updated.
    • After all 6 matched are played, the final position is calculated, based on:
      • Most Points
      • Most Goal difference (NL: doelsaldo)
      • Most Goals scored
      • Result between the 2 teams If all is the same, the position will be equal. This simulator doesn't support 3 or more teams to finish equal.
    • Match results are printed.
    • Final competition standing is printed.

Expectations

If you run the simulation a 1000 times, the expectation is that each team becomes champion +/- 250 times (in case all teams have equal strength).

Try out other strengths

dotnet .\App\FM.Simulator.dll --teamStrengths 500,100,1,10

This translates to Ajax (500), Feyenoord (100), PSV (1), FC Utrecht (10)

Sneak preview

screenshot

footballmanager.simulator's People

Contributors

kloarubeek avatar

Stargazers

Bruno França avatar

Watchers

James Cloos avatar  avatar

Forkers

hedpe-

footballmanager.simulator's Issues

Todo's

  • Test match events
  • Document how to use this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.