Code Monkey home page Code Monkey logo

fastfiz's Introduction

Installation

  • Install prerequisites: SWIG, GSL
  • Clone and cd to this repo.
  • pip install .

Installation Mac

  • Install prerequisites: SWIG, GSL
    • brew install swig
    • brew install gsl
  • Clone and cd to this repo.
  • CFLAGS="-I/opt/homebrew/Cellar/gsl/2.7.1/include" LDFLAGS="-L/opt/homebrew/Cellar/gsl/2.7.1/lib" pip install .

FastFiz: Computational Billiards Library

Introduction

The FastFiz library consists of two major components: The physics engine and the rules engine, and several auxiliary components. The library also contains python bindings for these components. The library also contains a base class for defining pool AIs (Pool::AIBase).

FastFiz

FastFiz.h implements the motion and collision physics of balls on a pool table independently of rules of any specific game. The Pool::TableState class represents a specific static position of any number of balls on a pool table. ShotParams is a simple struct containing the physical information regarding a cue strike. To simulate a shot, use Pool::TableState::executeShot on an existing Pool::TableState object. This function will modify the Pool::TableState to the final position of the shot and return newly allocated Shot object with the details of the shot. The Pool::Shot::getEventList function returns a list of Pool::Event objects which represent the various events that have occurred during the shot. These events are represented by the Pool::Event class hierarchy.

Rules

The rules library (Rules.h) implements the rules of billiards games by implementing an abstract Pool::GameState class capturing the positioning of the balls on the table and other information needed in the context of a billiards game. The main function used is Pool::GameState::executeShot (which expects a Pool::GameShot object) and modifies the Pool::GameState to the state after the shot has been executed. The returned Pool::ShotResult (in conjunction with examining the update Pool::GameShot object) provides information regarding the outcome of the shot.

Additional components

The Noise.h file defines a class hierarchy (Pool::Noise) for defining types of noise. The Stopwatch.h file defines a Stopwatch class hierarchy used for measuring time (real, CPU, or virtual) in the client and AI. The AiBase.h file defines Pool::AIBase, an abstract base class for Pool AIs. For a valid AI, you must minimally define forGame, breakShot, otherShot, and a constructor.

Original Author

Alon Altman

fastfiz's People

Contributors

kuangyechen avatar sharmapulkit avatar shuklaayush avatar walmsley avatar williamwoldum avatar

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.