Giter VIP home page Giter VIP logo

castle_sim's Introduction

城の防衛シミュレーションツール

概要

お城の通路をイメージして作成したシミュレーションツールです。攻撃者はスタート地点からゴール地点まで一定の速度で移動し、防衛者は防衛地点から一定の間隔で火縄銃を撃ちます。火縄銃で撃たれた弾丸は、距離に応じた確率で攻撃者に命中し、弾丸が命中した攻撃者は死亡します。

環境構築

  1. まず、Python3の環境を構築してください。

  2. このレポジトリをローカルにクローンし、クローンしたディレクトリにChange Directory(cd)してください。

  3. 次に、必要なライブラリをインストールしてください。次のコマンドでインストールできます。

    Mac(bash/zsh)

    $ pip3 install -r requirements.txt

    Windows

    > pip install -r requirements.txt

シミュレーション方法

sim.pyファイルにて、攻撃者の速さ(秒速)、攻撃者の人数(整数)、防衛者が火縄銃を一発撃つのにかかる時間(秒)、スタート地点、ゴール地点の座標(タプル)を設定できます。

control.pyファイルにて、何回シミュレーションするかを設定できます。主に、このファイルを実行することによってsim.pyが実行され、シミュレーションされます。シミュレーションした回数の平均値・平均通過率が出力されます。

spot.csvファイルにて、防衛地点の座標、個数とその防衛地点の人数(同時に銃撃できる回数)を設定できます。x座標,y座標,人数のフォーマットで編集してください。

※座標の単位はメートルを想定して命中率を計算しています。

castle_sim's People

Contributors

ynori123 avatar

Watchers

 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.